Update from Git Manager GUI
This commit is contained in:
@@ -103,8 +103,11 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
initCustomConfigs();
|
initCustomConfigs();
|
||||||
|
validateConfig();
|
||||||
|
|
||||||
|
// Lade die Sprachdatei
|
||||||
|
LangManager.load(this);
|
||||||
|
|
||||||
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||||
moduleManager = new ModuleManager(this);
|
moduleManager = new ModuleManager(this);
|
||||||
@@ -262,6 +265,11 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
getServer().getPluginManager().registerEvents(new NPCClickListener(), this);
|
getServer().getPluginManager().registerEvents(new NPCClickListener(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void validateConfig() {
|
||||||
|
ConfigValidator validator = new ConfigValidator(this, getConfig());
|
||||||
|
validator.validate();
|
||||||
|
}
|
||||||
|
|
||||||
public class NPCClickListener implements Listener {
|
public class NPCClickListener implements Listener {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onNPCClick(PlayerInteractAtEntityEvent event) {
|
public void onNPCClick(PlayerInteractAtEntityEvent event) {
|
||||||
@@ -280,7 +288,9 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onJoin(PlayerJoinEvent event) {
|
public void onJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
if (silentPlayers.contains(player.getUniqueId())) {
|
||||||
event.setJoinMessage(null);
|
event.setJoinMessage(null);
|
||||||
|
}
|
||||||
|
|
||||||
teleportToSpawn(player);
|
teleportToSpawn(player);
|
||||||
|
|
||||||
@@ -289,7 +299,7 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
BuildCommand.removePlayerFromBuildMode(player);
|
BuildCommand.removePlayerFromBuildMode(player);
|
||||||
|
|
||||||
String defaultGmName = getConfig().getString("default-gamemode", "ADVENTURE");
|
String defaultGmName = getConfig().getString("lobby.default-gamemode", "Adventure");
|
||||||
try {
|
try {
|
||||||
player.setGameMode(GameMode.valueOf(defaultGmName.toUpperCase()));
|
player.setGameMode(GameMode.valueOf(defaultGmName.toUpperCase()));
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
@@ -298,14 +308,12 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
if (player.hasPermission("nexuslobby.admin") && updateAvailable) {
|
if (player.hasPermission("nexuslobby.admin") && updateAvailable) {
|
||||||
player.sendMessage("");
|
player.sendMessage("");
|
||||||
player.sendMessage("§8[§6Nexus§8] §aEin neues §6Update §afür §eNexusLobby §aist verfügbar!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("update_available"));
|
||||||
player.sendMessage("§8» §7Version: §c" + getDescription().getVersion() + " §8-> §a" + latestVersion);
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("update_version").replace("{old}", getDescription().getVersion()).replace("{new}", latestVersion));
|
||||||
|
TextComponent link = new TextComponent(de.nexuslobby.utils.LangManager.get("update_download_link"));
|
||||||
TextComponent link = new TextComponent("§8» §6Klicke §e§l[HIER] §6zum Herunterladen.");
|
|
||||||
link.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://git.viper.ipv64.net/M_Viper/NexusLobby/releases"));
|
link.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://git.viper.ipv64.net/M_Viper/NexusLobby/releases"));
|
||||||
link.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
link.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
|
||||||
new ComponentBuilder("§7Öffnet die Release-Seite").create()));
|
new ComponentBuilder(de.nexuslobby.utils.LangManager.get("update_download_hover")).create()));
|
||||||
|
|
||||||
player.spigot().sendMessage(link);
|
player.spigot().sendMessage(link);
|
||||||
player.sendMessage("");
|
player.sendMessage("");
|
||||||
}
|
}
|
||||||
@@ -360,10 +368,23 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
|
// Cancle alle Scheduler-Tasks
|
||||||
|
Bukkit.getScheduler().cancelTasks(this);
|
||||||
|
|
||||||
|
// Stoppe spezifische Tasks
|
||||||
|
ServerChecker.stopGlobalChecker();
|
||||||
|
|
||||||
|
// Unregister alle Event-Listener
|
||||||
|
org.bukkit.event.HandlerList.unregisterAll((org.bukkit.plugin.Plugin) this);
|
||||||
|
|
||||||
|
// Schließe BungeeCord Channel
|
||||||
getServer().getMessenger().unregisterOutgoingPluginChannel(this, "BungeeCord");
|
getServer().getMessenger().unregisterOutgoingPluginChannel(this, "BungeeCord");
|
||||||
|
|
||||||
|
// Disable alle Module (inkl. eigenes Cleanup)
|
||||||
if (moduleManager != null) {
|
if (moduleManager != null) {
|
||||||
moduleManager.disableAll();
|
moduleManager.disableAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
getLogger().info("NexusLobby deaktiviert.");
|
getLogger().info("NexusLobby deaktiviert.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,6 +431,21 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
getCommand("spawn").setTabCompleter(tabCompleter);
|
getCommand("spawn").setTabCompleter(tabCompleter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getCommand("setstart") != null) {
|
||||||
|
getCommand("setstart").setExecutor(nexusCommand);
|
||||||
|
getCommand("setstart").setTabCompleter(tabCompleter);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getCommand("setcheckpoint") != null) {
|
||||||
|
getCommand("setcheckpoint").setExecutor(nexusCommand);
|
||||||
|
getCommand("setcheckpoint").setTabCompleter(tabCompleter);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getCommand("setfinish") != null) {
|
||||||
|
getCommand("setfinish").setExecutor(nexusCommand);
|
||||||
|
getCommand("setfinish").setTabCompleter(tabCompleter);
|
||||||
|
}
|
||||||
|
|
||||||
if (getCommand("mapart") != null) getCommand("mapart").setTabCompleter(tabCompleter);
|
if (getCommand("mapart") != null) getCommand("mapart").setTabCompleter(tabCompleter);
|
||||||
if (getCommand("intro") != null) getCommand("intro").setTabCompleter(tabCompleter);
|
if (getCommand("intro") != null) getCommand("intro").setTabCompleter(tabCompleter);
|
||||||
|
|
||||||
@@ -417,6 +453,11 @@ public class NexusLobby extends JavaPlugin implements Listener {
|
|||||||
getCommand("border").setExecutor(new BorderCommand());
|
getCommand("border").setExecutor(new BorderCommand());
|
||||||
getCommand("border").setTabCompleter(tabCompleter);
|
getCommand("border").setTabCompleter(tabCompleter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getCommand("serverswitcher") != null) {
|
||||||
|
ServerSwitcherListener serverSwitcher = new ServerSwitcherListener();
|
||||||
|
getCommand("serverswitcher").setExecutor(serverSwitcher);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NexusLobbyExpansion extends PlaceholderExpansion {
|
public class NexusLobbyExpansion extends PlaceholderExpansion {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class BuildCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gamemode zurücksetzen
|
// Gamemode zurücksetzen
|
||||||
String defaultGmName = NexusLobby.getInstance().getConfig().getString("default-gamemode", "ADVENTURE");
|
String defaultGmName = NexusLobby.getInstance().getConfig().getString("lobby.default-gamemode", "Adventure");
|
||||||
try {
|
try {
|
||||||
GameMode gm = GameMode.valueOf(defaultGmName.toUpperCase());
|
GameMode gm = GameMode.valueOf(defaultGmName.toUpperCase());
|
||||||
player.setGameMode(gm);
|
player.setGameMode(gm);
|
||||||
|
|||||||
@@ -33,6 +33,12 @@ public class GivePortalToolCommand implements CommandExecutor {
|
|||||||
// Erstelle das Item
|
// Erstelle das Item
|
||||||
ItemStack wand = new ItemStack(Material.BLAZE_ROD);
|
ItemStack wand = new ItemStack(Material.BLAZE_ROD);
|
||||||
ItemMeta meta = wand.getItemMeta();
|
ItemMeta meta = wand.getItemMeta();
|
||||||
|
if (meta == null) {
|
||||||
|
p.getInventory().addItem(wand);
|
||||||
|
p.sendMessage(plugin.getName() + " §aDu hast das Portal-Werkzeug erhalten!");
|
||||||
|
p.playSound(p.getLocation(), org.bukkit.Sound.ENTITY_ITEM_PICKUP, 1.0f, 1.0f);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Design des Items
|
// Design des Items
|
||||||
meta.setDisplayName("§cPortal-Werkzeug");
|
meta.setDisplayName("§cPortal-Werkzeug");
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ public class LobbyTabCompleter implements TabCompleter {
|
|||||||
suggestions.addAll(Arrays.asList("on", "off"));
|
suggestions.addAll(Arrays.asList("on", "off"));
|
||||||
} else if (args[0].equalsIgnoreCase("parkour")) {
|
} else if (args[0].equalsIgnoreCase("parkour")) {
|
||||||
suggestions.addAll(Arrays.asList("setstart", "setfinish", "setcheckpoint", "reset", "clear", "removeall"));
|
suggestions.addAll(Arrays.asList("setstart", "setfinish", "setcheckpoint", "reset", "clear", "removeall"));
|
||||||
} else if (args[0].equalsIgnoreCase("ball")) { // NEU: Ball Subcommands
|
} else if (args[0].equalsIgnoreCase("ball")) {
|
||||||
if (sender.hasPermission("nexuslobby.admin")) {
|
if (sender.hasPermission("nexuslobby.admin")) {
|
||||||
suggestions.addAll(Arrays.asList("setspawn", "reload"));
|
suggestions.addAll(Arrays.asList("setspawn", "respawn", "remove"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (args.length == 3) {
|
} else if (args.length == 3) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
|
||||||
|
|
||||||
if (!(sender instanceof Player player)) {
|
if (!(sender instanceof Player player)) {
|
||||||
sender.sendMessage("§cDieser Befehl ist nur für Spieler!");
|
sender.sendMessage(de.nexuslobby.utils.LangManager.get("only_player"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,12 +40,13 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
if (cmdName.equalsIgnoreCase("setcheckpoint")) {
|
if (cmdName.equalsIgnoreCase("setcheckpoint")) {
|
||||||
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
||||||
pm.setCheckpoint(player, player.getLocation());
|
pm.setCheckpoint(player, player.getLocation());
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_checkpoint_set"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (cmdName.equalsIgnoreCase("setfinish")) {
|
if (cmdName.equalsIgnoreCase("setfinish")) {
|
||||||
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
||||||
pm.setFinishLocation(player.getLocation());
|
pm.setFinishLocation(player.getLocation());
|
||||||
player.sendMessage("§8[§6Nexus§8] §aParkour-Zielpunkt gesetzt!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_finish_set"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,12 +58,12 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
if (loc != null) {
|
if (loc != null) {
|
||||||
player.teleport(loc);
|
player.teleport(loc);
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 1.0f, 1.2f);
|
player.playSound(player.getLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 1.0f, 1.2f);
|
||||||
player.sendMessage("§8[§6Nexus§8] §aDu wurdest zum Spawn teleportiert.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("teleport_spawn"));
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage("§cFehler: Die Spawn-Welt existiert nicht.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("spawn_world_missing"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage("§cEs wurde noch kein Spawn gesetzt.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("spawn_not_set"));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -77,7 +78,7 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
case "reload":
|
case "reload":
|
||||||
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
if (!player.hasPermission("nexuslobby.admin")) return noPerm(player);
|
||||||
NexusLobby.getInstance().reloadPlugin();
|
NexusLobby.getInstance().reloadPlugin();
|
||||||
player.sendMessage("§8[§6Nexus§8] §aPlugin erfolgreich neu geladen!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("plugin_reloaded"));
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1f, 1.5f);
|
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1f, 1.5f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -92,17 +93,17 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
config.set("spawn.yaw", (double) loc.getYaw());
|
config.set("spawn.yaw", (double) loc.getYaw());
|
||||||
config.set("spawn.pitch", (double) loc.getPitch());
|
config.set("spawn.pitch", (double) loc.getPitch());
|
||||||
NexusLobby.getInstance().saveConfig();
|
NexusLobby.getInstance().saveConfig();
|
||||||
player.sendMessage("§8[§6Nexus§8] §aLobby-Spawn erfolgreich gesetzt!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("spawn_set"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "silentjoin":
|
case "silentjoin":
|
||||||
if (!player.hasPermission("nexuslobby.silentjoin")) return noPerm(player);
|
if (!player.hasPermission("nexuslobby.silentjoin")) return noPerm(player);
|
||||||
if (NexusLobby.getInstance().getSilentPlayers().contains(player.getUniqueId())) {
|
if (NexusLobby.getInstance().getSilentPlayers().contains(player.getUniqueId())) {
|
||||||
NexusLobby.getInstance().getSilentPlayers().remove(player.getUniqueId());
|
NexusLobby.getInstance().getSilentPlayers().remove(player.getUniqueId());
|
||||||
player.sendMessage("§8[§6Nexus§8] §7Silent Join: §cDeaktiviert");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("silentjoin_off"));
|
||||||
} else {
|
} else {
|
||||||
NexusLobby.getInstance().getSilentPlayers().add(player.getUniqueId());
|
NexusLobby.getInstance().getSilentPlayers().add(player.getUniqueId());
|
||||||
player.sendMessage("§8[§6Nexus§8] §7Silent Join: §aAktiviert");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("silentjoin_on"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -114,12 +115,12 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
if (NexusLobby.getInstance().getSoccerModule() != null) {
|
if (NexusLobby.getInstance().getSoccerModule() != null) {
|
||||||
return NexusLobby.getInstance().getSoccerModule().onCommand(sender, command, label, args);
|
return NexusLobby.getInstance().getSoccerModule().onCommand(sender, command, label, args);
|
||||||
}
|
}
|
||||||
player.sendMessage("§cDas Fußball-Modul ist nicht geladen.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("soccer_module_not_loaded"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "parkour":
|
case "parkour":
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
player.sendMessage("§8[§6Nexus§8] §7Nutze: §e/nexus parkour <setstart|setfinish|setcheckpoint|reset|clear|removeall>");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_usage"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,26 +133,26 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
break;
|
break;
|
||||||
case "setfinish":
|
case "setfinish":
|
||||||
pm.setFinishLocation(player.getLocation());
|
pm.setFinishLocation(player.getLocation());
|
||||||
player.sendMessage("§8[§6Nexus§8] §aParkour-Zielpunkt gesetzt!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_finish_set"));
|
||||||
break;
|
break;
|
||||||
case "setcheckpoint":
|
case "setcheckpoint":
|
||||||
pm.setCheckpoint(player, player.getLocation());
|
pm.setCheckpoint(player, player.getLocation());
|
||||||
break;
|
break;
|
||||||
case "reset":
|
case "reset":
|
||||||
pm.stopParkour(player);
|
pm.stopParkour(player);
|
||||||
player.sendMessage("§8[§6Nexus§8] §7Dein aktueller Lauf wurde abgebrochen.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_run_aborted"));
|
||||||
break;
|
break;
|
||||||
case "clear":
|
case "clear":
|
||||||
pm.clearStats();
|
pm.clearStats();
|
||||||
player.sendMessage("§8[§6Nexus§8] §aAlle Parkour-Bestzeiten wurden gelöscht!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_besttimes_cleared"));
|
||||||
break;
|
break;
|
||||||
case "removeall":
|
case "removeall":
|
||||||
pm.removeAllPoints();
|
pm.removeAllPoints();
|
||||||
player.sendMessage("§8[§6Nexus§8] §cDie gesamte Strecke (Checkpoints & Ziel) wurde gelöscht!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_track_removed"));
|
||||||
player.playSound(player.getLocation(), Sound.ENTITY_ITEM_BREAK, 1f, 1f);
|
player.playSound(player.getLocation(), Sound.ENTITY_ITEM_BREAK, 1f, 1f);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
player.sendMessage("§cUnbekannter Unterbefehl.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("unknown_subcommand"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -180,26 +181,25 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
|
|
||||||
if (targetAs != null) {
|
if (targetAs != null) {
|
||||||
targetAs.addScoreboardTag("parkour_npc");
|
targetAs.addScoreboardTag("parkour_npc");
|
||||||
player.sendMessage("§8[§6Nexus§8] §aArmorStand als Parkour-NPC markiert!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_npc_marked"));
|
||||||
}
|
}
|
||||||
|
|
||||||
pm.setStartLocation(player.getLocation());
|
pm.setStartLocation(player.getLocation());
|
||||||
player.sendMessage("§8[§6Nexus§8] §aParkour-Startpunkt an deiner Position gesetzt!");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("parkour_start_set"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean noPerm(Player player) {
|
private boolean noPerm(Player player) {
|
||||||
player.sendMessage("§cKeine Berechtigung.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("no_permission"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleScoreboard(Player player, String[] args) {
|
private void handleScoreboard(Player player, String[] args) {
|
||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
player.sendMessage("§cBenutzung: /nexus sb <on|off|admin|spieler>");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("scoreboard_usage"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ScoreboardModule sbModule = (ScoreboardModule) NexusLobby.getInstance().getModuleManager().getModule(ScoreboardModule.class);
|
ScoreboardModule sbModule = (ScoreboardModule) NexusLobby.getInstance().getModuleManager().getModule(ScoreboardModule.class);
|
||||||
if (sbModule == null) {
|
if (sbModule == null) {
|
||||||
player.sendMessage("§cScoreboard-Modul ist deaktiviert.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("scoreboard_module_disabled"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String sub = args[1].toLowerCase();
|
String sub = args[1].toLowerCase();
|
||||||
@@ -208,11 +208,11 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
case "off": sbModule.setVisibility(player, false); break;
|
case "off": sbModule.setVisibility(player, false); break;
|
||||||
case "admin":
|
case "admin":
|
||||||
if (player.hasPermission("nexuslobby.scoreboard.admin")) sbModule.setAdminMode(player, true);
|
if (player.hasPermission("nexuslobby.scoreboard.admin")) sbModule.setAdminMode(player, true);
|
||||||
else player.sendMessage("§cKeine Rechte.");
|
else player.sendMessage(de.nexuslobby.utils.LangManager.get("no_permission"));
|
||||||
break;
|
break;
|
||||||
case "spieler":
|
case "spieler":
|
||||||
if (player.hasPermission("nexuslobby.scoreboard.admin")) sbModule.setAdminMode(player, false);
|
if (player.hasPermission("nexuslobby.scoreboard.admin")) sbModule.setAdminMode(player, false);
|
||||||
else player.sendMessage("§cKeine Rechte.");
|
else player.sendMessage(de.nexuslobby.utils.LangManager.get("no_permission"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -226,16 +226,16 @@ public class NexusLobbyCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sendInfo(Player player) {
|
private void sendInfo(Player player) {
|
||||||
player.sendMessage("§8§m--------------------------------------");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_header"));
|
||||||
player.sendMessage("§6§lNexusLobby §7- Informationen");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_title"));
|
||||||
player.sendMessage("");
|
player.sendMessage("");
|
||||||
player.sendMessage("§f/spawn §7- Zum Spawn");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_spawn"));
|
||||||
player.sendMessage("§f/setstart §8| §f/setcheckpoint §8| §f/setfinish");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_parkour"));
|
||||||
player.sendMessage("§f/nexus parkour removeall §7- Strecke löschen");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_removeall"));
|
||||||
player.sendMessage("§f/nexus ball setspawn §7- Fußball Spawn setzen"); // NEU
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_ball"));
|
||||||
player.sendMessage("§f/nexus setspawn §7- Spawn setzen");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_setspawn"));
|
||||||
player.sendMessage("§f/nexus sb <on|off> §7- Scoreboard");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_scoreboard"));
|
||||||
player.sendMessage("§f/nexus reload §7- Config laden");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_reload"));
|
||||||
player.sendMessage("§8§m--------------------------------------");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("info_footer"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,8 +56,11 @@ public class ItemsModule implements Module, Listener {
|
|||||||
// 2. Gadget GUI Logik
|
// 2. Gadget GUI Logik
|
||||||
String gadgetName = colorize(config.getString("items.lobby-tools.gadget.displayname", "&bGadgets"));
|
String gadgetName = colorize(config.getString("items.lobby-tools.gadget.displayname", "&bGadgets"));
|
||||||
if (displayName.equals(gadgetName)) {
|
if (displayName.equals(gadgetName)) {
|
||||||
// Öffnet die GUI aus dem GadgetModule
|
// Öffnet die GUI aus dem GadgetModule (falls vorhanden)
|
||||||
NexusLobby.getInstance().getGadgetModule().openGUI(player);
|
var gadgetModule = NexusLobby.getInstance().getGadgetModule();
|
||||||
|
if (gadgetModule != null) {
|
||||||
|
gadgetModule.openGUI(player);
|
||||||
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import java.util.UUID;
|
|||||||
public class ScoreboardModule implements Module {
|
public class ScoreboardModule implements Module {
|
||||||
|
|
||||||
private final NexusLobby plugin = NexusLobby.getInstance();
|
private final NexusLobby plugin = NexusLobby.getInstance();
|
||||||
|
private boolean placeholderAPIEnabled;
|
||||||
|
|
||||||
// Speicher für die aktuellen Spieler-Einstellungen (bis zum Restart/Reload)
|
// Speicher für die aktuellen Spieler-Einstellungen (bis zum Restart/Reload)
|
||||||
private final Set<UUID> hiddenPlayers = new HashSet<>();
|
private final Set<UUID> hiddenPlayers = new HashSet<>();
|
||||||
@@ -33,6 +34,8 @@ public class ScoreboardModule implements Module {
|
|||||||
FileConfiguration vConfig = plugin.getVisualsConfig();
|
FileConfiguration vConfig = plugin.getVisualsConfig();
|
||||||
if (!vConfig.getBoolean("scoreboard.enabled", true)) return;
|
if (!vConfig.getBoolean("scoreboard.enabled", true)) return;
|
||||||
|
|
||||||
|
placeholderAPIEnabled = Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null;
|
||||||
|
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -124,7 +127,14 @@ public class ScoreboardModule implements Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String translate(Player player, String text) {
|
private String translate(Player player, String text) {
|
||||||
String translated = PlaceholderAPI.setPlaceholders(player, text);
|
String translated = text;
|
||||||
|
if (placeholderAPIEnabled) {
|
||||||
|
try {
|
||||||
|
translated = PlaceholderAPI.setPlaceholders(player, text);
|
||||||
|
} catch (NoClassDefFoundError ignored) {
|
||||||
|
// PlaceholderAPI fehlt zur Laufzeit
|
||||||
|
}
|
||||||
|
}
|
||||||
return ChatColor.translateAlternateColorCodes('&', translated);
|
return ChatColor.translateAlternateColorCodes('&', translated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
if (!(sender instanceof Player p)) return true;
|
if (!(sender instanceof Player p)) return true;
|
||||||
|
|
||||||
if (!p.hasPermission("nexuslobby.armorstand.cmd")) {
|
if (!p.hasPermission("nexuslobby.armorstand.cmd")) {
|
||||||
p.sendMessage(prefix + "§cKeine Berechtigung!");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("no_permission"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
case "select4":
|
case "select4":
|
||||||
ArmorStand target = getTargetArmorStand(p);
|
ArmorStand target = getTargetArmorStand(p);
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
p.sendMessage(prefix + "§cDu musst einen ArmorStand direkt anschauen (Fadenkreuz)!");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,11 +69,11 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
|
|
||||||
case "link":
|
case "link":
|
||||||
if (args.length < 3) {
|
if (args.length < 3) {
|
||||||
p.sendMessage(prefix + "§cNutze: /nexuscmd conv link <Dialog-ID>");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_link_usage"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!p.hasMetadata("conv_npc1") || !p.hasMetadata("conv_npc2")) {
|
if (!p.hasMetadata("conv_npc1") || !p.hasMetadata("conv_npc2")) {
|
||||||
p.sendMessage(prefix + "§cBitte markiere mindestens die ersten beiden NPCs (select1 & select2)!");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_mark_npcs"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +101,8 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
// Im Manager speichern (Nutzt die erweiterte Methode für Gruppen)
|
// Im Manager speichern (Nutzt die erweiterte Methode für Gruppen)
|
||||||
NexusLobby.getInstance().getConversationManager().saveLinkExtended(id1, id2, id3, id4, dialogId);
|
NexusLobby.getInstance().getConversationManager().saveLinkExtended(id1, id2, id3, id4, dialogId);
|
||||||
|
|
||||||
p.sendMessage(prefix + "§a§lDauerhafte Verknüpfung erstellt!");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_link_created"));
|
||||||
p.sendMessage(prefix + "§7Beteiligte NPCs: §e" + (id3 == null ? "2" : (id4 == null ? "3" : "4")));
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_link_npcs").replace("{count}", (id3 == null ? "2" : (id4 == null ? "3" : "4"))));
|
||||||
p.spawnParticle(Particle.HAPPY_VILLAGER, as1.getLocation().add(0, 1.5, 0), 20, 0.4, 0.4, 0.4, 0.1);
|
p.spawnParticle(Particle.HAPPY_VILLAGER, as1.getLocation().add(0, 1.5, 0), 20, 0.4, 0.4, 0.4, 0.1);
|
||||||
|
|
||||||
// Metadaten nach dem Linken aufräumen
|
// Metadaten nach dem Linken aufräumen
|
||||||
@@ -111,14 +111,14 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
p.removeMetadata("conv_npc3", NexusLobby.getInstance());
|
p.removeMetadata("conv_npc3", NexusLobby.getInstance());
|
||||||
p.removeMetadata("conv_npc4", NexusLobby.getInstance());
|
p.removeMetadata("conv_npc4", NexusLobby.getInstance());
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(prefix + "§cFehler: Sprecher 1 nicht gefunden.");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_speaker_not_found"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "unlink":
|
case "unlink":
|
||||||
ArmorStand targetUnlink = getTargetArmorStand(p);
|
ArmorStand targetUnlink = getTargetArmorStand(p);
|
||||||
if (targetUnlink == null) {
|
if (targetUnlink == null) {
|
||||||
p.sendMessage(prefix + "§cSchau den NPC an, dessen Verknüpfung du lösen willst!");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_unlink_lookat"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,17 +128,17 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
// Aus Konfiguration löschen
|
// Aus Konfiguration löschen
|
||||||
NexusLobby.getInstance().getConversationManager().removeLink(targetUnlink.getUniqueId());
|
NexusLobby.getInstance().getConversationManager().removeLink(targetUnlink.getUniqueId());
|
||||||
|
|
||||||
p.sendMessage(prefix + "§eNPC-Verknüpfung wurde aufgehoben.");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_unlinked"));
|
||||||
p.spawnParticle(Particle.SMOKE, targetUnlink.getLocation().add(0, 1.0, 0), 20, 0.2, 0.2, 0.2, 0.02);
|
p.spawnParticle(Particle.SMOKE, targetUnlink.getLocation().add(0, 1.0, 0), 20, 0.2, 0.2, 0.2, 0.02);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "start":
|
case "start":
|
||||||
if (args.length < 3) {
|
if (args.length < 3) {
|
||||||
p.sendMessage(prefix + "§cNutze: /nexuscmd conv start <ID>");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_start_usage"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!p.hasMetadata("conv_npc1") || !p.hasMetadata("conv_npc2")) {
|
if (!p.hasMetadata("conv_npc1") || !p.hasMetadata("conv_npc2")) {
|
||||||
p.sendMessage(prefix + "§cBitte markiere mindestens zwei NPCs!");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("conv_mark_two_npcs"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
ArmorStand target = getTargetArmorStand(p);
|
ArmorStand target = getTargetArmorStand(p);
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("say") && args.length >= 2) {
|
if (args[0].equalsIgnoreCase("say") && args.length >= 2) {
|
||||||
if (target == null) { p.sendMessage(prefix + "§cSchau einen ArmorStand an!"); return true; }
|
if (target == null) { p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
||||||
|
|
||||||
String text = buildString(args, 1);
|
String text = buildString(args, 1);
|
||||||
String colored = ChatColor.translateAlternateColorCodes('&', text);
|
String colored = ChatColor.translateAlternateColorCodes('&', text);
|
||||||
@@ -171,25 +171,25 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
// Nutzt die showBubble-Logik aus dem ConversationManager (Ohne Partner-Zwang)
|
// Nutzt die showBubble-Logik aus dem ConversationManager (Ohne Partner-Zwang)
|
||||||
NexusLobby.getInstance().getConversationManager().showBubble(target, colored);
|
NexusLobby.getInstance().getConversationManager().showBubble(target, colored);
|
||||||
|
|
||||||
p.sendMessage(prefix + "§aNPC-Sprechblase gesendet.");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("npc_bubble_sent"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("lookat")) {
|
if (args[0].equalsIgnoreCase("lookat")) {
|
||||||
if (target == null) { p.sendMessage(prefix + "§cSchau einen ArmorStand an!"); return true; }
|
if (target == null) { p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
||||||
if (target.getScoreboardTags().contains("as_lookat")) {
|
if (target.getScoreboardTags().contains("as_lookat")) {
|
||||||
target.removeScoreboardTag("as_lookat");
|
target.removeScoreboardTag("as_lookat");
|
||||||
target.setHeadPose(new EulerAngle(0, 0, 0));
|
target.setHeadPose(new EulerAngle(0, 0, 0));
|
||||||
p.sendMessage(prefix + "§cBlickkontakt aus.");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("lookat_off"));
|
||||||
} else {
|
} else {
|
||||||
target.addScoreboardTag("as_lookat");
|
target.addScoreboardTag("as_lookat");
|
||||||
p.sendMessage(prefix + "§aBlickkontakt an.");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("lookat_on"));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("name") && args.length >= 2) {
|
if (args[0].equalsIgnoreCase("name") && args.length >= 2) {
|
||||||
if (target == null) { p.sendMessage(prefix + "§cSchau einen ArmorStand an!"); return true; }
|
if (target == null) { p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
||||||
String nameInput = buildString(args, 1);
|
String nameInput = buildString(args, 1);
|
||||||
|
|
||||||
// Wichtig: Alle alten Namens-Tags entfernen für Konsistenz
|
// Wichtig: Alle alten Namens-Tags entfernen für Konsistenz
|
||||||
@@ -198,7 +198,7 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
if (nameInput.equalsIgnoreCase("none")) {
|
if (nameInput.equalsIgnoreCase("none")) {
|
||||||
target.setCustomName("");
|
target.setCustomName("");
|
||||||
target.setCustomNameVisible(false);
|
target.setCustomNameVisible(false);
|
||||||
p.sendMessage(prefix + "§eName entfernt.");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("name_removed"));
|
||||||
} else {
|
} else {
|
||||||
String colored = ChatColor.translateAlternateColorCodes('&', nameInput);
|
String colored = ChatColor.translateAlternateColorCodes('&', nameInput);
|
||||||
target.setCustomName(colored);
|
target.setCustomName(colored);
|
||||||
@@ -208,33 +208,33 @@ public class ArmorStandCmdExecutor implements CommandExecutor {
|
|||||||
// ":" wird durch "§§" ersetzt, um Probleme in Scoreboard-Tags zu vermeiden
|
// ":" wird durch "§§" ersetzt, um Probleme in Scoreboard-Tags zu vermeiden
|
||||||
target.addScoreboardTag("as_displayname:" + nameInput.replace(":", "§§"));
|
target.addScoreboardTag("as_displayname:" + nameInput.replace(":", "§§"));
|
||||||
|
|
||||||
p.sendMessage(prefix + "§7Name gesetzt: " + colored);
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("name_set").replace("{name}", colored));
|
||||||
p.sendMessage(prefix + "§8(Status-Backup wurde gespeichert)");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("status_backup_saved"));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("add") && args.length >= 5) {
|
if (args[0].equalsIgnoreCase("add") && args.length >= 5) {
|
||||||
if (target == null) { p.sendMessage(prefix + "§cSchau einen ArmorStand an!"); return true; }
|
if (target == null) { p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("armorstand_lookat_required")); return true; }
|
||||||
String slot1 = args[1], slot2 = args[2], type = args[3].toLowerCase();
|
String slot1 = args[1], slot2 = args[2], type = args[3].toLowerCase();
|
||||||
String cmdStr = buildString(args, 4);
|
String cmdStr = buildString(args, 4);
|
||||||
|
|
||||||
target.addScoreboardTag("ascmd:" + slot1 + ":" + slot2 + ":" + type + ":" + cmdStr);
|
target.addScoreboardTag("ascmd:" + slot1 + ":" + slot2 + ":" + type + ":" + cmdStr);
|
||||||
p.sendMessage(prefix + "§aBefehl gebunden.");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("command_bound"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("list")) {
|
if (args[0].equalsIgnoreCase("list")) {
|
||||||
if (target == null) { p.sendMessage(prefix + "§cKein Ziel!"); return true; }
|
if (target == null) { p.sendMessage(de.nexuslobby.utils.LangManager.get("no_target")); return true; }
|
||||||
p.sendMessage("§6§lBefehle & Tags:");
|
p.sendMessage(de.nexuslobby.utils.LangManager.get("commands_and_tags"));
|
||||||
target.getScoreboardTags().forEach(t -> p.sendMessage(" §8» §e" + t));
|
target.getScoreboardTags().forEach(t -> p.sendMessage(" §8» §e" + t));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("remove")) {
|
if (args[0].equalsIgnoreCase("remove")) {
|
||||||
if (target == null) { p.sendMessage(prefix + "§cKein Ziel!"); return true; }
|
if (target == null) { p.sendMessage(de.nexuslobby.utils.LangManager.get("no_target")); return true; }
|
||||||
target.getScoreboardTags().removeIf(tag -> tag.startsWith("ascmd:"));
|
target.getScoreboardTags().removeIf(tag -> tag.startsWith("ascmd:"));
|
||||||
p.sendMessage(prefix + "§eAlle Befehle gelöscht.");
|
p.sendMessage(prefix + de.nexuslobby.utils.LangManager.get("commands_removed"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public class ArmorStandPoseGUI {
|
|||||||
private static ItemStack createPartIcon(Material mat, String name, EulerAngle angle) {
|
private static ItemStack createPartIcon(Material mat, String name, EulerAngle angle) {
|
||||||
ItemStack item = new ItemStack(mat);
|
ItemStack item = new ItemStack(mat);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
if (meta == null) return item;
|
||||||
meta.setDisplayName(name);
|
meta.setDisplayName(name);
|
||||||
meta.setLore(Arrays.asList(
|
meta.setLore(Arrays.asList(
|
||||||
"§8Rotation:",
|
"§8Rotation:",
|
||||||
@@ -64,6 +65,7 @@ public class ArmorStandPoseGUI {
|
|||||||
private static ItemStack createAxisItem(Material mat, String name, double angleRad) {
|
private static ItemStack createAxisItem(Material mat, String name, double angleRad) {
|
||||||
ItemStack item = new ItemStack(mat);
|
ItemStack item = new ItemStack(mat);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
if (meta == null) return item;
|
||||||
meta.setDisplayName(name);
|
meta.setDisplayName(name);
|
||||||
meta.setLore(Arrays.asList(
|
meta.setLore(Arrays.asList(
|
||||||
"§7Aktueller Winkel: §f" + Math.round(Math.toDegrees(angleRad)) + "°",
|
"§7Aktueller Winkel: §f" + Math.round(Math.toDegrees(angleRad)) + "°",
|
||||||
@@ -78,6 +80,7 @@ public class ArmorStandPoseGUI {
|
|||||||
private static ItemStack createNamedItem(Material mat, String name) {
|
private static ItemStack createNamedItem(Material mat, String name) {
|
||||||
ItemStack item = new ItemStack(mat);
|
ItemStack item = new ItemStack(mat);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
if (meta == null) return item;
|
||||||
meta.setDisplayName(name);
|
meta.setDisplayName(name);
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
return item;
|
return item;
|
||||||
|
|||||||
@@ -265,7 +265,11 @@ public class ConversationManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saveConfig() {
|
private void saveConfig() {
|
||||||
try { config.save(file); } catch (IOException e) { e.printStackTrace(); }
|
try {
|
||||||
|
config.save(file);
|
||||||
|
} catch (IOException e) {
|
||||||
|
Bukkit.getLogger().severe("Fehler beim Speichern der Conversations: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reload() {
|
public void reload() {
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
import org.bukkit.profile.PlayerProfile;
|
import org.bukkit.profile.PlayerProfile;
|
||||||
import org.bukkit.profile.PlayerTextures;
|
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
@@ -29,12 +28,31 @@ import java.util.Objects;
|
|||||||
|
|
||||||
public class SoccerModule implements Module, Listener, CommandExecutor {
|
public class SoccerModule implements Module, Listener, CommandExecutor {
|
||||||
|
|
||||||
|
// Ball Konstanten
|
||||||
|
private static final String TEXTURE_URL = "http://textures.minecraft.net/texture/451f8cfcfb85d77945dc6a3618414093e70436b46d2577b28c727f1329b7265e";
|
||||||
|
private static final String BALL_TAG = "nexusball_entity";
|
||||||
|
private static final String BALL_NAME = "NexusBall";
|
||||||
|
|
||||||
|
// Physik Konstanten
|
||||||
|
private static final double DRIBBLE_DETECTION_RADIUS = 0.7;
|
||||||
|
private static final double DRIBBLE_HEIGHT = 0.5;
|
||||||
|
private static final double DRIBBLE_FORCE = 0.35;
|
||||||
|
private static final double DRIBBLE_LIFT = 0.12;
|
||||||
|
private static final double KICK_FORCE = 1.35;
|
||||||
|
private static final double KICK_LIFT = 0.38;
|
||||||
|
private static final double WALL_BOUNCE_DAMPING = 0.75;
|
||||||
|
private static final double WALL_CHECK_DISTANCE = 1.3;
|
||||||
|
private static final double VOID_THRESHOLD = -5.0;
|
||||||
|
private static final double CLEANUP_RADIUS = 5.0;
|
||||||
|
|
||||||
|
// Particle Konstanten
|
||||||
|
private static final double PARTICLE_SPEED_HIGH = 0.85;
|
||||||
|
private static final double PARTICLE_SPEED_MEDIUM = 0.45;
|
||||||
|
private static final double PARTICLE_SPEED_MIN = 0.05;
|
||||||
|
|
||||||
private ArmorStand ball;
|
private ArmorStand ball;
|
||||||
private Location spawnLocation;
|
private Location spawnLocation;
|
||||||
private long lastMoveTime;
|
private long lastMoveTime;
|
||||||
private final String TEXTURE_URL = "http://textures.minecraft.net/texture/451f8cfcfb85d77945dc6a3618414093e70436b46d2577b28c727f1329b7265e";
|
|
||||||
private final String BALL_TAG = "nexusball_entity"; // Eindeutiges Tag zur Identifizierung
|
|
||||||
private final String BALL_NAME = "§x§N§e§x§u§s§B§a§l§l"; // Zusätzliche Erkennung
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() { return "Soccer"; }
|
public String getName() { return "Soccer"; }
|
||||||
@@ -48,43 +66,21 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
|
|
||||||
loadConfigLocation();
|
loadConfigLocation();
|
||||||
|
|
||||||
// AGGRESSIVES MEHRFACHES CLEANUP-SYSTEM
|
// Optimiertes Cleanup-System: 3 Phasen statt 6
|
||||||
// 1. Sofort beim Enable
|
removeAllOldBalls();
|
||||||
removeAllOldBallsGlobal();
|
|
||||||
|
|
||||||
// 2. Nach 0.5 Sekunden
|
|
||||||
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), this::removeAllOldBallsGlobal, 10L);
|
|
||||||
|
|
||||||
// 3. Nach 1 Sekunde
|
|
||||||
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), this::removeAllOldBallsGlobal, 20L);
|
|
||||||
|
|
||||||
// 4. Nach 2 Sekunden - cleanup und dann spawnen
|
|
||||||
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), () -> {
|
||||||
removeAllOldBallsGlobal();
|
removeAllOldBalls();
|
||||||
spawnBall();
|
spawnBall();
|
||||||
}, 40L);
|
}, 40L); // Nach 2 Sekunden
|
||||||
|
|
||||||
// 5. Nach 3 Sekunden - finales Cleanup für hartnäckige Duplikate
|
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), this::removeAllOldBalls, 100L); // Finaler Check nach 5 Sekunden
|
||||||
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), this::removeAllOldBallsGlobal, 60L);
|
|
||||||
|
|
||||||
// 6. Nach 5 Sekunden - letzter Check
|
// Haupt-Physik & Anti-Duplikat System
|
||||||
Bukkit.getScheduler().runTaskLater(NexusLobby.getInstance(), this::removeAllOldBallsGlobal, 100L);
|
|
||||||
|
|
||||||
// Haupt-Physik & Anti-Klon Tick
|
|
||||||
Bukkit.getScheduler().runTaskTimer(NexusLobby.getInstance(), () -> {
|
Bukkit.getScheduler().runTaskTimer(NexusLobby.getInstance(), () -> {
|
||||||
|
// Anti-Duplikat-Check (optimiert: nur in Ball-Welt)
|
||||||
// ANTI-KLON-SYSTEM: Prüfe die Umgebung des Spawns auf illegale Kopien
|
if (ball != null && ball.isValid()) {
|
||||||
if (spawnLocation != null && spawnLocation.getWorld() != null) {
|
removeDuplicateBalls();
|
||||||
for (Entity entity : spawnLocation.getWorld().getNearbyEntities(spawnLocation, 50, 50, 50)) {
|
|
||||||
if (entity instanceof ArmorStand stand) {
|
|
||||||
// Wenn der ArmorStand unser Tag hat, aber nicht unsere aktive Instanz ist -> Löschen
|
|
||||||
if (stand.getScoreboardTags().contains(BALL_TAG)) {
|
|
||||||
if (ball == null || !stand.getUniqueId().equals(ball.getUniqueId())) {
|
|
||||||
stand.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ball == null || !ball.isValid()) return;
|
if (ball == null || !ball.isValid()) return;
|
||||||
@@ -94,100 +90,146 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
|
|
||||||
handleWallBounce(vel);
|
handleWallBounce(vel);
|
||||||
handleParticles(speed);
|
handleParticles(speed);
|
||||||
|
handleDribbling();
|
||||||
// Dribbel-Logik
|
|
||||||
for (Entity nearby : ball.getNearbyEntities(0.7, 0.5, 0.7)) {
|
|
||||||
if (nearby instanceof Player p) {
|
|
||||||
Vector direction = ball.getLocation().toVector().subtract(p.getLocation().toVector());
|
|
||||||
if (direction.lengthSquared() > 0) {
|
|
||||||
direction.normalize();
|
|
||||||
direction.setY(0.12);
|
|
||||||
ball.setVelocity(direction.multiply(0.35));
|
|
||||||
}
|
|
||||||
lastMoveTime = System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Automatischer Respawn bei Inaktivität oder Void
|
// Automatischer Respawn bei Inaktivität oder Void
|
||||||
long delay = NexusLobby.getInstance().getConfig().getLong("ball.respawn_delay", 60) * 1000;
|
long respawnDelayMs = NexusLobby.getInstance().getConfig().getLong("ball.respawn_delay", 60) * 1000;
|
||||||
if (System.currentTimeMillis() - lastMoveTime > delay || ball.getLocation().getY() < -5) {
|
if (System.currentTimeMillis() - lastMoveTime > respawnDelayMs || ball.getLocation().getY() < VOID_THRESHOLD) {
|
||||||
respawnBall();
|
respawnBall();
|
||||||
}
|
}
|
||||||
}, 1L, 1L);
|
}, 1L, 1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scannt ALLE Welten nach Entities mit dem BALL_TAG und entfernt sie.
|
* Optimierte Dribbel-Logik: Ball folgt nahen Spielern
|
||||||
* Nutzt mehrere Erkennungsmethoden für maximale Sicherheit.
|
|
||||||
*/
|
*/
|
||||||
private void removeAllOldBallsGlobal() {
|
private void handleDribbling() {
|
||||||
int removed = 0;
|
if (ball == null || !ball.isValid()) return;
|
||||||
// Alle Welten durchsuchen
|
|
||||||
for (World world : Bukkit.getWorlds()) {
|
|
||||||
for (Entity entity : world.getEntities()) {
|
|
||||||
if (entity instanceof ArmorStand stand) {
|
|
||||||
boolean shouldRemove = false;
|
|
||||||
|
|
||||||
// Methode 1: Tag-basiert
|
for (Entity nearby : ball.getNearbyEntities(DRIBBLE_DETECTION_RADIUS, DRIBBLE_HEIGHT, DRIBBLE_DETECTION_RADIUS)) {
|
||||||
if (stand.getScoreboardTags().contains(BALL_TAG)) {
|
if (nearby instanceof Player p) {
|
||||||
shouldRemove = true;
|
Vector direction = ball.getLocation().toVector().subtract(p.getLocation().toVector());
|
||||||
}
|
if (direction.lengthSquared() > 0) {
|
||||||
|
direction.normalize();
|
||||||
// Methode 2: Name-basiert (falls Tags verloren gehen)
|
direction.setY(DRIBBLE_LIFT);
|
||||||
if (stand.getCustomName() != null && stand.getCustomName().equals(BALL_NAME)) {
|
ball.setVelocity(direction.multiply(DRIBBLE_FORCE));
|
||||||
shouldRemove = true;
|
lastMoveTime = System.currentTimeMillis();
|
||||||
}
|
|
||||||
|
|
||||||
// Methode 3: Kopf-Textur-basiert (prüfe ob es ein Soccer-Ball Kopf ist)
|
|
||||||
if (stand.getEquipment() != null && stand.getEquipment().getHelmet() != null) {
|
|
||||||
ItemStack helmet = stand.getEquipment().getHelmet();
|
|
||||||
if (helmet.getType() == Material.PLAYER_HEAD && helmet.hasItemMeta()) {
|
|
||||||
SkullMeta meta = (SkullMeta) helmet.getItemMeta();
|
|
||||||
if (meta.hasOwner() && meta.getOwnerProfile() != null) {
|
|
||||||
PlayerProfile profile = meta.getOwnerProfile();
|
|
||||||
if (profile.getName() != null && profile.getName().equals("SoccerBall")) {
|
|
||||||
shouldRemove = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methode 4: Position-basiert - Entferne alle unsichtbaren, kleinen ArmorStands in der Nähe des Spawns
|
/**
|
||||||
if (spawnLocation != null && spawnLocation.getWorld() != null &&
|
* Entfernt Duplikate in der Umgebung des aktiven Balls (Performance-optimiert)
|
||||||
stand.getWorld().equals(spawnLocation.getWorld()) &&
|
*/
|
||||||
stand.isSmall() && stand.isInvisible() && !stand.hasBasePlate()) {
|
private void removeDuplicateBalls() {
|
||||||
|
if (ball == null || !ball.isValid() || ball.getLocation().getWorld() == null) return;
|
||||||
|
|
||||||
double distance = stand.getLocation().distance(spawnLocation);
|
for (Entity entity : ball.getLocation().getWorld().getNearbyEntities(ball.getLocation(), 50, 50, 50)) {
|
||||||
// Wenn innerhalb von 5 Blöcken vom Spawn und hat einen Kopf
|
if (entity instanceof ArmorStand stand && isBallEntity(stand)) {
|
||||||
if (distance < 5.0 && stand.getEquipment() != null &&
|
if (!stand.getUniqueId().equals(ball.getUniqueId())) {
|
||||||
stand.getEquipment().getHelmet() != null &&
|
|
||||||
stand.getEquipment().getHelmet().getType() == Material.PLAYER_HEAD) {
|
|
||||||
shouldRemove = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Nur entfernen wenn es NICHT unsere aktuelle Ball-Instanz ist
|
|
||||||
if (shouldRemove && (ball == null || !stand.getUniqueId().equals(ball.getUniqueId()))) {
|
|
||||||
stand.remove();
|
stand.remove();
|
||||||
removed++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Entfernt alle Ball-Entities (nur in relevanter Welt wenn Spawn gesetzt)
|
||||||
|
*/
|
||||||
|
private void removeAllOldBalls() {
|
||||||
|
int removed = 0;
|
||||||
|
|
||||||
|
// Wenn Spawn-Location gesetzt ist, nur diese Welt durchsuchen (Performance!)
|
||||||
|
if (spawnLocation != null && spawnLocation.getWorld() != null) {
|
||||||
|
removed = cleanupBallsInWorld(spawnLocation.getWorld());
|
||||||
|
} else {
|
||||||
|
// Sonst alle Welten durchsuchen
|
||||||
|
for (World world : Bukkit.getWorlds()) {
|
||||||
|
removed += cleanupBallsInWorld(world);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (removed > 0) {
|
if (removed > 0) {
|
||||||
Bukkit.getLogger().info("[NexusLobby] " + removed + " alte Ball-Entities entfernt.");
|
Bukkit.getLogger().info("[NexusLobby] " + removed + " alte Ball-Entities entfernt.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cleanup für eine einzelne Welt
|
||||||
|
*/
|
||||||
|
private int cleanupBallsInWorld(World world) {
|
||||||
|
int removed = 0;
|
||||||
|
for (Entity entity : world.getEntities()) {
|
||||||
|
if (entity instanceof ArmorStand stand && isBallEntity(stand)) {
|
||||||
|
if (ball == null || !stand.getUniqueId().equals(ball.getUniqueId())) {
|
||||||
|
stand.remove();
|
||||||
|
removed++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return removed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prüft ob ein ArmorStand ein Ball ist (Mehrere Erkennungsmethoden)
|
||||||
|
*/
|
||||||
|
private boolean isBallEntity(ArmorStand stand) {
|
||||||
|
// Methode 1: Tag-basiert (primär)
|
||||||
|
if (stand.getScoreboardTags().contains(BALL_TAG)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode 2: Name-basiert
|
||||||
|
if (stand.getCustomName() != null && stand.getCustomName().equals(BALL_NAME)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode 3: Profil-basiert (Kopf-Textur)
|
||||||
|
if (stand.getEquipment() != null && stand.getEquipment().getHelmet() != null) {
|
||||||
|
ItemStack helmet = stand.getEquipment().getHelmet();
|
||||||
|
if (helmet.getType() == Material.PLAYER_HEAD && helmet.hasItemMeta()) {
|
||||||
|
SkullMeta meta = (SkullMeta) helmet.getItemMeta();
|
||||||
|
if (meta.hasOwner() && meta.getOwnerProfile() != null) {
|
||||||
|
if (BALL_NAME.equals(meta.getOwnerProfile().getName())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Methode 4: Eigenschaften-basiert (nur wenn Spawn gesetzt)
|
||||||
|
if (spawnLocation != null && spawnLocation.getWorld() != null &&
|
||||||
|
stand.getWorld().equals(spawnLocation.getWorld()) &&
|
||||||
|
stand.isSmall() && stand.isInvisible() && !stand.hasBasePlate()) {
|
||||||
|
|
||||||
|
double distance = stand.getLocation().distance(spawnLocation);
|
||||||
|
if (distance < CLEANUP_RADIUS && stand.getEquipment() != null &&
|
||||||
|
stand.getEquipment().getHelmet() != null &&
|
||||||
|
stand.getEquipment().getHelmet().getType() == Material.PLAYER_HEAD) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void handleWallBounce(Vector vel) {
|
private void handleWallBounce(Vector vel) {
|
||||||
if (vel.lengthSquared() < 0.001) return;
|
if (vel.lengthSquared() < 0.001) return;
|
||||||
|
|
||||||
Location loc = ball.getLocation();
|
Location loc = ball.getLocation();
|
||||||
Block nextX = loc.clone().add(vel.getX() * 1.3, 0.5, 0).getBlock();
|
Block nextX = loc.clone().add(vel.getX() * WALL_CHECK_DISTANCE, 0.5, 0).getBlock();
|
||||||
Block nextZ = loc.clone().add(0, 0.5, vel.getZ() * 1.3).getBlock();
|
Block nextZ = loc.clone().add(0, 0.5, vel.getZ() * WALL_CHECK_DISTANCE).getBlock();
|
||||||
|
|
||||||
boolean bounced = false;
|
boolean bounced = false;
|
||||||
if (nextX.getType().isSolid()) { vel.setX(-vel.getX() * 0.75); bounced = true; }
|
if (nextX.getType().isSolid()) {
|
||||||
if (nextZ.getType().isSolid()) { vel.setZ(-vel.getZ() * 0.75); bounced = true; }
|
vel.setX(-vel.getX() * WALL_BOUNCE_DAMPING);
|
||||||
|
bounced = true;
|
||||||
|
}
|
||||||
|
if (nextZ.getType().isSolid()) {
|
||||||
|
vel.setZ(-vel.getZ() * WALL_BOUNCE_DAMPING);
|
||||||
|
bounced = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (bounced) {
|
if (bounced) {
|
||||||
ball.setVelocity(vel);
|
ball.setVelocity(vel);
|
||||||
@@ -196,20 +238,29 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleParticles(double speed) {
|
private void handleParticles(double speed) {
|
||||||
if (speed < 0.05) return;
|
if (speed < PARTICLE_SPEED_MIN) return;
|
||||||
|
|
||||||
Location loc = ball.getLocation().add(0, 0.2, 0);
|
Location loc = ball.getLocation().add(0, 0.2, 0);
|
||||||
World world = loc.getWorld();
|
World world = loc.getWorld();
|
||||||
if (world == null) return;
|
if (world == null) return;
|
||||||
|
|
||||||
if (speed > 0.85) world.spawnParticle(Particle.SONIC_BOOM, loc, 1, 0, 0, 0, 0);
|
if (speed > PARTICLE_SPEED_HIGH) {
|
||||||
else if (speed > 0.45) world.spawnParticle(Particle.CRIT, loc, 3, 0.1, 0.1, 0.1, 0.08);
|
world.spawnParticle(Particle.SONIC_BOOM, loc, 1, 0, 0, 0, 0);
|
||||||
else world.spawnParticle(Particle.SMOKE, loc, 1, 0.05, 0, 0.05, 0.02);
|
} else if (speed > PARTICLE_SPEED_MEDIUM) {
|
||||||
|
world.spawnParticle(Particle.CRIT, loc, 3, 0.1, 0.1, 0.1, 0.08);
|
||||||
|
} else {
|
||||||
|
world.spawnParticle(Particle.SMOKE, loc, 1, 0.05, 0, 0.05, 0.02);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void spawnBall() {
|
private void spawnBall() {
|
||||||
if (spawnLocation == null || (ball != null && ball.isValid())) return;
|
if (spawnLocation == null || spawnLocation.getWorld() == null) {
|
||||||
|
Bukkit.getLogger().warning("[NexusLobby] Ball-Spawn-Location nicht gesetzt! Verwende /nexuslobby ball setspawn");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ball != null && ball.isValid()) return;
|
||||||
|
|
||||||
// Ball direkt auf dem Boden spawnen (keine Y-Offset Erhöhung)
|
|
||||||
Location spawnLoc = spawnLocation.clone();
|
Location spawnLoc = spawnLocation.clone();
|
||||||
ball = (ArmorStand) spawnLoc.getWorld().spawnEntity(spawnLoc, EntityType.ARMOR_STAND);
|
ball = (ArmorStand) spawnLoc.getWorld().spawnEntity(spawnLoc, EntityType.ARMOR_STAND);
|
||||||
|
|
||||||
@@ -220,17 +271,15 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
ball.setInvulnerable(false);
|
ball.setInvulnerable(false);
|
||||||
ball.setArms(false);
|
ball.setArms(false);
|
||||||
ball.setCustomNameVisible(false);
|
ball.setCustomNameVisible(false);
|
||||||
|
|
||||||
// Setze Custom Name für zusätzliche Erkennung (unsichtbar für Spieler)
|
|
||||||
ball.setCustomName(BALL_NAME);
|
ball.setCustomName(BALL_NAME);
|
||||||
|
|
||||||
// Deaktiviert das Speichern in der Welt-Datei
|
|
||||||
ball.setPersistent(false);
|
ball.setPersistent(false);
|
||||||
// Markiert den Ball für das Cleanup-System
|
|
||||||
ball.addScoreboardTag(BALL_TAG);
|
ball.addScoreboardTag(BALL_TAG);
|
||||||
|
|
||||||
ItemStack ballHead = getSoccerHead();
|
ItemStack ballHead = getSoccerHead();
|
||||||
if (ball.getEquipment() != null) ball.getEquipment().setHelmet(ballHead);
|
if (ball.getEquipment() != null) {
|
||||||
|
ball.getEquipment().setHelmet(ballHead);
|
||||||
|
}
|
||||||
|
|
||||||
lastMoveTime = System.currentTimeMillis();
|
lastMoveTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,35 +288,37 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
SkullMeta meta = (SkullMeta) head.getItemMeta();
|
SkullMeta meta = (SkullMeta) head.getItemMeta();
|
||||||
if (meta == null) return head;
|
if (meta == null) return head;
|
||||||
|
|
||||||
PlayerProfile profile = Bukkit.createPlayerProfile(UUID.randomUUID(), "SoccerBall");
|
PlayerProfile profile = Bukkit.createPlayerProfile(UUID.randomUUID(), BALL_NAME);
|
||||||
try {
|
try {
|
||||||
profile.getTextures().setSkin(new URL(TEXTURE_URL));
|
profile.getTextures().setSkin(new URL(TEXTURE_URL));
|
||||||
} catch (MalformedURLException ignored) {}
|
} catch (MalformedURLException e) {
|
||||||
|
Bukkit.getLogger().warning("[NexusLobby] Ungültige Ball-Textur URL!");
|
||||||
|
}
|
||||||
meta.setOwnerProfile(profile);
|
meta.setOwnerProfile(profile);
|
||||||
|
|
||||||
head.setItemMeta(meta);
|
head.setItemMeta(meta);
|
||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void respawnBall() {
|
public void respawnBall() {
|
||||||
if (ball != null) {
|
if (ball != null && ball.isValid()) {
|
||||||
ball.remove();
|
ball.remove();
|
||||||
ball = null;
|
ball = null;
|
||||||
}
|
}
|
||||||
removeAllOldBallsGlobal();
|
removeAllOldBalls();
|
||||||
spawnBall();
|
spawnBall();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBallPunch(EntityDamageByEntityEvent event) {
|
public void onBallPunch(EntityDamageByEntityEvent event) {
|
||||||
if (event.getEntity().equals(ball)) {
|
if (ball == null || !event.getEntity().equals(ball)) return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
if (event.getDamager() instanceof Player p) {
|
if (event.getDamager() instanceof Player p) {
|
||||||
Vector shootDir = p.getLocation().getDirection();
|
Vector shootDir = p.getLocation().getDirection();
|
||||||
if (shootDir.lengthSquared() > 0) {
|
if (shootDir.lengthSquared() > 0) {
|
||||||
shootDir.normalize().multiply(1.35).setY(0.38);
|
shootDir.normalize().multiply(KICK_FORCE).setY(KICK_LIFT);
|
||||||
ball.setVelocity(shootDir);
|
ball.setVelocity(shootDir);
|
||||||
}
|
|
||||||
ball.getWorld().playSound(ball.getLocation(), Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, 0.6f, 1.5f);
|
ball.getWorld().playSound(ball.getLocation(), Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR, 0.6f, 1.5f);
|
||||||
lastMoveTime = System.currentTimeMillis();
|
lastMoveTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
@@ -276,37 +327,71 @@ public class SoccerModule implements Module, Listener, CommandExecutor {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBallInteract(PlayerInteractAtEntityEvent event) {
|
public void onBallInteract(PlayerInteractAtEntityEvent event) {
|
||||||
if (event.getRightClicked().equals(ball)) event.setCancelled(true);
|
if (ball != null && event.getRightClicked().equals(ball)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadConfigLocation() {
|
private void loadConfigLocation() {
|
||||||
FileConfiguration config = NexusLobby.getInstance().getConfig();
|
FileConfiguration config = NexusLobby.getInstance().getConfig();
|
||||||
if (config.contains("ball.spawn")) spawnLocation = config.getLocation("ball.spawn");
|
if (config.contains("ball.spawn")) {
|
||||||
|
spawnLocation = config.getLocation("ball.spawn");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
if (!(sender instanceof Player p) || !p.hasPermission("nexuslobby.admin")) return true;
|
if (!(sender instanceof Player p)) {
|
||||||
|
sender.sendMessage("§cNur Spieler können diesen Befehl ausführen.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!p.hasPermission("nexuslobby.admin")) {
|
||||||
|
p.sendMessage("§cKeine Berechtigung!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.length >= 2 && args[0].equalsIgnoreCase("ball")) {
|
if (args.length >= 2 && args[0].equalsIgnoreCase("ball")) {
|
||||||
if (args[1].equalsIgnoreCase("setspawn")) {
|
switch (args[1].toLowerCase()) {
|
||||||
|
case "setspawn" -> {
|
||||||
spawnLocation = p.getLocation();
|
spawnLocation = p.getLocation();
|
||||||
NexusLobby.getInstance().getConfig().set("ball.spawn", spawnLocation);
|
NexusLobby.getInstance().getConfig().set("ball.spawn", spawnLocation);
|
||||||
NexusLobby.getInstance().saveConfig();
|
NexusLobby.getInstance().saveConfig();
|
||||||
respawnBall();
|
respawnBall();
|
||||||
p.sendMessage("§8[§6Nexus§8] §aBall-Spawn gesetzt. Cleanup ist aktiv!");
|
p.sendMessage("§8[§6Nexus§8] §aBall-Spawn gesetzt und Ball respawnt!");
|
||||||
return true;
|
return true;
|
||||||
} else if (args[1].equalsIgnoreCase("respawn")) {
|
}
|
||||||
|
case "respawn" -> {
|
||||||
respawnBall();
|
respawnBall();
|
||||||
p.sendMessage("§8[§6Nexus§8] §eBall manuell respawnt.");
|
p.sendMessage("§8[§6Nexus§8] §eBall manuell respawnt.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case "remove" -> {
|
||||||
|
if (ball != null) {
|
||||||
|
ball.remove();
|
||||||
|
ball = null;
|
||||||
|
}
|
||||||
|
removeAllOldBalls();
|
||||||
|
p.sendMessage("§8[§6Nexus§8] §cBall entfernt und Cleanup durchgeführt.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
default -> {
|
||||||
|
p.sendMessage("§8[§6Nexus§8] §7Verwendung:");
|
||||||
|
p.sendMessage("§e/nexuslobby ball setspawn §7- Setzt den Ball-Spawn");
|
||||||
|
p.sendMessage("§e/nexuslobby ball respawn §7- Spawnt den Ball neu");
|
||||||
|
p.sendMessage("§e/nexuslobby ball remove §7- Entfernt den Ball");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (ball != null) ball.remove();
|
if (ball != null && ball.isValid()) {
|
||||||
|
ball.remove();
|
||||||
|
ball = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ public class GadgetModule implements Module, Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInteract(PlayerInteractEvent event) {
|
public void onInteract(PlayerInteractEvent event) {
|
||||||
ItemStack item = event.getItem();
|
ItemStack item = event.getItem();
|
||||||
if (item == null || !item.hasItemMeta()) return;
|
if (item == null || !item.hasItemMeta() || !item.getItemMeta().hasDisplayName()) return;
|
||||||
String name = item.getItemMeta().getDisplayName();
|
String name = item.getItemMeta().getDisplayName();
|
||||||
|
|
||||||
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||||
@@ -216,7 +216,11 @@ public class GadgetModule implements Module, Listener {
|
|||||||
else if (item.getType() == Material.BARRIER) { removeGadgets(player); player.closeInventory(); }
|
else if (item.getType() == Material.BARRIER) { removeGadgets(player); player.closeInventory(); }
|
||||||
} else if (title.equals(HAT_TITLE)) {
|
} else if (title.equals(HAT_TITLE)) {
|
||||||
if (item.getType() != Material.GRAY_STAINED_GLASS_PANE) {
|
if (item.getType() != Material.GRAY_STAINED_GLASS_PANE) {
|
||||||
HatManager.setHat(player, item.getType(), item.getItemMeta().getDisplayName());
|
String hatName = item.getType().name();
|
||||||
|
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()) {
|
||||||
|
hatName = item.getItemMeta().getDisplayName();
|
||||||
|
}
|
||||||
|
HatManager.setHat(player, item.getType(), hatName);
|
||||||
player.playSound(player.getLocation(), Sound.ITEM_ARMOR_EQUIP_GENERIC, 1, 1);
|
player.playSound(player.getLocation(), Sound.ITEM_ARMOR_EQUIP_GENERIC, 1, 1);
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
}
|
}
|
||||||
@@ -273,7 +277,8 @@ public class GadgetModule implements Module, Listener {
|
|||||||
public void onFish(PlayerFishEvent event) {
|
public void onFish(PlayerFishEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
ItemStack item = player.getInventory().getItemInMainHand();
|
ItemStack item = player.getInventory().getItemInMainHand();
|
||||||
if (item.getType() == Material.FISHING_ROD && item.hasItemMeta() && item.getItemMeta().getDisplayName().equals("§b§lEnterhaken")) {
|
if (item.getType() == Material.FISHING_ROD && item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||||
|
&& item.getItemMeta().getDisplayName().equals("§b§lEnterhaken")) {
|
||||||
if (event.getState() == PlayerFishEvent.State.IN_GROUND || event.getState() == PlayerFishEvent.State.REEL_IN || event.getState() == PlayerFishEvent.State.CAUGHT_ENTITY) {
|
if (event.getState() == PlayerFishEvent.State.IN_GROUND || event.getState() == PlayerFishEvent.State.REEL_IN || event.getState() == PlayerFishEvent.State.CAUGHT_ENTITY) {
|
||||||
if (event.getHook() != null) {
|
if (event.getHook() != null) {
|
||||||
GrapplingHook.pullPlayer(player, event.getHook().getLocation());
|
GrapplingHook.pullPlayer(player, event.getHook().getLocation());
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ public class HologramModule implements Module, Listener {
|
|||||||
config.save(file);
|
config.save(file);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
NexusLobby.getInstance().getLogger().severe("Konnte holograms.yml nicht speichern!");
|
NexusLobby.getInstance().getLogger().severe("Konnte holograms.yml nicht speichern!");
|
||||||
e.printStackTrace();
|
NexusLobby.getInstance().getLogger().severe("Fehler beim Speichern der Hologramme: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,11 @@ public class IntroModule implements Module, Listener, CommandExecutor {
|
|||||||
|
|
||||||
private void savePoints() {
|
private void savePoints() {
|
||||||
config.set("points", points);
|
config.set("points", points);
|
||||||
try { config.save(configFile); } catch (IOException e) { e.printStackTrace(); }
|
try {
|
||||||
|
config.save(configFile);
|
||||||
|
} catch (IOException e) {
|
||||||
|
NexusLobby.getInstance().getLogger().severe("Fehler beim Speichern der Intro-Config: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
try {
|
try {
|
||||||
storageFile.createNewFile();
|
storageFile.createNewFile();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
NexusLobby.getInstance().getLogger().severe("Fehler beim Erstellen der mapart.yml: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storageConfig = YamlConfiguration.loadConfiguration(storageFile);
|
storageConfig = YamlConfiguration.loadConfiguration(storageFile);
|
||||||
@@ -77,7 +77,7 @@ public class MapArtModule implements Module, CommandExecutor {
|
|||||||
try {
|
try {
|
||||||
storageConfig.save(storageFile);
|
storageConfig.save(storageFile);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
NexusLobby.getInstance().getLogger().severe("Fehler beim Speichern der mapart.yml: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,11 @@ public class ParkourManager {
|
|||||||
private void loadConfig() {
|
private void loadConfig() {
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
try { file.createNewFile(); } catch (IOException e) { e.printStackTrace(); }
|
try {
|
||||||
|
file.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
plugin.getLogger().severe("Fehler beim Erstellen der Parkour-Datei: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
config = YamlConfiguration.loadConfiguration(file);
|
config = YamlConfiguration.loadConfiguration(file);
|
||||||
}
|
}
|
||||||
@@ -183,7 +187,13 @@ public class ParkourManager {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void save() { try { config.save(file); } catch (IOException e) { e.printStackTrace(); } }
|
private void save() {
|
||||||
|
try {
|
||||||
|
config.save(file);
|
||||||
|
} catch (IOException e) {
|
||||||
|
plugin.getLogger().severe("Fehler beim Speichern der Parkour-Config: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void clearStats() {
|
public void clearStats() {
|
||||||
config.set("besttimes", null);
|
config.set("besttimes", null);
|
||||||
|
|||||||
@@ -94,9 +94,15 @@ public class PlayerInspectModule implements Module, Listener {
|
|||||||
List<String> lore = new ArrayList<>();
|
List<String> lore = new ArrayList<>();
|
||||||
lore.add("§8§m-----------------------");
|
lore.add("§8§m-----------------------");
|
||||||
|
|
||||||
// LuckPerms Prefix über PlaceholderAPI auslesen
|
// LuckPerms Prefix über PlaceholderAPI auslesen (falls vorhanden)
|
||||||
String prefix = "%luckperms_prefix%";
|
String prefix = "%luckperms_prefix%";
|
||||||
|
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
||||||
|
try {
|
||||||
prefix = PlaceholderAPI.setPlaceholders(target, prefix);
|
prefix = PlaceholderAPI.setPlaceholders(target, prefix);
|
||||||
|
} catch (NoClassDefFoundError ignored) {
|
||||||
|
// PlaceholderAPI fehlt zur Laufzeit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// KORREKTUR: Farbcodes (&) in echte Minecraft-Farben (§) umwandeln
|
// KORREKTUR: Farbcodes (&) in echte Minecraft-Farben (§) umwandeln
|
||||||
prefix = ChatColor.translateAlternateColorCodes('&', prefix);
|
prefix = ChatColor.translateAlternateColorCodes('&', prefix);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public class PortalManager implements Module, Listener {
|
|||||||
private Location borderMin;
|
private Location borderMin;
|
||||||
private Location borderMax;
|
private Location borderMax;
|
||||||
private boolean borderEnabled = false;
|
private boolean borderEnabled = false;
|
||||||
|
private String borderType;
|
||||||
|
|
||||||
public PortalManager(NexusLobby plugin) {
|
public PortalManager(NexusLobby plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@@ -77,18 +78,26 @@ public class PortalManager implements Module, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void loadBorderSettings() {
|
public void loadBorderSettings() {
|
||||||
if (plugin.getConfig().contains("border.pos1") && plugin.getConfig().contains("border.pos2")) {
|
this.borderType = plugin.getConfig().getString("worldborder.type", "SQUARE");
|
||||||
Location p1 = plugin.getConfig().getLocation("border.pos1");
|
boolean enabled = plugin.getConfig().getBoolean("worldborder.enabled", false);
|
||||||
Location p2 = plugin.getConfig().getLocation("border.pos2");
|
if (!enabled || !"SQUARE".equalsIgnoreCase(borderType)) {
|
||||||
|
this.borderEnabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plugin.getConfig().contains("worldborder.pos1") && plugin.getConfig().contains("worldborder.pos2")) {
|
||||||
|
Location p1 = plugin.getConfig().getLocation("worldborder.pos1");
|
||||||
|
Location p2 = plugin.getConfig().getLocation("worldborder.pos2");
|
||||||
if (p1 != null && p2 != null) {
|
if (p1 != null && p2 != null) {
|
||||||
this.borderMin = getMinLocation(p1, p2);
|
this.borderMin = getMinLocation(p1, p2);
|
||||||
this.borderMax = getMaxLocation(p1, p2);
|
this.borderMax = getMaxLocation(p1, p2);
|
||||||
this.borderEnabled = true;
|
this.borderEnabled = true;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
this.borderEnabled = false;
|
this.borderEnabled = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getPortalNames() {
|
public Set<String> getPortalNames() {
|
||||||
return portals.keySet();
|
return portals.keySet();
|
||||||
@@ -221,8 +230,7 @@ public class PortalManager implements Module, Listener {
|
|||||||
try {
|
try {
|
||||||
config.save(new java.io.File(plugin.getDataFolder(), "portals.yml"));
|
config.save(new java.io.File(plugin.getDataFolder(), "portals.yml"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
plugin.getLogger().severe("Konnte portals.yml nicht speichern!");
|
plugin.getLogger().severe("Fehler beim Speichern der portals.yml: " + e.getMessage());
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,7 +410,7 @@ public class PortalManager implements Module, Listener {
|
|||||||
out.writeUTF(serverName);
|
out.writeUTF(serverName);
|
||||||
player.sendPluginMessage(plugin, "BungeeCord", b.toByteArray());
|
player.sendPluginMessage(plugin, "BungeeCord", b.toByteArray());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
plugin.getLogger().warning("Fehler beim Senden der BungeeCord-Nachricht: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.ArmorStand;
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
@@ -13,6 +14,8 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
|
|
||||||
public class ServerChecker {
|
public class ServerChecker {
|
||||||
|
|
||||||
|
private static BukkitTask globalCheckerTask = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prüft asynchron, ob ein Server unter der angegebenen IP und Port erreichbar ist.
|
* Prüft asynchron, ob ein Server unter der angegebenen IP und Port erreichbar ist.
|
||||||
*/
|
*/
|
||||||
@@ -32,8 +35,11 @@ public class ServerChecker {
|
|||||||
* Startet den Scheduler, der alle ArmorStands in allen Welten regelmäßig prüft.
|
* Startet den Scheduler, der alle ArmorStands in allen Welten regelmäßig prüft.
|
||||||
*/
|
*/
|
||||||
public static void startGlobalChecker() {
|
public static void startGlobalChecker() {
|
||||||
|
// Cancel alten Task falls vorhanden
|
||||||
|
stopGlobalChecker();
|
||||||
|
|
||||||
// WICHTIG: runTaskTimer (synchron), um den Main-Thread für getEntitiesByClass zu nutzen
|
// WICHTIG: runTaskTimer (synchron), um den Main-Thread für getEntitiesByClass zu nutzen
|
||||||
Bukkit.getScheduler().runTaskTimer(NexusLobby.getInstance(), () -> {
|
globalCheckerTask = Bukkit.getScheduler().runTaskTimer(NexusLobby.getInstance(), () -> {
|
||||||
for (World world : Bukkit.getWorlds()) {
|
for (World world : Bukkit.getWorlds()) {
|
||||||
// Das Abrufen der Entities muss auf dem Main-Thread passieren
|
// Das Abrufen der Entities muss auf dem Main-Thread passieren
|
||||||
for (ArmorStand as : world.getEntitiesByClass(ArmorStand.class)) {
|
for (ArmorStand as : world.getEntitiesByClass(ArmorStand.class)) {
|
||||||
@@ -43,6 +49,16 @@ public class ServerChecker {
|
|||||||
}, 100L, 200L);
|
}, 100L, 200L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stoppt den Server-Checker Task
|
||||||
|
*/
|
||||||
|
public static void stopGlobalChecker() {
|
||||||
|
if (globalCheckerTask != null && !globalCheckerTask.isCancelled()) {
|
||||||
|
globalCheckerTask.cancel();
|
||||||
|
globalCheckerTask = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Analysiert die Tags eines ArmorStands und aktualisiert den Namen basierend auf dem Serverstatus.
|
* Analysiert die Tags eines ArmorStands und aktualisiert den Namen basierend auf dem Serverstatus.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class ServerSwitcherGUI {
|
|||||||
private static void connectToServer(Player player, String serverName, Plugin plugin) {
|
private static void connectToServer(Player player, String serverName, Plugin plugin) {
|
||||||
try {
|
try {
|
||||||
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin, "BungeeCord")) {
|
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin, "BungeeCord")) {
|
||||||
player.sendMessage(ChatColor.RED + "Proxy-Verbindung nicht möglich (BungeeCord Kanal nicht registriert).");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("proxy_not_registered"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,13 +120,13 @@ public class ServerSwitcherGUI {
|
|||||||
out.writeUTF("Connect");
|
out.writeUTF("Connect");
|
||||||
out.writeUTF(serverName);
|
out.writeUTF(serverName);
|
||||||
player.sendPluginMessage(plugin, "BungeeCord", b.toByteArray());
|
player.sendPluginMessage(plugin, "BungeeCord", b.toByteArray());
|
||||||
player.sendMessage(ChatColor.YELLOW + "Verbinde zu: " + ChatColor.WHITE + serverName);
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("connecting_to_server").replace("{server}", serverName));
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
ex.printStackTrace();
|
NexusLobby.getInstance().getLogger().warning("Fehler beim Senden der BungeeCord-Nachricht: " + ex.getMessage());
|
||||||
player.sendMessage(ChatColor.RED + "Fehler beim Verbinden zum Server.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("server_connect_error"));
|
||||||
} catch (RuntimeException ex) {
|
} catch (RuntimeException ex) {
|
||||||
// Schutz gegen unerwartete RuntimeExceptions bei plugin messaging
|
// Schutz gegen unerwartete RuntimeExceptions bei plugin messaging
|
||||||
player.sendMessage(ChatColor.RED + "Proxy-Verbindung nicht möglich.");
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("proxy_connect_error"));
|
||||||
plugin.getLogger().warning("Fehler beim Senden der Plugin-Message: " + ex.getMessage());
|
plugin.getLogger().warning("Fehler beim Senden der Plugin-Message: " + ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import de.nexuslobby.NexusLobby;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@@ -19,7 +22,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ServerSwitcherListener implements Listener {
|
public class ServerSwitcherListener implements Listener, CommandExecutor {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||||
@@ -51,6 +54,23 @@ public class ServerSwitcherListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
if (!(sender instanceof Player)) {
|
||||||
|
sender.sendMessage(de.nexuslobby.utils.LangManager.get("only_player"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player player = (Player) sender;
|
||||||
|
if (!player.hasPermission("nexuslobby.serverswitcher")) {
|
||||||
|
player.sendMessage(de.nexuslobby.utils.LangManager.get("no_permission"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
openServerGUI(player);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onCompassClick(PlayerInteractEvent e) {
|
public void onCompassClick(PlayerInteractEvent e) {
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ public class LobbySettingsModule implements Module, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hilfsmethode zur sicheren Anwendung von GameRules in 1.21
|
// Hilfsmethode zur sicheren Anwendung von GameRules in 1.21
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private void updateGameRule(World world, String ruleName, Object value) {
|
private void updateGameRule(World world, String ruleName, Object value) {
|
||||||
GameRule<?> rule = GameRule.getByName(ruleName);
|
GameRule<?> rule = GameRule.getByName(ruleName);
|
||||||
if (rule == null) return;
|
if (rule == null) return;
|
||||||
@@ -117,6 +118,7 @@ public class LobbySettingsModule implements Module, Listener {
|
|||||||
Material mat = isBool ? ((Boolean)value ? Material.LIME_DYE : Material.GRAY_DYE) : Material.BOOK;
|
Material mat = isBool ? ((Boolean)value ? Material.LIME_DYE : Material.GRAY_DYE) : Material.BOOK;
|
||||||
ItemStack item = new ItemStack(mat);
|
ItemStack item = new ItemStack(mat);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
if (meta == null) return item;
|
||||||
meta.setDisplayName("§e" + key);
|
meta.setDisplayName("§e" + key);
|
||||||
List<String> lore = new ArrayList<>();
|
List<String> lore = new ArrayList<>();
|
||||||
lore.add("§7Aktueller Wert: §f" + value);
|
lore.add("§7Aktueller Wert: §f" + value);
|
||||||
@@ -160,13 +162,17 @@ public class LobbySettingsModule implements Module, Listener {
|
|||||||
|
|
||||||
private void handleSubClick(InventoryClickEvent event) {
|
private void handleSubClick(InventoryClickEvent event) {
|
||||||
Player p = (Player) event.getWhoClicked();
|
Player p = (Player) event.getWhoClicked();
|
||||||
if (event.getCurrentItem() == null || event.getCurrentItem().getType() == Material.AIR) return;
|
ItemStack current = event.getCurrentItem();
|
||||||
if (event.getCurrentItem().getType() == Material.BARRIER) {
|
if (current == null || current.getType() == Material.AIR) return;
|
||||||
|
if (current.getType() == Material.BARRIER) {
|
||||||
openMainMenu(p);
|
openMainMenu(p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ItemMeta meta = current.getItemMeta();
|
||||||
String key = event.getCurrentItem().getItemMeta().getDisplayName().substring(2);
|
if (meta == null || !meta.hasDisplayName()) return;
|
||||||
|
String displayName = meta.getDisplayName();
|
||||||
|
if (displayName.length() < 3) return;
|
||||||
|
String key = displayName.substring(2);
|
||||||
String path = settingsConfig.contains("gamerules." + key) ? "gamerules." + key : key;
|
String path = settingsConfig.contains("gamerules." + key) ? "gamerules." + key : key;
|
||||||
Object value = settingsConfig.get(path);
|
Object value = settingsConfig.get(path);
|
||||||
String category = event.getView().getTitle().replace(subTitlePrefix, "");
|
String category = event.getView().getTitle().replace(subTitlePrefix, "");
|
||||||
@@ -203,12 +209,17 @@ public class LobbySettingsModule implements Module, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saveSettings() {
|
private void saveSettings() {
|
||||||
try { settingsConfig.save(configFile); } catch (IOException e) { e.printStackTrace(); }
|
try {
|
||||||
|
settingsConfig.save(configFile);
|
||||||
|
} catch (IOException e) {
|
||||||
|
NexusLobby.getInstance().getLogger().severe("Fehler beim Speichern der settings.yml: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack createItem(Material mat, String name, String lore) {
|
private ItemStack createItem(Material mat, String name, String lore) {
|
||||||
ItemStack item = new ItemStack(mat);
|
ItemStack item = new ItemStack(mat);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
if (meta == null) return item;
|
||||||
meta.setDisplayName(name);
|
meta.setDisplayName(name);
|
||||||
if (!lore.isEmpty()) {
|
if (!lore.isEmpty()) {
|
||||||
List<String> lores = new ArrayList<>();
|
List<String> lores = new ArrayList<>();
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class GlobalChatSuppressor implements Module, PluginMessageListener, List
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
Bukkit.getLogger().severe("Fehler beim Abrufen des Conversation-Managers: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package de.nexuslobby.utils;
|
package de.nexuslobby.utils;
|
||||||
|
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
@@ -23,7 +24,13 @@ public class ConfigUpdater {
|
|||||||
FileConfiguration serverConfig = YamlConfiguration.loadConfiguration(configFile);
|
FileConfiguration serverConfig = YamlConfiguration.loadConfiguration(configFile);
|
||||||
List<String> newFileContent = new ArrayList<>();
|
List<String> newFileContent = new ArrayList<>();
|
||||||
|
|
||||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(plugin.getResource(fileName), StandardCharsets.UTF_8))) {
|
InputStream resourceStream = plugin.getResource(fileName);
|
||||||
|
if (resourceStream == null) {
|
||||||
|
plugin.getLogger().severe("Config-Update fehlgeschlagen: Resource fehlt: " + fileName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try (BufferedReader reader = new BufferedReader(new InputStreamReader(resourceStream, StandardCharsets.UTF_8))) {
|
||||||
String line;
|
String line;
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
String trimmed = line.trim();
|
String trimmed = line.trim();
|
||||||
@@ -52,7 +59,7 @@ public class ConfigUpdater {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
Bukkit.getLogger().severe("Fehler beim Config-Update: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Datei sauber speichern
|
// 3. Datei sauber speichern
|
||||||
|
|||||||
155
src/main/java/de/nexuslobby/utils/ConfigValidator.java
Normal file
155
src/main/java/de/nexuslobby/utils/ConfigValidator.java
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
package de.nexuslobby.utils;
|
||||||
|
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validiert Config-Werte und setzt Default-Werte wenn nötig
|
||||||
|
*/
|
||||||
|
public class ConfigValidator {
|
||||||
|
|
||||||
|
private final JavaPlugin plugin;
|
||||||
|
private final FileConfiguration config;
|
||||||
|
private final List<String> warnings = new ArrayList<>();
|
||||||
|
private boolean modified = false;
|
||||||
|
|
||||||
|
public ConfigValidator(JavaPlugin plugin, FileConfiguration config) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.config = config;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validiert alle Config-Werte und gibt Warnings aus
|
||||||
|
*/
|
||||||
|
public void validate() {
|
||||||
|
validateSpawn();
|
||||||
|
validateLobbySettings();
|
||||||
|
validateTablist();
|
||||||
|
validateBall();
|
||||||
|
validateModules();
|
||||||
|
|
||||||
|
// Warnings ausgeben
|
||||||
|
if (!warnings.isEmpty()) {
|
||||||
|
plugin.getLogger().warning("=== Config-Validierung ===");
|
||||||
|
warnings.forEach(msg -> plugin.getLogger().warning(" " + msg));
|
||||||
|
plugin.getLogger().warning("=========================");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Config speichern wenn Änderungen vorgenommen wurden
|
||||||
|
if (modified) {
|
||||||
|
plugin.saveConfig();
|
||||||
|
plugin.getLogger().info("Config wurde mit Default-Werten aktualisiert.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateSpawn() {
|
||||||
|
ensureDefault("spawn.world", "world");
|
||||||
|
ensureDefault("spawn.x", 0.5);
|
||||||
|
ensureDefault("spawn.y", 64.0);
|
||||||
|
ensureDefault("spawn.z", 0.5);
|
||||||
|
ensureDefault("spawn.yaw", 0.0);
|
||||||
|
ensureDefault("spawn.pitch", 0.0);
|
||||||
|
|
||||||
|
// Validiere Y-Koordinate
|
||||||
|
double y = config.getDouble("spawn.y", 64.0);
|
||||||
|
if (y < -64 || y > 320) {
|
||||||
|
warnings.add("spawn.y (" + y + ") außerhalb des gültigen Bereichs (-64 bis 320)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateLobbySettings() {
|
||||||
|
ensureDefault("lobby.allow-fly", false);
|
||||||
|
ensureDefault("lobby.pvp-enabled", false);
|
||||||
|
ensureDefault("lobby.build-enabled", false);
|
||||||
|
ensureDefault("lobby.default-gamemode", "Adventure");
|
||||||
|
ensureDefault("lobby.clear-inventory-on-join", true);
|
||||||
|
|
||||||
|
// Validiere GameMode
|
||||||
|
String gamemode = config.getString("lobby.default-gamemode", "Adventure");
|
||||||
|
if (!isValidGameMode(gamemode)) {
|
||||||
|
warnings.add("lobby.default-gamemode '" + gamemode + "' ist ungültig. Nutze: Survival, Creative, Adventure oder Spectator");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateTablist() {
|
||||||
|
ensureDefault("tablist.enabled", true);
|
||||||
|
ensureDefault("tablist.header", "&6Willkommen auf &eNexusLobby");
|
||||||
|
ensureDefault("tablist.footer", "&7Viel Spaß!");
|
||||||
|
ensureDefault("tablist.refresh-interval", 40);
|
||||||
|
|
||||||
|
// Validiere Refresh-Interval
|
||||||
|
int interval = config.getInt("tablist.refresh-interval", 40);
|
||||||
|
if (interval < 1) {
|
||||||
|
warnings.add("tablist.refresh-interval (" + interval + ") ist zu klein. Minimum ist 1 Tick.");
|
||||||
|
config.set("tablist.refresh-interval", 1);
|
||||||
|
modified = true;
|
||||||
|
} else if (interval > 200) {
|
||||||
|
warnings.add("tablist.refresh-interval (" + interval + ") ist sehr hoch. Empfohlen: 20-100 Ticks.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateBall() {
|
||||||
|
ensureDefault("ball.respawn_delay", 60);
|
||||||
|
|
||||||
|
// Validiere Respawn-Delay
|
||||||
|
long delay = config.getLong("ball.respawn_delay", 60);
|
||||||
|
if (delay < 5) {
|
||||||
|
warnings.add("ball.respawn_delay (" + delay + "s) ist zu kurz. Minimum empfohlen: 5 Sekunden.");
|
||||||
|
} else if (delay > 600) {
|
||||||
|
warnings.add("ball.respawn_delay (" + delay + "s) ist sehr lang. Empfohlen: 30-120 Sekunden.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prüfe ob Spawn gesetzt ist
|
||||||
|
if (!config.contains("ball.spawn")) {
|
||||||
|
warnings.add("ball.spawn nicht gesetzt. Nutze /nexuslobby ball setspawn");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateModules() {
|
||||||
|
// Worldborder
|
||||||
|
if (config.contains("worldborder.enabled")) {
|
||||||
|
ensureDefault("worldborder.type", "SQUARE");
|
||||||
|
ensureDefault("worldborder.radius", 50.0);
|
||||||
|
|
||||||
|
double radius = config.getDouble("worldborder.radius", 50.0);
|
||||||
|
if (radius < 10) {
|
||||||
|
warnings.add("worldborder.radius (" + radius + ") ist sehr klein. Minimum empfohlen: 10 Blöcke.");
|
||||||
|
} else if (radius > 10000) {
|
||||||
|
warnings.add("worldborder.radius (" + radius + ") ist extrem groß. Performance-Warnung!");
|
||||||
|
}
|
||||||
|
|
||||||
|
String type = config.getString("worldborder.type", "SQUARE");
|
||||||
|
if (!type.equalsIgnoreCase("SQUARE") && !type.equalsIgnoreCase("CIRCLE")) {
|
||||||
|
warnings.add("worldborder.type '" + type + "' ist ungültig. Nutze: SQUARE oder CIRCLE");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Items Modul
|
||||||
|
if (config.contains("items.lobby-tools")) {
|
||||||
|
// Prüfe ob Slot-Nummern gültig sind (0-8)
|
||||||
|
for (String toolKey : config.getConfigurationSection("items.lobby-tools").getKeys(false)) {
|
||||||
|
int slot = config.getInt("items.lobby-tools." + toolKey + ".slot", -1);
|
||||||
|
if (slot < 0 || slot > 8) {
|
||||||
|
warnings.add("items.lobby-tools." + toolKey + ".slot (" + slot + ") ist ungültig (0-8)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ensureDefault(String path, Object defaultValue) {
|
||||||
|
if (!config.contains(path)) {
|
||||||
|
config.set(path, defaultValue);
|
||||||
|
modified = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isValidGameMode(String mode) {
|
||||||
|
return mode.equalsIgnoreCase("Survival") ||
|
||||||
|
mode.equalsIgnoreCase("Creative") ||
|
||||||
|
mode.equalsIgnoreCase("Adventure") ||
|
||||||
|
mode.equalsIgnoreCase("Spectator");
|
||||||
|
}
|
||||||
|
}
|
||||||
32
src/main/java/de/nexuslobby/utils/LangManager.java
Normal file
32
src/main/java/de/nexuslobby/utils/LangManager.java
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package de.nexuslobby.utils;
|
||||||
|
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class LangManager {
|
||||||
|
private static Map<String, Map<String, String>> langMap;
|
||||||
|
private static String currentLang = "de";
|
||||||
|
|
||||||
|
public static void load(JavaPlugin plugin) {
|
||||||
|
Yaml yaml = new Yaml();
|
||||||
|
try (InputStream in = plugin.getResource("lang.yml")) {
|
||||||
|
langMap = yaml.load(in);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLanguage(String lang) {
|
||||||
|
currentLang = lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get(String key) {
|
||||||
|
if (langMap == null) return key;
|
||||||
|
Map<String, String> translations = langMap.get(key);
|
||||||
|
if (translations == null) return key;
|
||||||
|
return translations.getOrDefault(currentLang, key);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,13 +24,22 @@ public class PlayerHider implements Listener {
|
|||||||
public void onJoin(PlayerJoinEvent event) {
|
public void onJoin(PlayerJoinEvent event) {
|
||||||
if (!NexusLobby.getInstance().getConfig().getBoolean("hider.enabled", true)) return;
|
if (!NexusLobby.getInstance().getConfig().getBoolean("hider.enabled", true)) return;
|
||||||
|
|
||||||
Material material = Material.valueOf(NexusLobby.getInstance().getConfig().getString("hider.item", "REDSTONE"));
|
var config = NexusLobby.getInstance().getConfig();
|
||||||
int slot = NexusLobby.getInstance().getConfig().getInt("hider.slot", 8);
|
Material material;
|
||||||
|
try {
|
||||||
|
material = Material.valueOf(config.getString("hider.item", "REDSTONE"));
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
material = Material.REDSTONE;
|
||||||
|
}
|
||||||
|
int slot = config.getInt("hider.slot", 8);
|
||||||
|
|
||||||
ItemStack item = new ItemStack(material);
|
ItemStack item = new ItemStack(material);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
meta.setDisplayName(NexusLobby.getInstance().getConfig().getString("hider.messages.all").replace("&", "§"));
|
if (meta != null) {
|
||||||
|
String allMsg = colorize(config.getString("hider.messages.all", "&aAlle Spieler"));
|
||||||
|
meta.setDisplayName(allMsg);
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
|
}
|
||||||
|
|
||||||
event.getPlayer().getInventory().setItem(slot, item);
|
event.getPlayer().getInventory().setItem(slot, item);
|
||||||
}
|
}
|
||||||
@@ -39,32 +48,40 @@ public class PlayerHider implements Listener {
|
|||||||
public void onInteract(PlayerInteractEvent event) {
|
public void onInteract(PlayerInteractEvent event) {
|
||||||
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
|
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
|
||||||
if (event.getItem() == null) return;
|
if (event.getItem() == null) return;
|
||||||
|
if (!event.getItem().hasItemMeta()) return;
|
||||||
|
if (event.getItem().getItemMeta() == null) return;
|
||||||
|
if (!event.getItem().getItemMeta().hasDisplayName()) return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String allMsg = NexusLobby.getInstance().getConfig().getString("hider.messages.all").replace("&", "§");
|
var config = NexusLobby.getInstance().getConfig();
|
||||||
String noneMsg = NexusLobby.getInstance().getConfig().getString("hider.messages.none").replace("&", "§");
|
String allMsg = de.nexuslobby.utils.LangManager.get("hider_all");
|
||||||
|
String noneMsg = de.nexuslobby.utils.LangManager.get("hider_none");
|
||||||
|
|
||||||
if (event.getItem().getItemMeta().getDisplayName().equals(allMsg)) {
|
if (event.getItem().getItemMeta().getDisplayName().equals(allMsg)) {
|
||||||
// Verstecken
|
// Verstecken
|
||||||
hidden.add(player.getUniqueId());
|
hidden.add(player.getUniqueId());
|
||||||
for (Player target : Bukkit.getOnlinePlayers()) player.hidePlayer(NexusLobby.getInstance(), target);
|
for (Player target : Bukkit.getOnlinePlayers()) player.hidePlayer(NexusLobby.getInstance(), target);
|
||||||
|
|
||||||
updateItem(player, noneMsg);
|
updateItem(player, noneMsg);
|
||||||
player.sendMessage(noneMsg);
|
player.sendMessage(noneMsg);
|
||||||
} else if (event.getItem().getItemMeta().getDisplayName().equals(noneMsg)) {
|
} else if (event.getItem().getItemMeta().getDisplayName().equals(noneMsg)) {
|
||||||
// Zeigen
|
// Zeigen
|
||||||
hidden.remove(player.getUniqueId());
|
hidden.remove(player.getUniqueId());
|
||||||
for (Player target : Bukkit.getOnlinePlayers()) player.showPlayer(NexusLobby.getInstance(), target);
|
for (Player target : Bukkit.getOnlinePlayers()) player.showPlayer(NexusLobby.getInstance(), target);
|
||||||
|
|
||||||
updateItem(player, allMsg);
|
updateItem(player, allMsg);
|
||||||
player.sendMessage(allMsg);
|
player.sendMessage(allMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateItem(Player player, String name) {
|
private void updateItem(Player player, String name) {
|
||||||
ItemStack item = player.getInventory().getItemInHand();
|
ItemStack item = player.getInventory().getItemInMainHand();
|
||||||
|
if (item == null || !item.hasItemMeta()) return;
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
if (meta == null) return;
|
||||||
meta.setDisplayName(name);
|
meta.setDisplayName(name);
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String colorize(String s) {
|
||||||
|
return s == null ? "" : s.replace("&", "§");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,24 @@
|
|||||||
package de.nexuslobby.utils;
|
package de.nexuslobby.utils;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
import com.google.gson.JsonSyntaxException;
|
||||||
import de.nexuslobby.NexusLobby;
|
import de.nexuslobby.NexusLobby;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Scanner;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class UpdateChecker {
|
public class UpdateChecker {
|
||||||
|
|
||||||
private final NexusLobby plugin;
|
private final NexusLobby plugin;
|
||||||
// URL zur Gitea API für das neueste Release
|
private static final String API_URL = "https://git.viper.ipv64.net/api/v1/repos/M_Viper/NexusLobby/releases/latest";
|
||||||
private final String url = "https://git.viper.ipv64.net/api/v1/repos/M_Viper/NexusLobby/releases/latest";
|
private static final int TIMEOUT_MS = 5000;
|
||||||
|
|
||||||
public UpdateChecker(NexusLobby plugin) {
|
public UpdateChecker(NexusLobby plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@@ -20,23 +26,60 @@ public class UpdateChecker {
|
|||||||
|
|
||||||
public void getVersion(final Consumer<String> consumer) {
|
public void getVersion(final Consumer<String> consumer) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
||||||
try (InputStream inputStream = new URL(url).openStream(); Scanner scanner = new Scanner(inputStream)) {
|
HttpURLConnection connection = null;
|
||||||
StringBuilder response = new StringBuilder();
|
try {
|
||||||
while (scanner.hasNextLine()) {
|
URL url = new URL(API_URL);
|
||||||
response.append(scanner.nextLine());
|
connection = (HttpURLConnection) url.openConnection();
|
||||||
|
connection.setRequestMethod("GET");
|
||||||
|
connection.setConnectTimeout(TIMEOUT_MS);
|
||||||
|
connection.setReadTimeout(TIMEOUT_MS);
|
||||||
|
connection.setRequestProperty("Accept", "application/json");
|
||||||
|
connection.setRequestProperty("User-Agent", "NexusLobby-UpdateChecker");
|
||||||
|
|
||||||
|
int responseCode = connection.getResponseCode();
|
||||||
|
if (responseCode != HttpURLConnection.HTTP_OK) {
|
||||||
|
plugin.getLogger().warning("Update-Check fehlgeschlagen: HTTP " + responseCode);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String content = response.toString();
|
try (BufferedReader reader = new BufferedReader(
|
||||||
// Einfaches Parsing des JSON "tag_name" Feldes
|
new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {
|
||||||
if (content.contains("\"tag_name\":")) {
|
|
||||||
String version = content.split("\"tag_name\":\"")[1].split("\"")[0];
|
StringBuilder response = new StringBuilder();
|
||||||
// Entferne ein eventuelles 'v' Präfix (z.B. v1.0.0 -> 1.0.0)
|
String line;
|
||||||
version = version.replace("v", "");
|
while ((line = reader.readLine()) != null) {
|
||||||
consumer.accept(version);
|
response.append(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
parseAndNotify(response.toString(), consumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
plugin.getLogger().warning("Update-Check fehlgeschlagen: " + e.getMessage());
|
||||||
|
} finally {
|
||||||
|
if (connection != null) {
|
||||||
|
connection.disconnect();
|
||||||
}
|
}
|
||||||
} catch (IOException exception) {
|
|
||||||
this.plugin.getLogger().warning("Update-Check fehlgeschlagen: " + exception.getMessage());
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void parseAndNotify(String jsonResponse, Consumer<String> consumer) {
|
||||||
|
try {
|
||||||
|
JsonObject json = JsonParser.parseString(jsonResponse).getAsJsonObject();
|
||||||
|
|
||||||
|
if (json.has("tag_name")) {
|
||||||
|
String version = json.get("tag_name").getAsString();
|
||||||
|
// Entferne 'v' Präfix falls vorhanden (z.B. v1.0.0 -> 1.0.0)
|
||||||
|
if (version.startsWith("v")) {
|
||||||
|
version = version.substring(1);
|
||||||
|
}
|
||||||
|
consumer.accept(version);
|
||||||
|
} else {
|
||||||
|
plugin.getLogger().warning("Update-Check: 'tag_name' nicht in API-Response gefunden");
|
||||||
|
}
|
||||||
|
} catch (JsonSyntaxException e) {
|
||||||
|
plugin.getLogger().warning("Update-Check: Ungültiges JSON-Format - " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -19,9 +19,9 @@ public class VoidProtection implements Listener {
|
|||||||
if (NexusLobby.getInstance().getConfig().getBoolean("void_protection.teleport_to_spawn", true)) {
|
if (NexusLobby.getInstance().getConfig().getBoolean("void_protection.teleport_to_spawn", true)) {
|
||||||
Location spawn = player.getWorld().getSpawnLocation();
|
Location spawn = player.getWorld().getSpawnLocation();
|
||||||
player.teleport(spawn);
|
player.teleport(spawn);
|
||||||
String msg = NexusLobby.getInstance().getConfig().getString("void_protection.message");
|
String msg = de.nexuslobby.utils.LangManager.get("void_protection_message");
|
||||||
if (msg != null && !msg.isEmpty()) {
|
if (msg != null && !msg.isEmpty()) {
|
||||||
player.sendMessage(msg.replace("&", "§"));
|
player.sendMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
192
src/main/resources/lang.yml
Normal file
192
src/main/resources/lang.yml
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
soccer_module_not_loaded:
|
||||||
|
de: "§cDas Fußball-Modul ist nicht geladen."
|
||||||
|
en: "§cThe soccer module is not loaded."
|
||||||
|
parkour_usage:
|
||||||
|
de: "§8[§6Nexus§8] §7Nutze: §e/nexus parkour <setstart|setfinish|setcheckpoint|reset|clear|removeall>"
|
||||||
|
en: "§8[§6Nexus§8] §7Usage: §e/nexus parkour <setstart|setfinish|setcheckpoint|reset|clear|removeall>"
|
||||||
|
parkour_run_aborted:
|
||||||
|
de: "§8[§6Nexus§8] §7Dein aktueller Lauf wurde abgebrochen."
|
||||||
|
en: "§8[§6Nexus§8] §7Your current run was aborted."
|
||||||
|
parkour_besttimes_cleared:
|
||||||
|
de: "§8[§6Nexus§8] §aAlle Parkour-Bestzeiten wurden gelöscht!"
|
||||||
|
en: "§8[§6Nexus§8] §aAll parkour best times have been cleared!"
|
||||||
|
parkour_track_removed:
|
||||||
|
de: "§8[§6Nexus§8] §cDie gesamte Strecke (Checkpoints & Ziel) wurde gelöscht!"
|
||||||
|
en: "§8[§6Nexus§8] §cThe entire track (checkpoints & finish) has been removed!"
|
||||||
|
unknown_subcommand:
|
||||||
|
de: "§cUnbekannter Unterbefehl."
|
||||||
|
en: "§cUnknown subcommand."
|
||||||
|
parkour_npc_marked:
|
||||||
|
de: "§8[§6Nexus§8] §aArmorStand als Parkour-NPC markiert!"
|
||||||
|
en: "§8[§6Nexus§8] §aArmorStand marked as parkour NPC!"
|
||||||
|
parkour_start_set:
|
||||||
|
de: "§8[§6Nexus§8] §aParkour-Startpunkt an deiner Position gesetzt!"
|
||||||
|
en: "§8[§6Nexus§8] §aParkour start set at your position!"
|
||||||
|
scoreboard_usage:
|
||||||
|
de: "§cBenutzung: /nexus sb <on|off|admin|spieler>"
|
||||||
|
en: "§cUsage: /nexus sb <on|off|admin|player>"
|
||||||
|
scoreboard_module_disabled:
|
||||||
|
de: "§cScoreboard-Modul ist deaktiviert."
|
||||||
|
en: "§cScoreboard module is disabled."
|
||||||
|
info_header:
|
||||||
|
de: "§8§m--------------------------------------"
|
||||||
|
en: "§8§m--------------------------------------"
|
||||||
|
info_title:
|
||||||
|
de: "§6§lNexusLobby §7- Informationen"
|
||||||
|
en: "§6§lNexusLobby §7- Information"
|
||||||
|
info_spawn:
|
||||||
|
de: "§f/spawn §7- Zum Spawn"
|
||||||
|
en: "§f/spawn §7- To spawn"
|
||||||
|
info_parkour:
|
||||||
|
de: "§f/setstart §8| §f/setcheckpoint §8| §f/setfinish"
|
||||||
|
en: "§f/setstart §8| §f/setcheckpoint §8| §f/setfinish"
|
||||||
|
info_removeall:
|
||||||
|
de: "§f/nexus parkour removeall §7- Strecke löschen"
|
||||||
|
en: "§f/nexus parkour removeall §7- Remove track"
|
||||||
|
info_ball:
|
||||||
|
de: "§f/nexus ball setspawn §7- Fußball Spawn setzen"
|
||||||
|
en: "§f/nexus ball setspawn §7- Set soccer spawn"
|
||||||
|
info_setspawn:
|
||||||
|
de: "§f/nexus setspawn §7- Spawn setzen"
|
||||||
|
en: "§f/nexus setspawn §7- Set spawn"
|
||||||
|
info_scoreboard:
|
||||||
|
de: "§f/nexus sb <on|off> §7- Scoreboard"
|
||||||
|
en: "§f/nexus sb <on|off> §7- Scoreboard"
|
||||||
|
info_reload:
|
||||||
|
de: "§f/nexus reload §7- Config laden"
|
||||||
|
en: "§f/nexus reload §7- Reload config"
|
||||||
|
info_footer:
|
||||||
|
de: "§8§m--------------------------------------"
|
||||||
|
en: "§8§m--------------------------------------"
|
||||||
|
parkour_trainer_greeting:
|
||||||
|
de: "§6§lTrainer §8» §aViel Erfolg beim Parkour! Gib dein Bestes!"
|
||||||
|
en: "§6§lTrainer §8» §aGood luck with the parkour! Give it your best!"
|
||||||
|
update_available:
|
||||||
|
de: "§8[§6Nexus§8] §aEin neues §6Update §afür §eNexusLobby §aist verfügbar!"
|
||||||
|
en: "§8[§6Nexus§8] §aA new §6update §afor §eNexusLobby §ais available!"
|
||||||
|
update_version:
|
||||||
|
de: "§8» §7Version: §c{old} §8-> §a{new}"
|
||||||
|
en: "§8» §7Version: §c{old} §8-> §a{new}"
|
||||||
|
update_download_link:
|
||||||
|
de: "§8» §6Klicke §e§l[HIER] §6zum Herunterladen."
|
||||||
|
en: "§8» §6Click §e§l[HERE] §6to download."
|
||||||
|
update_download_hover:
|
||||||
|
de: "§7Öffnet die Release-Seite"
|
||||||
|
en: "§7Opens the release page"
|
||||||
|
hider_all:
|
||||||
|
de: "§aAlle Spieler"
|
||||||
|
en: "§aAll players"
|
||||||
|
hider_none:
|
||||||
|
de: "§cKeine Spieler"
|
||||||
|
en: "§cNo players"
|
||||||
|
void_protection_message:
|
||||||
|
de: "§cDu wurdest vor dem Void gerettet!"
|
||||||
|
en: "§cYou were saved from the void!"
|
||||||
|
proxy_not_registered:
|
||||||
|
de: "§cProxy-Verbindung nicht möglich (BungeeCord Kanal nicht registriert)."
|
||||||
|
en: "§cProxy connection not possible (BungeeCord channel not registered)."
|
||||||
|
connecting_to_server:
|
||||||
|
de: "§eVerbinde zu: §f{server}"
|
||||||
|
en: "§eConnecting to: §f{server}"
|
||||||
|
server_connect_error:
|
||||||
|
de: "§cFehler beim Verbinden zum Server."
|
||||||
|
en: "§cError connecting to server."
|
||||||
|
proxy_connect_error:
|
||||||
|
de: "§cProxy-Verbindung nicht möglich."
|
||||||
|
en: "§cProxy connection not possible."
|
||||||
|
armorstand_lookat_required:
|
||||||
|
de: "§cDu musst einen ArmorStand direkt anschauen (Fadenkreuz)!"
|
||||||
|
en: "§cYou must look directly at an ArmorStand (crosshair)!"
|
||||||
|
conv_link_usage:
|
||||||
|
de: "§cNutze: /nexuscmd conv link <Dialog-ID>"
|
||||||
|
en: "§cUsage: /nexuscmd conv link <Dialog-ID>"
|
||||||
|
conv_mark_npcs:
|
||||||
|
de: "§cBitte markiere mindestens die ersten beiden NPCs (select1 & select2)!"
|
||||||
|
en: "§cPlease mark at least the first two NPCs (select1 & select2)!"
|
||||||
|
conv_link_created:
|
||||||
|
de: "§a§lDauerhafte Verknüpfung erstellt!"
|
||||||
|
en: "§a§lPermanent link created!"
|
||||||
|
conv_link_npcs:
|
||||||
|
de: "§7Beteiligte NPCs: §e{count}"
|
||||||
|
en: "§7Linked NPCs: §e{count}"
|
||||||
|
conv_speaker_not_found:
|
||||||
|
de: "§cFehler: Sprecher 1 nicht gefunden."
|
||||||
|
en: "§cError: Speaker 1 not found."
|
||||||
|
conv_unlink_lookat:
|
||||||
|
de: "§cSchau den NPC an, dessen Verknüpfung du lösen willst!"
|
||||||
|
en: "§cLook at the NPC you want to unlink!"
|
||||||
|
conv_unlinked:
|
||||||
|
de: "§eNPC-Verknüpfung wurde aufgehoben."
|
||||||
|
en: "§eNPC link has been removed."
|
||||||
|
conv_start_usage:
|
||||||
|
de: "§cNutze: /nexuscmd conv start <ID>"
|
||||||
|
en: "§cUsage: /nexuscmd conv start <ID>"
|
||||||
|
conv_mark_two_npcs:
|
||||||
|
de: "§cBitte markiere mindestens zwei NPCs!"
|
||||||
|
en: "§cPlease mark at least two NPCs!"
|
||||||
|
npc_bubble_sent:
|
||||||
|
de: "§aNPC-Sprechblase gesendet."
|
||||||
|
en: "§aNPC speech bubble sent."
|
||||||
|
lookat_off:
|
||||||
|
de: "§cBlickkontakt aus."
|
||||||
|
en: "§cLook-at disabled."
|
||||||
|
lookat_on:
|
||||||
|
de: "§aBlickkontakt an."
|
||||||
|
en: "§aLook-at enabled."
|
||||||
|
name_removed:
|
||||||
|
de: "§eName entfernt."
|
||||||
|
en: "§eName removed."
|
||||||
|
name_set:
|
||||||
|
de: "§7Name gesetzt: {name}"
|
||||||
|
en: "§7Name set: {name}"
|
||||||
|
status_backup_saved:
|
||||||
|
de: "§8(Status-Backup wurde gespeichert)"
|
||||||
|
en: "§8(Status backup saved)"
|
||||||
|
command_bound:
|
||||||
|
de: "§aBefehl gebunden."
|
||||||
|
en: "§aCommand bound."
|
||||||
|
no_target:
|
||||||
|
de: "§cKein Ziel!"
|
||||||
|
en: "§cNo target!"
|
||||||
|
commands_and_tags:
|
||||||
|
de: "§6§lBefehle & Tags:"
|
||||||
|
en: "§6§lCommands & Tags:"
|
||||||
|
commands_removed:
|
||||||
|
de: "§eAlle Befehle gelöscht."
|
||||||
|
en: "§eAll commands removed."
|
||||||
|
welcome:
|
||||||
|
de: "Willkommen auf dem Server!"
|
||||||
|
en: "Welcome to the server!"
|
||||||
|
no_permission:
|
||||||
|
de: "§cKeine Berechtigung."
|
||||||
|
en: "§cNo permission."
|
||||||
|
only_player:
|
||||||
|
de: "§cDieser Befehl ist nur für Spieler!"
|
||||||
|
en: "§cThis command is for players only!"
|
||||||
|
parkour_checkpoint_set:
|
||||||
|
de: "§8[§6Nexus§8] §aParkour-Checkpoint gesetzt!"
|
||||||
|
en: "§8[§6Nexus§8] §aParkour checkpoint set!"
|
||||||
|
parkour_finish_set:
|
||||||
|
de: "§8[§6Nexus§8] §aParkour-Zielpunkt gesetzt!"
|
||||||
|
en: "§8[§6Nexus§8] §aParkour finish set!"
|
||||||
|
teleport_spawn:
|
||||||
|
de: "§8[§6Nexus§8] §aDu wurdest zum Spawn teleportiert."
|
||||||
|
en: "§8[§6Nexus§8] §aYou have been teleported to spawn."
|
||||||
|
spawn_world_missing:
|
||||||
|
de: "§cFehler: Die Spawn-Welt existiert nicht."
|
||||||
|
en: "§cError: The spawn world does not exist."
|
||||||
|
spawn_not_set:
|
||||||
|
de: "§cEs wurde noch kein Spawn gesetzt."
|
||||||
|
en: "§cNo spawn has been set yet."
|
||||||
|
plugin_reloaded:
|
||||||
|
de: "§8[§6Nexus§8] §aPlugin erfolgreich neu geladen!"
|
||||||
|
en: "§8[§6Nexus§8] §aPlugin successfully reloaded!"
|
||||||
|
spawn_set:
|
||||||
|
de: "§8[§6Nexus§8] §aLobby-Spawn erfolgreich gesetzt!"
|
||||||
|
en: "§8[§6Nexus§8] §aLobby spawn set successfully!"
|
||||||
|
silentjoin_on:
|
||||||
|
de: "§8[§6Nexus§8] §7Silent Join: §aAktiviert"
|
||||||
|
en: "§8[§6Nexus§8] §7Silent Join: §aEnabled"
|
||||||
|
silentjoin_off:
|
||||||
|
de: "§8[§6Nexus§8] §7Silent Join: §cDeaktiviert"
|
||||||
|
en: "§8[§6Nexus§8] §7Silent Join: §cDisabled"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
name: NexusLobby
|
name: NexusLobby
|
||||||
main: de.nexuslobby.NexusLobby
|
main: de.nexuslobby.NexusLobby
|
||||||
version: "1.1.0"
|
version: "1.1.1"
|
||||||
api-version: "1.21"
|
api-version: "1.21"
|
||||||
author: M_Viper
|
author: M_Viper
|
||||||
description: Modular Lobby Plugin with an invisible Particle-Parkour system.
|
description: Modular Lobby Plugin with an invisible Particle-Parkour system.
|
||||||
@@ -125,6 +125,18 @@ permissions:
|
|||||||
nexuslobby.silentjoin:
|
nexuslobby.silentjoin:
|
||||||
description: Versteckt die Join-Nachricht für den Spieler (Silent Join)
|
description: Versteckt die Join-Nachricht für den Spieler (Silent Join)
|
||||||
default: op
|
default: op
|
||||||
|
nexuslobby.join.maintenance:
|
||||||
|
description: Darf den Server trotz Wartungsmodus betreten
|
||||||
|
default: op
|
||||||
|
nexuslobby.security.bypass:
|
||||||
|
description: Umgeht den Security-Check (VPN/Country)
|
||||||
|
default: op
|
||||||
|
nexuslobby.scoreboard.admin:
|
||||||
|
description: Darf das Scoreboard im Admin-Modus nutzen
|
||||||
|
default: op
|
||||||
|
nexuslobby.border.bypass:
|
||||||
|
description: Umgeht die Lobby-Grenze
|
||||||
|
default: op
|
||||||
nexuslobby.parkour.admin:
|
nexuslobby.parkour.admin:
|
||||||
description: Erlaubt das Setzen der unsichtbaren Parkour-Punkte (Start, Ziel, Checkpoints)
|
description: Erlaubt das Setzen der unsichtbaren Parkour-Punkte (Start, Ziel, Checkpoints)
|
||||||
default: op
|
default: op
|
||||||
Reference in New Issue
Block a user