Update from Git Manager GUI
This commit is contained in:
@@ -13,13 +13,16 @@ import de.nexuslobby.modules.settings.LobbySettingsModule;
|
||||
import de.nexuslobby.modules.portal.PortalManager;
|
||||
import de.nexuslobby.modules.portal.PortalCommand;
|
||||
import de.nexuslobby.modules.servers.ServerSwitcherListener;
|
||||
import de.nexuslobby.modules.servers.ServerChecker; // Hinzugefügt
|
||||
import de.nexuslobby.modules.servers.ServerChecker;
|
||||
import de.nexuslobby.modules.armorstandtools.*;
|
||||
import de.nexuslobby.modules.gadgets.GadgetModule;
|
||||
import de.nexuslobby.modules.hologram.HologramModule;
|
||||
import de.nexuslobby.modules.mapart.MapArtModule;
|
||||
import de.nexuslobby.modules.intro.IntroModule;
|
||||
import de.nexuslobby.modules.border.BorderModule;
|
||||
import de.nexuslobby.modules.parkour.ParkourManager;
|
||||
import de.nexuslobby.modules.parkour.ParkourListener;
|
||||
import de.nexuslobby.modules.player.PlayerInspectModule; // NEU
|
||||
import de.nexuslobby.utils.*;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
@@ -38,6 +41,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
@@ -62,6 +66,7 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
||||
private MapArtModule mapArtModule;
|
||||
private IntroModule introModule;
|
||||
private BorderModule borderModule;
|
||||
private ParkourManager parkourManager;
|
||||
|
||||
private ConversationManager conversationManager;
|
||||
|
||||
@@ -85,6 +90,10 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
||||
return conversationManager;
|
||||
}
|
||||
|
||||
public ParkourManager getParkourManager() {
|
||||
return parkourManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
@@ -94,15 +103,17 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
||||
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||
moduleManager = new ModuleManager(this);
|
||||
|
||||
// --- Parkour & Conversation Initialisierung ---
|
||||
this.parkourManager = new ParkourManager(this);
|
||||
this.conversationManager = new ConversationManager(this);
|
||||
|
||||
ArmorStandGUI.init();
|
||||
|
||||
registerModules();
|
||||
moduleManager.enableAll();
|
||||
|
||||
registerListeners();
|
||||
|
||||
// --- STATUS CHECKER START ---
|
||||
ServerChecker.startGlobalChecker();
|
||||
|
||||
new ArmorStandLookAtModule();
|
||||
@@ -124,40 +135,11 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (conversationManager == null) return;
|
||||
|
||||
for (World world : Bukkit.getWorlds()) {
|
||||
for (ArmorStand as : world.getEntitiesByClass(ArmorStand.class)) {
|
||||
if (as.getScoreboardTags().stream().anyMatch(tag -> tag.startsWith("conv_id:"))) {
|
||||
boolean playerNearby = false;
|
||||
for (Entity nearby : as.getNearbyEntities(30, 30, 30)) {
|
||||
if (nearby instanceof Player) {
|
||||
playerNearby = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (playerNearby) {
|
||||
String dialogId = null;
|
||||
String partnerUUID = null;
|
||||
|
||||
for (String tag : as.getScoreboardTags()) {
|
||||
if (tag.startsWith("conv_id:")) dialogId = tag.split(":")[1];
|
||||
if (tag.startsWith("conv_partner:")) partnerUUID = tag.split(":")[1];
|
||||
}
|
||||
|
||||
if (dialogId != null && partnerUUID != null) {
|
||||
try {
|
||||
UUID partnerId = UUID.fromString(partnerUUID);
|
||||
conversationManager.playConversation(as.getUniqueId(), partnerId, dialogId);
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (conversationManager != null) {
|
||||
conversationManager.startAllAutomatedConversations();
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, 20L * 30, 20L * 90);
|
||||
}.runTaskTimer(this, 100L, 300L);
|
||||
}
|
||||
|
||||
public void reloadPlugin() {
|
||||
@@ -250,6 +232,9 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
||||
this.tablistModule = new TablistModule();
|
||||
moduleManager.registerModule(tablistModule);
|
||||
|
||||
// Player Inspect Modul registrieren
|
||||
moduleManager.registerModule(new PlayerInspectModule()); // NEU
|
||||
|
||||
this.portalManager = new PortalManager(this);
|
||||
moduleManager.registerModule(portalManager);
|
||||
}
|
||||
@@ -262,6 +247,24 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
||||
getServer().getPluginManager().registerEvents(new PlayerHider(), this);
|
||||
getServer().getPluginManager().registerEvents(new MaintenanceListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new ASTListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new ParkourListener(this.parkourManager), this);
|
||||
|
||||
getServer().getPluginManager().registerEvents(new NPCClickListener(), this);
|
||||
}
|
||||
|
||||
public class NPCClickListener implements Listener {
|
||||
@EventHandler
|
||||
public void onNPCClick(PlayerInteractAtEntityEvent event) {
|
||||
Entity entity = event.getRightClicked();
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (entity instanceof ArmorStand as) {
|
||||
if (as.getScoreboardTags().contains("parkour_trainer")) {
|
||||
player.performCommand("warp parkour");
|
||||
player.sendMessage("§6§lTrainer §8» §aViel Erfolg beim Parkour! Gib dein Bestes!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@@ -348,7 +351,9 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
||||
@Override
|
||||
public void onDisable() {
|
||||
getServer().getMessenger().unregisterOutgoingPluginChannel(this, "BungeeCord");
|
||||
if (moduleManager != null) moduleManager.disableAll();
|
||||
if (moduleManager != null) {
|
||||
moduleManager.disableAll();
|
||||
}
|
||||
getLogger().info("NexusLobby deaktiviert.");
|
||||
}
|
||||
|
||||
@@ -417,17 +422,22 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
||||
if (params.equalsIgnoreCase("version")) return NexusLobby.this.getDescription().getVersion();
|
||||
if (params.equalsIgnoreCase("build_mode")) return BuildCommand.isInBuildMode(player) ? "§aAktiv" : "§cInaktiv";
|
||||
if (params.equalsIgnoreCase("silent_join")) return silentPlayers.contains(player.getUniqueId()) ? "§aEin" : "§cAus";
|
||||
if (params.equalsIgnoreCase("parkour_top")) {
|
||||
return parkourManager != null ? parkourManager.getTopTen() : "N/A";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ModuleManager getModuleManager() { return moduleManager; }
|
||||
public PortalManager getPortalManager() { return portalManager; } // Hinzugefügt/Wiederhergestellt
|
||||
public PortalManager getPortalManager() { return portalManager; }
|
||||
public TablistModule getTablistModule() { return tablistModule; }
|
||||
public LobbySettingsModule getLobbySettingsModule() { return lobbySettingsModule; }
|
||||
public ItemsModule getItemsModule() { return itemsModule; }
|
||||
public GadgetModule getGadgetModule() { return gadgetModule; }
|
||||
public HologramModule getHologramModule() { return hologramModule; }
|
||||
public DynamicArmorStandModule getDynamicArmorStandModule() { return dynamicArmorStandModule; }
|
||||
public MapArtModule getMapArtModule() { return mapArtModule; } // Wiederhergestellt
|
||||
public MapArtModule getMapArtModule() { return mapArtModule; }
|
||||
public IntroModule getIntroModule() { return introModule; }
|
||||
public BorderModule getBorderModule() { return borderModule; }
|
||||
}
|
||||
Reference in New Issue
Block a user