Add welcome message to show how to use the plugin

This commit is contained in:
SemvdH
2026-02-05 20:27:44 +01:00
parent ec00b18282
commit 09236a360b
2 changed files with 21 additions and 1 deletions

View File

@@ -2,12 +2,14 @@ package nl.interestingcorner.coordinates;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import nl.interestingcorner.coordinates.commands.CoordinatesCommand;
import nl.interestingcorner.coordinates.db.Coordinate;
import nl.interestingcorner.coordinates.db.CoordinatesDatabaseManager;
import nl.interestingcorner.coordinates.listeners.MapUseListener;
import nl.interestingcorner.coordinates.listeners.PlayerJoinListener;
import nl.interestingcorner.core.MinecraftColor;
public class App extends JavaPlugin {
@@ -18,7 +20,9 @@ public class App extends JavaPlugin {
CoordinatesDatabaseManager.INSTANCE.initialize(this);
getLogger().info("Successfully initialized database");
getServer().getPluginManager().registerEvents(new MapUseListener(), this);
PluginManager pluginManager = getServer().getPluginManager();
pluginManager.registerEvents(new MapUseListener(), this);
pluginManager.registerEvents(new PlayerJoinListener(), this);
registerCommands();
}

View File

@@ -0,0 +1,16 @@
package nl.interestingcorner.coordinates.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import nl.interestingcorner.core.MinecraftColor;
public class PlayerJoinListener implements Listener{
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
// This is just an example of a listener. You can remove this if you don't need it.
event.getPlayer().sendMessage(MinecraftColor.LIGHT_PURPLE.toColorCode() + "This server uses the IC-Coords plugin." + MinecraftColor.YELLOW.toColorCode() + " Use /ic-coords help to see the available commands.");
}
}