src/main/java/de/viper/survivalplus/SurvivalPlus.java aktualisiert
This commit is contained in:
@@ -58,7 +58,7 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
private AFKListener afkListener;
|
private AFKListener afkListener;
|
||||||
private GraveListener graveListener;
|
private GraveListener graveListener;
|
||||||
private SitListener sitListener;
|
private SitListener sitListener;
|
||||||
private PlayerJoinListener playerJoinListener; // Neuer Listener
|
private PlayerJoinListener playerJoinListener;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
@@ -70,14 +70,16 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
createLeashesFile();
|
createLeashesFile();
|
||||||
createMobCapFile();
|
createMobCapFile();
|
||||||
|
|
||||||
// FirstJoinListener registrieren
|
// PluginManager holen
|
||||||
PluginManager pluginManager = getServer().getPluginManager();
|
PluginManager pluginManager = getServer().getPluginManager();
|
||||||
pluginManager.registerEvents(new FirstJoinListener(), this);
|
|
||||||
|
|
||||||
// FriendCommand instanzieren für PlayerJoinListener
|
// FriendCommand instanzieren
|
||||||
FriendCommand friendCommand = new FriendCommand(this, friendsConfig, langConfig, getLogger());
|
FriendCommand friendCommand = new FriendCommand(this, friendsConfig, langConfig, getLogger());
|
||||||
|
|
||||||
// Commands
|
// StatsManager vor den Listenern initialisieren
|
||||||
|
statsManager = new StatsManager(this);
|
||||||
|
|
||||||
|
// 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));
|
||||||
getCommand("sethome").setExecutor(new HomeCommand(this));
|
getCommand("sethome").setExecutor(new HomeCommand(this));
|
||||||
@@ -119,7 +121,7 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
sitListener = new SitListener(this);
|
sitListener = new SitListener(this);
|
||||||
afkListener = new AFKListener(this);
|
afkListener = new AFKListener(this);
|
||||||
graveListener = new GraveListener(this);
|
graveListener = new GraveListener(this);
|
||||||
playerJoinListener = new PlayerJoinListener(friendCommand); // PlayerJoinListener registrieren
|
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);
|
||||||
@@ -131,16 +133,15 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
pluginManager.registerEvents(new LoginListener(this), this);
|
pluginManager.registerEvents(new LoginListener(this), this);
|
||||||
pluginManager.registerEvents(new DebugArmorStandListener(), this);
|
pluginManager.registerEvents(new DebugArmorStandListener(), this);
|
||||||
pluginManager.registerEvents(new ArmorStandDestroyListener(), this);
|
pluginManager.registerEvents(new ArmorStandDestroyListener(), this);
|
||||||
pluginManager.registerEvents(playerJoinListener, this); // Listener hinzufügen
|
pluginManager.registerEvents(new FirstJoinListener(), this);
|
||||||
|
pluginManager.registerEvents(playerJoinListener, this);
|
||||||
|
|
||||||
// Befehle mit BlockManager und Konfiguration registrieren
|
// Befehle mit BlockManager und Konfiguration registrieren
|
||||||
getCommand("block").setExecutor(new BlockCommand(blockManager, config));
|
getCommand("block").setExecutor(new BlockCommand(blockManager, config));
|
||||||
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
|
// Stats-Befehl
|
||||||
statsManager = new StatsManager(this);
|
|
||||||
pluginManager.registerEvents(new StatsListener(this, statsManager), this);
|
|
||||||
getCommand("stats").setExecutor(new StatsCommand(this, statsManager));
|
getCommand("stats").setExecutor(new StatsCommand(this, statsManager));
|
||||||
|
|
||||||
sleepListener = new SleepListener(this);
|
sleepListener = new SleepListener(this);
|
||||||
@@ -605,7 +606,7 @@ public class SurvivalPlus extends JavaPlugin {
|
|||||||
sitListener = new SitListener(this);
|
sitListener = new SitListener(this);
|
||||||
pm.registerEvents(sitListener, this);
|
pm.registerEvents(sitListener, this);
|
||||||
|
|
||||||
playerJoinListener = new PlayerJoinListener(friendCommand); // PlayerJoinListener neu registrieren
|
playerJoinListener = new PlayerJoinListener(friendCommand);
|
||||||
pm.registerEvents(playerJoinListener, this);
|
pm.registerEvents(playerJoinListener, this);
|
||||||
|
|
||||||
pm.registerEvents(new InventoryClickListener(this), this);
|
pm.registerEvents(new InventoryClickListener(this), this);
|
||||||
|
Reference in New Issue
Block a user