mirror of
https://github.com/plexusorg/ExampleModule.git
synced 2026-06-04 04:36:55 +00:00
Update example module to make it better suited as a templaet
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package dev.plex;
|
||||
|
||||
import dev.plex.command.ExampleCommand;
|
||||
import dev.plex.listener.ExampleListener;
|
||||
import dev.plex.module.PlexModule;
|
||||
|
||||
public class ExampleModule extends PlexModule
|
||||
@@ -9,10 +10,12 @@ public class ExampleModule extends PlexModule
|
||||
public void enable()
|
||||
{
|
||||
registerCommand(new ExampleCommand());
|
||||
registerListener(new ExampleListener());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disable()
|
||||
{
|
||||
// Unregistering listeners / commands is handled by Plex
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user