Add welcome message to show how to use the plugin
This commit is contained in:
@@ -2,12 +2,14 @@ package nl.interestingcorner.coordinates;
|
|||||||
|
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.PluginCommand;
|
import org.bukkit.command.PluginCommand;
|
||||||
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import nl.interestingcorner.coordinates.commands.CoordinatesCommand;
|
import nl.interestingcorner.coordinates.commands.CoordinatesCommand;
|
||||||
import nl.interestingcorner.coordinates.db.Coordinate;
|
import nl.interestingcorner.coordinates.db.Coordinate;
|
||||||
import nl.interestingcorner.coordinates.db.CoordinatesDatabaseManager;
|
import nl.interestingcorner.coordinates.db.CoordinatesDatabaseManager;
|
||||||
import nl.interestingcorner.coordinates.listeners.MapUseListener;
|
import nl.interestingcorner.coordinates.listeners.MapUseListener;
|
||||||
|
import nl.interestingcorner.coordinates.listeners.PlayerJoinListener;
|
||||||
import nl.interestingcorner.core.MinecraftColor;
|
import nl.interestingcorner.core.MinecraftColor;
|
||||||
|
|
||||||
public class App extends JavaPlugin {
|
public class App extends JavaPlugin {
|
||||||
@@ -18,7 +20,9 @@ public class App extends JavaPlugin {
|
|||||||
CoordinatesDatabaseManager.INSTANCE.initialize(this);
|
CoordinatesDatabaseManager.INSTANCE.initialize(this);
|
||||||
getLogger().info("Successfully initialized database");
|
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();
|
registerCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user