mirror of
https://github.com/plexusorg/ExampleModule.git
synced 2024-11-23 20:55:01 +00:00
Update example module to make it better suited as a templaet
This commit is contained in:
parent
e3d4fa6102
commit
538c9d3230
49
build.gradle
49
build.gradle
@ -1,49 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id "java"
|
|
||||||
id "maven-publish"
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
url = uri("https://papermc.io/repo/repository/maven-public/")
|
|
||||||
}
|
|
||||||
|
|
||||||
maven {
|
|
||||||
url = uri("https://nexus.telesphoreo.me/repository/plex")
|
|
||||||
}
|
|
||||||
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnly "org.projectlombok:lombok:1.18.22"
|
|
||||||
annotationProcessor "org.projectlombok:lombok:1.18.22"
|
|
||||||
compileOnly "io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT"
|
|
||||||
compileOnly 'dev.plex:Plex:0.8'
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "dev.plex"
|
|
||||||
version = "1.0"
|
|
||||||
description = "ExampleModule"
|
|
||||||
|
|
||||||
java {
|
|
||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
maven(MavenPublication) {
|
|
||||||
from(components.java)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
|
||||||
options.encoding = "UTF-8"
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
javadoc {
|
|
||||||
options.memberLevel = JavadocMemberLevel.PRIVATE
|
|
||||||
}
|
|
||||||
}
|
|
50
build.gradle.kts
Normal file
50
build.gradle.kts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
plugins {
|
||||||
|
java
|
||||||
|
`maven-publish`
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url = uri("https://papermc.io/repo/repository/maven-public/")
|
||||||
|
}
|
||||||
|
|
||||||
|
maven {
|
||||||
|
url = uri("https://nexus.telesphoreo.me/repository/plex/")
|
||||||
|
}
|
||||||
|
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly("org.projectlombok:lombok:1.18.22")
|
||||||
|
annotationProcessor("org.projectlombok:lombok:1.18.22")
|
||||||
|
compileOnly("io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT")
|
||||||
|
compileOnly("dev.plex:Plex:0.9")
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "dev.plex"
|
||||||
|
version = "1.0"
|
||||||
|
description = "ExampleModule"
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
create<MavenPublication>("maven") {
|
||||||
|
from(components["java"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.getByName<Jar>("jar") {
|
||||||
|
archiveBaseName.set("Plex-ExampleModule")
|
||||||
|
archiveVersion.set("")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
javadoc {
|
||||||
|
options.memberLevel = JavadocMemberLevel.PRIVATE
|
||||||
|
}
|
||||||
|
}
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
rootProject.name = 'plexmodule-template'
|
|
||||||
|
|
2
settings.gradle.kts
Normal file
2
settings.gradle.kts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
rootProject.name = "plexmodule-template"
|
||||||
|
|
@ -1,6 +1,7 @@
|
|||||||
package dev.plex;
|
package dev.plex;
|
||||||
|
|
||||||
import dev.plex.command.ExampleCommand;
|
import dev.plex.command.ExampleCommand;
|
||||||
|
import dev.plex.listener.ExampleListener;
|
||||||
import dev.plex.module.PlexModule;
|
import dev.plex.module.PlexModule;
|
||||||
|
|
||||||
public class ExampleModule extends PlexModule
|
public class ExampleModule extends PlexModule
|
||||||
@ -9,10 +10,12 @@ public class ExampleModule extends PlexModule
|
|||||||
public void enable()
|
public void enable()
|
||||||
{
|
{
|
||||||
registerCommand(new ExampleCommand());
|
registerCommand(new ExampleCommand());
|
||||||
|
registerListener(new ExampleListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disable()
|
public void disable()
|
||||||
{
|
{
|
||||||
|
// Unregistering listeners / commands is handled by Plex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
17
src/main/java/dev/plex/listener/ExampleListener.java
Normal file
17
src/main/java/dev/plex/listener/ExampleListener.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package dev.plex.listener;
|
||||||
|
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
|
import net.kyori.adventure.text.format.NamedTextColor;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
public class ExampleListener extends PlexListener
|
||||||
|
{
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
player.sendMessage(Component.text("This is a message from Plex's example module!").color(NamedTextColor.GOLD));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user