Update from Git Manager GUI

This commit is contained in:
2026-01-23 18:09:04 +01:00
parent fa6c79aa53
commit addab7245d
12 changed files with 639 additions and 251 deletions

View File

@@ -16,8 +16,9 @@ import de.nexuslobby.modules.servers.ServerSwitcherListener;
import de.nexuslobby.modules.armorstandtools.*;
import de.nexuslobby.modules.gadgets.GadgetModule;
import de.nexuslobby.modules.hologram.HologramModule;
import de.nexuslobby.modules.mapart.MapArtModule; // Neu
import de.nexuslobby.modules.intro.IntroModule; // Neu
import de.nexuslobby.modules.mapart.MapArtModule;
import de.nexuslobby.modules.intro.IntroModule;
import de.nexuslobby.modules.border.BorderModule;
import de.nexuslobby.utils.*;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import net.md_5.bungee.api.chat.ClickEvent;
@@ -26,6 +27,8 @@ import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.PluginCommand;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
@@ -50,8 +53,9 @@ public class NexusLobby extends JavaPlugin implements Listener {
private GadgetModule gadgetModule;
private HologramModule hologramModule;
private DynamicArmorStandModule dynamicArmorStandModule;
private MapArtModule mapArtModule; // Neu
private IntroModule introModule; // Neu
private MapArtModule mapArtModule;
private IntroModule introModule;
private BorderModule borderModule;
private File visualsFile;
private FileConfiguration visualsConfig;
@@ -86,7 +90,7 @@ public class NexusLobby extends JavaPlugin implements Listener {
registerCommands();
checkUpdates();
getLogger().info("NexusLobby wurde erfolgreich gestartet.");
getLogger().info("NexusLobby v" + getDescription().getVersion() + " wurde erfolgreich gestartet.");
}
private void checkUpdates() {
@@ -116,6 +120,11 @@ public class NexusLobby extends JavaPlugin implements Listener {
reloadVisualsConfig();
Config.load();
// Border-Settings nach Config-Reload synchronisieren
if (borderModule != null) {
borderModule.reloadConfig();
}
if (portalManager != null) {
portalManager.loadPortals();
}
@@ -141,28 +150,29 @@ public class NexusLobby extends JavaPlugin implements Listener {
this.hologramModule = new HologramModule();
moduleManager.registerModule(this.hologramModule);
// Dynamic ArmorStand Module
this.dynamicArmorStandModule = new DynamicArmorStandModule();
moduleManager.registerModule(this.dynamicArmorStandModule);
// MapArt & Intro Module
this.mapArtModule = new MapArtModule();
moduleManager.registerModule(this.mapArtModule);
this.introModule = new IntroModule();
moduleManager.registerModule(this.introModule);
this.borderModule = new BorderModule();
moduleManager.registerModule(this.borderModule);
moduleManager.registerModule(new SecurityModule());
moduleManager.registerModule(new BossBarModule());
moduleManager.registerModule(new ActionBarModule());
lobbySettingsModule = new LobbySettingsModule();
this.lobbySettingsModule = new LobbySettingsModule();
moduleManager.registerModule(lobbySettingsModule);
tablistModule = new TablistModule();
this.tablistModule = new TablistModule();
moduleManager.registerModule(tablistModule);
portalManager = new PortalManager(this);
this.portalManager = new PortalManager(this);
moduleManager.registerModule(portalManager);
}
@@ -181,6 +191,9 @@ public class NexusLobby extends JavaPlugin implements Listener {
Player player = event.getPlayer();
event.setJoinMessage(null);
// Teleport zum Lobby-Spawn beim Beitreten
teleportToSpawn(player);
player.getInventory().clear();
player.getInventory().setArmorContents(null);
@@ -208,6 +221,25 @@ public class NexusLobby extends JavaPlugin implements Listener {
}
}
private void teleportToSpawn(Player player) {
FileConfiguration config = getConfig();
if (config.contains("spawn.world")) {
String worldName = config.getString("spawn.world");
World world = Bukkit.getWorld(worldName);
if (world != null) {
Location spawnLoc = new Location(
world,
config.getDouble("spawn.x"),
config.getDouble("spawn.y"),
config.getDouble("spawn.z"),
(float) config.getDouble("spawn.yaw"),
(float) config.getDouble("spawn.pitch")
);
player.teleport(spawnLoc);
}
}
}
private void initCustomConfigs() {
if (!getDataFolder().exists()) {
getDataFolder().mkdirs();
@@ -239,13 +271,11 @@ public class NexusLobby extends JavaPlugin implements Listener {
visualsFile = new File(getDataFolder(), "visuals.yml");
}
visualsConfig = YamlConfiguration.loadConfiguration(visualsFile);
getLogger().info("visuals.yml erfolgreich vom Speicher geladen.");
getLogger().info("visuals.yml erfolgreich geladen.");
}
public FileConfiguration getVisualsConfig() {
if (visualsConfig == null) {
reloadVisualsConfig();
}
if (visualsConfig == null) reloadVisualsConfig();
return visualsConfig;
}
@@ -253,11 +283,12 @@ public class NexusLobby extends JavaPlugin implements Listener {
public void onDisable() {
getServer().getMessenger().unregisterOutgoingPluginChannel(this, "BungeeCord");
if (moduleManager != null) moduleManager.disableAll();
getLogger().info("NexusLobby disabled");
getLogger().info("NexusLobby deaktiviert.");
}
private void registerCommands() {
LobbyTabCompleter tabCompleter = new LobbyTabCompleter(portalManager, hologramModule);
NexusLobbyCommand nexusCommand = new NexusLobbyCommand();
PluginCommand portalCmd = this.getCommand("portal");
if (portalCmd != null) {
@@ -291,15 +322,27 @@ public class NexusLobby extends JavaPlugin implements Listener {
getCommand("nexuscmd").setTabCompleter(tabCompleter);
}
// Haupt- und Spawn-Befehl Registrierung (NexusLobbyCommand verarbeitet beides)
PluginCommand nexusCmd = this.getCommand("nexuslobby");
if (nexusCmd != null) {
nexusCmd.setExecutor(new NexusLobbyCommand());
nexusCmd.setExecutor(nexusCommand);
nexusCmd.setTabCompleter(tabCompleter);
}
// Neue Commands im TabCompleter registrieren
PluginCommand spawnCmd = this.getCommand("spawn");
if (spawnCmd != null) {
spawnCmd.setExecutor(nexusCommand);
spawnCmd.setTabCompleter(tabCompleter);
}
if (getCommand("mapart") != null) getCommand("mapart").setTabCompleter(tabCompleter);
if (getCommand("introtest") != null) getCommand("introtest").setTabCompleter(tabCompleter);
if (getCommand("intro") != null) getCommand("intro").setTabCompleter(tabCompleter);
PluginCommand borderCmd = this.getCommand("border");
if (borderCmd != null) {
borderCmd.setExecutor(new BorderCommand());
borderCmd.setTabCompleter(tabCompleter);
}
}
public class NexusLobbyExpansion extends PlaceholderExpansion {