From 836745d8058bebe56155e7c9381fc183fcdc0444 Mon Sep 17 00:00:00 2001 From: M_Viper Date: Sun, 21 Jun 2026 18:43:07 +0000 Subject: [PATCH] Delete src/main/java/de/lasertag/arena/Arena.java via Git Manager GUI --- src/main/java/de/lasertag/arena/Arena.java | 153 --------------------- 1 file changed, 153 deletions(-) delete mode 100644 src/main/java/de/lasertag/arena/Arena.java diff --git a/src/main/java/de/lasertag/arena/Arena.java b/src/main/java/de/lasertag/arena/Arena.java deleted file mode 100644 index 1a448cb..0000000 --- a/src/main/java/de/lasertag/arena/Arena.java +++ /dev/null @@ -1,153 +0,0 @@ -package de.lasertag.arena; - -import de.lasertag.game.Team; -import org.bukkit.Location; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Repräsentiert eine konfigurierte Lasertag-Arena. - * - * Jedes Team braucht: - * - mind. 1 Spawn-Punkt - * - 1 Basispunkt (Regenerationspunkt + angreifbarer Block) - */ -public class Arena { - - private final String name; - private String displayName; - private boolean enabled; - - // Team-Spawns: team -> Liste von Spawn-Locations - private final Map> teamSpawns = new HashMap<>(); - - // Team-Basis: team -> Location des Basis-Blocks - private final Map teamBases = new HashMap<>(); - - // Team-Basis-Gesundheit (wie oft kann Basis angegriffen werden) - private final Map baseHealth = new HashMap<>(); - - // Lobby dieser Arena (optionaler Wartebereich) - private Location lobbyLocation; - - // Bounds (optional, für Block-Schutz innerhalb der Arena) - private Location corner1; - private Location corner2; - - public Arena(String name) { - this.name = name; - this.displayName = name; - this.enabled = false; - for (Team t : Team.values()) { - teamSpawns.put(t, new ArrayList<>()); - } - } - - // ─── Validation ────────────────────────────────────────────────────────── - - /** - * Arena ist bereit wenn jedes Team mindestens 1 Spawn und 1 Basis hat. - */ - public boolean isReady() { - for (Team t : Team.values()) { - if (teamSpawns.get(t).isEmpty()) return false; - if (!teamBases.containsKey(t)) return false; - } - return true; - } - - public String getMissingSetup() { - StringBuilder sb = new StringBuilder(); - for (Team t : Team.values()) { - if (teamSpawns.get(t).isEmpty()) - sb.append("§c- Kein Spawn für Team ").append(t.colored()).append("§c!\n"); - if (!teamBases.containsKey(t)) - sb.append("§c- Keine Basis für Team ").append(t.colored()).append("§c!\n"); - } - return sb.length() == 0 ? "§aArena bereit!" : sb.toString().trim(); - } - - // ─── Spawns ────────────────────────────────────────────────────────────── - - public void addSpawn(Team team, Location loc) { - teamSpawns.get(team).add(loc.clone()); - } - - public List getSpawns(Team team) { - return teamSpawns.get(team); - } - - public Location getRandomSpawn(Team team) { - List spawns = teamSpawns.get(team); - if (spawns.isEmpty()) return null; - return spawns.get((int)(Math.random() * spawns.size())).clone(); - } - - // ─── Bases ─────────────────────────────────────────────────────────────── - - public void setBase(Team team, Location loc) { - teamBases.put(team, loc.clone()); - } - - public Location getBase(Team team) { - return teamBases.get(team); - } - - public boolean hasBase(Team team) { - return teamBases.containsKey(team); - } - - /** Liefert das Team dessen Basis an der gegebenen Location steht, oder null. */ - public Team getBaseTeam(Location loc) { - for (Map.Entry e : teamBases.entrySet()) { - Location base = e.getValue(); - if (base.getWorld().equals(loc.getWorld()) - && base.getBlockX() == loc.getBlockX() - && base.getBlockY() == loc.getBlockY() - && base.getBlockZ() == loc.getBlockZ()) { - return e.getKey(); - } - } - return null; - } - - // ─── Base Health ───────────────────────────────────────────────────────── - - public void initBaseHealth(int maxHealth) { - for (Team t : Team.values()) baseHealth.put(t, maxHealth); - } - - public int getBaseHealth(Team team) { - return baseHealth.getOrDefault(team, 0); - } - - public boolean damageBase(Team team) { - int hp = baseHealth.getOrDefault(team, 0); - if (hp <= 0) return false; - baseHealth.put(team, hp - 1); - return true; - } - - public boolean isBaseDestroyed(Team team) { - return baseHealth.getOrDefault(team, 0) <= 0; - } - - // ─── Getters / Setters ─────────────────────────────────────────────────── - - public String getName() { return name; } - public String getDisplayName() { return displayName; } - public void setDisplayName(String n) { this.displayName = n; } - public boolean isEnabled() { return enabled; } - public void setEnabled(boolean e) { this.enabled = e; } - public Location getLobbyLocation() { return lobbyLocation; } - public void setLobbyLocation(Location l) { this.lobbyLocation = l != null ? l.clone() : null; } - public Location getCorner1() { return corner1; } - public void setCorner1(Location l) { this.corner1 = l != null ? l.clone() : null; } - public Location getCorner2() { return corner2; } - public void setCorner2(Location l) { this.corner2 = l != null ? l.clone() : null; } - public Map> getAllSpawns() { return teamSpawns; } - public Map getAllBases() { return teamBases; } -}