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 GraveListener graveListener;
|
||||
private SitListener sitListener;
|
||||
private PlayerJoinListener playerJoinListener; // Neuer Listener
|
||||
private PlayerJoinListener playerJoinListener;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
@@ -70,14 +70,16 @@ public class SurvivalPlus extends JavaPlugin {
|
||||
createLeashesFile();
|
||||
createMobCapFile();
|
||||
|
||||
// FirstJoinListener registrieren
|
||||
// PluginManager holen
|
||||
PluginManager pluginManager = getServer().getPluginManager();
|
||||
pluginManager.registerEvents(new FirstJoinListener(), this);
|
||||
|
||||
// FriendCommand instanzieren für PlayerJoinListener
|
||||
// FriendCommand instanzieren
|
||||
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("sp").setExecutor(new PluginCommand(this));
|
||||
getCommand("sethome").setExecutor(new HomeCommand(this));
|
||||
@@ -119,7 +121,7 @@ public class SurvivalPlus extends JavaPlugin {
|
||||
sitListener = new SitListener(this);
|
||||
afkListener = new AFKListener(this);
|
||||
graveListener = new GraveListener(this);
|
||||
playerJoinListener = new PlayerJoinListener(friendCommand); // PlayerJoinListener registrieren
|
||||
playerJoinListener = new PlayerJoinListener(friendCommand);
|
||||
|
||||
pluginManager.registerEvents(new ChatBlockListener(blockManager), 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 DebugArmorStandListener(), 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
|
||||
getCommand("block").setExecutor(new BlockCommand(blockManager, config));
|
||||
getCommand("blocklist").setExecutor(new BlockListCommand(blockManager, config));
|
||||
getCommand("unblock").setExecutor(new UnblockCommand(blockManager, config));
|
||||
|
||||
// Stats
|
||||
statsManager = new StatsManager(this);
|
||||
pluginManager.registerEvents(new StatsListener(this, statsManager), this);
|
||||
// Stats-Befehl
|
||||
getCommand("stats").setExecutor(new StatsCommand(this, statsManager));
|
||||
|
||||
sleepListener = new SleepListener(this);
|
||||
@@ -605,7 +606,7 @@ public class SurvivalPlus extends JavaPlugin {
|
||||
sitListener = new SitListener(this);
|
||||
pm.registerEvents(sitListener, this);
|
||||
|
||||
playerJoinListener = new PlayerJoinListener(friendCommand); // PlayerJoinListener neu registrieren
|
||||
playerJoinListener = new PlayerJoinListener(friendCommand);
|
||||
pm.registerEvents(playerJoinListener, this);
|
||||
|
||||
pm.registerEvents(new InventoryClickListener(this), this);
|
||||
|
Reference in New Issue
Block a user