src/main/java/de/viper/survivalplus/SurvivalPlus.java aktualisiert
This commit is contained in:
@@ -60,8 +60,8 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
private SitListener sitListener;
|
private SitListener sitListener;
|
||||||
private PlayerJoinListener playerJoinListener;
|
private PlayerJoinListener playerJoinListener;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
updateConfigFiles(); // Config-Dateien aktualisieren
|
updateConfigFiles(); // Config-Dateien aktualisieren
|
||||||
createHomesFile();
|
createHomesFile();
|
||||||
createGravesFile();
|
createGravesFile();
|
||||||
@@ -79,6 +79,12 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
// StatsManager vor den Listenern initialisieren
|
// StatsManager vor den Listenern initialisieren
|
||||||
statsManager = new StatsManager(this);
|
statsManager = new StatsManager(this);
|
||||||
|
|
||||||
|
// Listener initialisieren (sitListener zuerst!)
|
||||||
|
sitListener = new SitListener(this);
|
||||||
|
afkListener = new AFKListener(this);
|
||||||
|
graveListener = new GraveListener(this);
|
||||||
|
playerJoinListener = new PlayerJoinListener(friendCommand);
|
||||||
|
|
||||||
// Commands registrieren
|
// Commands registrieren
|
||||||
getCommand("gm").setExecutor(new GamemodeCommand(this));
|
getCommand("gm").setExecutor(new GamemodeCommand(this));
|
||||||
getCommand("sp").setExecutor(new PluginCommand(this));
|
getCommand("sp").setExecutor(new PluginCommand(this));
|
||||||
@@ -101,12 +107,14 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
getCommand("trash").setExecutor(new TrashCommand());
|
getCommand("trash").setExecutor(new TrashCommand());
|
||||||
getCommand("workbench").setExecutor(new WorkbenchCommand());
|
getCommand("workbench").setExecutor(new WorkbenchCommand());
|
||||||
getCommand("anvil").setExecutor(new AnvilCommand());
|
getCommand("anvil").setExecutor(new AnvilCommand());
|
||||||
|
|
||||||
TeleportCommands teleportCommands = new TeleportCommands(this);
|
TeleportCommands teleportCommands = new TeleportCommands(this);
|
||||||
getCommand("tp").setExecutor(teleportCommands);
|
getCommand("tp").setExecutor(teleportCommands);
|
||||||
getCommand("tphere").setExecutor(teleportCommands);
|
getCommand("tphere").setExecutor(teleportCommands);
|
||||||
getCommand("tpa").setExecutor(teleportCommands);
|
getCommand("tpa").setExecutor(teleportCommands);
|
||||||
getCommand("tpaccept").setExecutor(teleportCommands);
|
getCommand("tpaccept").setExecutor(teleportCommands);
|
||||||
getCommand("tpdeny").setExecutor(teleportCommands);
|
getCommand("tpdeny").setExecutor(teleportCommands);
|
||||||
|
|
||||||
getCommand("kit").setExecutor(new KitCommand(this));
|
getCommand("kit").setExecutor(new KitCommand(this));
|
||||||
|
|
||||||
// BlockManager erstellen
|
// BlockManager erstellen
|
||||||
@@ -118,11 +126,6 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
// Listener registrieren
|
// Listener registrieren
|
||||||
BackpackRecipe.register(this, langConfig);
|
BackpackRecipe.register(this, langConfig);
|
||||||
|
|
||||||
sitListener = new SitListener(this);
|
|
||||||
afkListener = new AFKListener(this);
|
|
||||||
graveListener = new GraveListener(this);
|
|
||||||
playerJoinListener = new PlayerJoinListener(friendCommand);
|
|
||||||
|
|
||||||
pluginManager.registerEvents(new ChatBlockListener(blockManager), this);
|
pluginManager.registerEvents(new ChatBlockListener(blockManager), this);
|
||||||
pluginManager.registerEvents(new InventoryClickListener(this), this);
|
pluginManager.registerEvents(new InventoryClickListener(this), this);
|
||||||
pluginManager.registerEvents(sitListener, this);
|
pluginManager.registerEvents(sitListener, this);
|
||||||
@@ -141,7 +144,7 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
getCommand("blocklist").setExecutor(new BlockListCommand(blockManager, config));
|
getCommand("blocklist").setExecutor(new BlockListCommand(blockManager, config));
|
||||||
getCommand("unblock").setExecutor(new UnblockCommand(blockManager, config));
|
getCommand("unblock").setExecutor(new UnblockCommand(blockManager, config));
|
||||||
|
|
||||||
// Stats-Befehl
|
// Stats-Befehl registrieren
|
||||||
getCommand("stats").setExecutor(new StatsCommand(this, statsManager));
|
getCommand("stats").setExecutor(new StatsCommand(this, statsManager));
|
||||||
|
|
||||||
sleepListener = new SleepListener(this);
|
sleepListener = new SleepListener(this);
|
||||||
@@ -166,11 +169,11 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
// AutoClear Task starten
|
// AutoClear Task starten
|
||||||
startAutoClearTask();
|
startAutoClearTask();
|
||||||
|
|
||||||
// Beispiel ArmorStand
|
// Beispiel ArmorStand spawnen
|
||||||
spawnArmorStandExample();
|
spawnArmorStandExample();
|
||||||
|
|
||||||
getLogger().info(getMessage("plugin.enabled"));
|
getLogger().info(getMessage("plugin.enabled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void spawnArmorStandExample() {
|
private void spawnArmorStandExample() {
|
||||||
World world = Bukkit.getWorld("world");
|
World world = Bukkit.getWorld("world");
|
||||||
|
Reference in New Issue
Block a user