Update from Git Manager GUI
This commit is contained in:
@@ -281,9 +281,9 @@ public class FussballCommand implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
|
||||
// ── Hologramm-Verwaltung ─────────────────────────────────────────
|
||||
// /fb hologram set <id> goals|wins|match – Hologramm erstellen
|
||||
// /fb hologram set <arena> goals|wins|match – Hologramm erstellen/verschieben
|
||||
// /fb hologram remove – Nächstes Hologramm (< 5 Blöcke) entfernen
|
||||
// /fb hologram delete <id> – Hologramm nach ID löschen
|
||||
// /fb hologram delete <arena> goals|wins|match – Hologramm gezielt löschen
|
||||
// /fb hologram reload – Alle Hologramme neu spawnen
|
||||
// /fb hologram list – Alle Hologramme anzeigen
|
||||
case "hologram", "holo" -> {
|
||||
@@ -291,9 +291,9 @@ public class FussballCommand implements CommandExecutor, TabCompleter {
|
||||
if (!(sender instanceof Player player)) { sender.sendMessage("Nur für Spieler!"); return true; }
|
||||
if (args.length < 2) {
|
||||
player.sendMessage(MessageUtil.header("Hologramm-Befehle"));
|
||||
player.sendMessage("§e/fb hologram set <id> goals|wins|match §7– Hologramm setzen");
|
||||
player.sendMessage("§e/fb hologram set <arena> goals|wins|match §7– Hologramm setzen");
|
||||
player.sendMessage("§e/fb hologram remove §7– Nächstes entfernen (< 5 Blöcke)");
|
||||
player.sendMessage("§e/fb hologram delete <id> §7– Nach ID löschen");
|
||||
player.sendMessage("§e/fb hologram delete <arena> goals|wins|match §7– Gezielt löschen");
|
||||
player.sendMessage("§e/fb hologram reload §7– Alle neu laden");
|
||||
player.sendMessage("§e/fb hologram list §7– Alle anzeigen");
|
||||
player.sendMessage("§7Gesamt: §e" + plugin.getHologramManager().getCount() + " §7Hologramme");
|
||||
@@ -303,22 +303,26 @@ public class FussballCommand implements CommandExecutor, TabCompleter {
|
||||
switch (args[1].toLowerCase()) {
|
||||
case "set" -> {
|
||||
if (args.length < 4) {
|
||||
player.sendMessage(MessageUtil.error("Benutze: /fb hologram set <id> goals|wins|match"));
|
||||
player.sendMessage(MessageUtil.error("Benutze: /fb hologram set <arena> goals|wins|match"));
|
||||
return true;
|
||||
}
|
||||
Arena arena = plugin.getArenaManager().getArena(args[2]);
|
||||
if (arena == null) {
|
||||
player.sendMessage(MessageUtil.error("Arena §e" + args[2] + " §cnicht gefunden!"));
|
||||
return true;
|
||||
}
|
||||
String id = args[2];
|
||||
FussballHologram.HoloType type = switch (args[3].toLowerCase()) {
|
||||
case "wins", "siege" -> FussballHologram.HoloType.WINS;
|
||||
case "match", "live", "game" -> FussballHologram.HoloType.MATCH;
|
||||
default -> FussballHologram.HoloType.GOALS;
|
||||
};
|
||||
plugin.getHologramManager().createHologram(id, player.getLocation(), type);
|
||||
String holoLabel = switch (type) {
|
||||
case WINS -> "Top-10-Siege";
|
||||
case MATCH -> "Live-Match";
|
||||
default -> "Top-10-Tore";
|
||||
};
|
||||
player.sendMessage(MessageUtil.success("§e" + id + " §a(" + holoLabel + ") Hologramm gesetzt!"));
|
||||
String id = buildHologramId(arena.getName(), type);
|
||||
plugin.getHologramManager().removeHologram(id);
|
||||
if (!plugin.getHologramManager().createHologram(id, player.getLocation(), type)) {
|
||||
player.sendMessage(MessageUtil.error("Konnte das Hologramm für Arena §e" + arena.getName() + " §cund Typ §e" + hologramTypeName(type) + " §cnicht setzen."));
|
||||
return true;
|
||||
}
|
||||
player.sendMessage(MessageUtil.success("Hologramm §e" + hologramTypeName(type) + " §afür Arena §e" + arena.getName() + " §agesetzt!"));
|
||||
if (type == FussballHologram.HoloType.MATCH) {
|
||||
player.sendMessage("§7§oLive-Match-Hologramm aktualisiert sich automatisch bei Toren und Nachspielzeit.");
|
||||
} else {
|
||||
@@ -334,9 +338,28 @@ public class FussballCommand implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
}
|
||||
case "delete" -> {
|
||||
if (args.length < 3) { player.sendMessage(MessageUtil.error("Benutze: /fb hologram delete <id>")); return true; }
|
||||
if (args.length >= 4) {
|
||||
Arena arena = plugin.getArenaManager().getArena(args[2]);
|
||||
if (arena == null) {
|
||||
player.sendMessage(MessageUtil.error("Arena §e" + args[2] + " §cnicht gefunden!"));
|
||||
return true;
|
||||
}
|
||||
FussballHologram.HoloType type = switch (args[3].toLowerCase()) {
|
||||
case "wins", "siege" -> FussballHologram.HoloType.WINS;
|
||||
case "match", "live", "game" -> FussballHologram.HoloType.MATCH;
|
||||
default -> FussballHologram.HoloType.GOALS;
|
||||
};
|
||||
String id = buildHologramId(arena.getName(), type);
|
||||
if (plugin.getHologramManager().removeHologram(id)) {
|
||||
player.sendMessage(MessageUtil.success("Hologramm §e" + hologramTypeName(type) + " §ader Arena §e" + arena.getName() + " §agelöscht!"));
|
||||
} else {
|
||||
player.sendMessage(MessageUtil.error("Kein Hologramm vom Typ §e" + hologramTypeName(type) + " §cfür Arena §e" + arena.getName() + " §cgefunden!"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (args.length < 3) { player.sendMessage(MessageUtil.error("Benutze: /fb hologram delete <arena> goals|wins|match")); return true; }
|
||||
if (plugin.getHologramManager().removeHologram(args[2])) {
|
||||
player.sendMessage(MessageUtil.success("Hologramm §e" + args[2] + " §agelöscht!"));
|
||||
player.sendMessage(MessageUtil.success("Legacy-Hologramm §e" + args[2] + " §agelöscht!"));
|
||||
} else {
|
||||
player.sendMessage(MessageUtil.error("Kein Hologramm mit ID §e" + args[2] + "§c gefunden!"));
|
||||
}
|
||||
@@ -351,11 +374,11 @@ public class FussballCommand implements CommandExecutor, TabCompleter {
|
||||
player.sendMessage(MessageUtil.warn("Keine Hologramme vorhanden."));
|
||||
} else {
|
||||
for (String id : plugin.getHologramManager().getHologramIds()) {
|
||||
player.sendMessage("§7 • §e" + id);
|
||||
player.sendMessage("§7 • §e" + formatHologramDisplay(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
default -> player.sendMessage(MessageUtil.error("Gültig: set <id> goals|wins|match | remove | delete <id> | reload | list"));
|
||||
default -> player.sendMessage(MessageUtil.error("Gültig: set <arena> goals|wins|match | remove | delete <arena> goals|wins|match | reload | list"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,7 +517,7 @@ public class FussballCommand implements CommandExecutor, TabCompleter {
|
||||
s.sendMessage("§e/fb history [n] §7- Letzte Spiele anzeigen");
|
||||
if (s.hasPermission("fussball.admin")) {
|
||||
s.sendMessage("§c§lAdmin: §ccreate / delete / setup / stop / debug / dropball");
|
||||
s.sendMessage("§c§lAdmin: §chologram set goals|wins|match / remove / reload");
|
||||
s.sendMessage("§c§lAdmin: §chologram set <arena> goals|wins|match / remove / reload");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,6 +535,25 @@ public class FussballCommand implements CommandExecutor, TabCompleter {
|
||||
private String yn(boolean b) { return b ? "§aJA" : "§cNEIN"; }
|
||||
private String locStr(Location l) { return fmt(l.getX()) + " / " + fmt(l.getY()) + " / " + fmt(l.getZ()); }
|
||||
private String fmt(double d) { return String.format("%.1f", d); }
|
||||
private String buildHologramId(String arenaName, FussballHologram.HoloType type) { return arenaName.toLowerCase() + "_" + hologramTypeName(type); }
|
||||
private String hologramTypeName(FussballHologram.HoloType type) {
|
||||
return switch (type) {
|
||||
case WINS -> "wins";
|
||||
case MATCH -> "match";
|
||||
default -> "goals";
|
||||
};
|
||||
}
|
||||
private String formatHologramDisplay(String id) {
|
||||
int split = id.lastIndexOf('_');
|
||||
if (split > 0 && split < id.length() - 1) {
|
||||
String arena = id.substring(0, split);
|
||||
String type = id.substring(split + 1);
|
||||
if (type.equals("goals") || type.equals("wins") || type.equals("match")) {
|
||||
return arena + " §7→ §e" + type;
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
// ── Tab-Completion ───────────────────────────────────────────────────────
|
||||
|
||||
@@ -526,11 +568,13 @@ public class FussballCommand implements CommandExecutor, TabCompleter {
|
||||
} else if (args.length == 2 && args[0].equalsIgnoreCase("hologram")) {
|
||||
list.addAll(List.of("set", "remove", "delete", "reload", "list"));
|
||||
} else if (args.length == 3 && args[0].equalsIgnoreCase("hologram") && args[1].equalsIgnoreCase("set")) {
|
||||
list.addAll(plugin.getArenaManager().getArenaNames()); // id-Vorschläge (frei wählbar, aber arena-namen passen)
|
||||
list.addAll(plugin.getArenaManager().getArenaNames());
|
||||
} else if (args.length == 4 && args[0].equalsIgnoreCase("hologram") && args[1].equalsIgnoreCase("set")) {
|
||||
list.addAll(List.of("goals", "wins", "match"));
|
||||
} else if (args.length == 3 && args[0].equalsIgnoreCase("hologram") && args[1].equalsIgnoreCase("delete")) {
|
||||
list.addAll(plugin.getHologramManager().getHologramIds());
|
||||
list.addAll(plugin.getArenaManager().getArenaNames());
|
||||
} else if (args.length == 4 && args[0].equalsIgnoreCase("hologram") && args[1].equalsIgnoreCase("delete")) {
|
||||
list.addAll(List.of("goals", "wins", "match"));
|
||||
} else if (args.length == 3 && args[0].equalsIgnoreCase("setgk")) {
|
||||
// Spielernamen aus dem aktiven Spiel vorschlagen
|
||||
Game gkGame = plugin.getGameManager().getGame(args[1]);
|
||||
|
||||
Reference in New Issue
Block a user