init
This commit is contained in:
31
lib/build.gradle.kts
Normal file
31
lib/build.gradle.kts
Normal file
@ -0,0 +1,31 @@
|
||||
plugins { kotlin("jvm") version "1.8.0" }
|
||||
|
||||
group = "org.punkcraft"
|
||||
version = "1.0.0-Sponge"
|
||||
description = "example plugin description"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://repo.spongepowered.org/maven")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.spongepowered:spongeapi:7.4.0")
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
tasks.jar {
|
||||
from("src/main/resources/plugin.json") {
|
||||
include("plugin.json")
|
||||
}
|
||||
manifest {
|
||||
attributes(
|
||||
"Main-Class" to "org.punkcraft.example.Example"
|
||||
)
|
||||
}
|
||||
archiveBaseName.set("Example")
|
||||
}
|
||||
22
lib/src/main/java/org/punkcraft/example/Example.java
Normal file
22
lib/src/main/java/org/punkcraft/example/Example.java
Normal file
@ -0,0 +1,22 @@
|
||||
package org.punkcraft.example;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.slf4j.Logger;
|
||||
import org.spongepowered.api.event.Listener;
|
||||
import org.spongepowered.api.event.game.state.GameStartedServerEvent;
|
||||
import org.spongepowered.api.plugin.Plugin;
|
||||
|
||||
@Plugin(id = "example", name = "Example", version = "1.0", description = "Example")
|
||||
public class Example {
|
||||
@Inject
|
||||
private Logger logger;
|
||||
|
||||
@Listener
|
||||
public void onServerStart(GameStartedServerEvent event) {
|
||||
logger.info("Successfully running Example");
|
||||
}
|
||||
|
||||
public Logger getLogger() {
|
||||
return logger;
|
||||
}
|
||||
}
|
||||
29
lib/src/main/resources/META-INF/sponge_plugins.json
Normal file
29
lib/src/main/resources/META-INF/sponge_plugins.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"loader": {
|
||||
"name": "java_plain",
|
||||
"version": "1.0"
|
||||
},
|
||||
"license": "All-Rights-Reserved",
|
||||
"plugins": [
|
||||
{
|
||||
"id": "example",
|
||||
"name": "Example",
|
||||
"version": "${version}",
|
||||
"entrypoint": "org.punkcraft.example.Example",
|
||||
"description": "My plugin description",
|
||||
"branding": {},
|
||||
"links": {
|
||||
},
|
||||
"contributors": [
|
||||
],
|
||||
"dependencies": [
|
||||
{
|
||||
"id": "spongeapi",
|
||||
"version": "7.4.0",
|
||||
"load-order": "after",
|
||||
"optional": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user