Update from Git Manager GUI
This commit is contained in:
@@ -15,6 +15,8 @@ public class Arena implements ConfigurationSerializable {
|
||||
private Location fieldMin, fieldMax;
|
||||
// Strafräume – optional manuell gesetzt; sonst auto-berechnet aus Tor + config
|
||||
private Location redPenaltyMin, redPenaltyMax, bluePenaltyMin, bluePenaltyMax;
|
||||
// Elfmeter-Punkte (optional – sonst wird ballSpawn genutzt)
|
||||
private Location redPenaltySpot, bluePenaltySpot;
|
||||
private int minPlayers, maxPlayers, gameDuration;
|
||||
|
||||
/**
|
||||
@@ -255,6 +257,8 @@ public class Arena implements ConfigurationSerializable {
|
||||
if (redPenaltyMax != null) map.put("redPenaltyMax", serLoc(redPenaltyMax));
|
||||
if (bluePenaltyMin != null) map.put("bluePenaltyMin", serLoc(bluePenaltyMin));
|
||||
if (bluePenaltyMax != null) map.put("bluePenaltyMax", serLoc(bluePenaltyMax));
|
||||
if (redPenaltySpot != null) map.put("redPenaltySpot", serLoc(redPenaltySpot));
|
||||
if (bluePenaltySpot != null) map.put("bluePenaltySpot", serLoc(bluePenaltySpot));
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -283,6 +287,8 @@ public class Arena implements ConfigurationSerializable {
|
||||
if (map.containsKey("redPenaltyMax")) a.redPenaltyMax = desLoc(map.get("redPenaltyMax"));
|
||||
if (map.containsKey("bluePenaltyMin")) a.bluePenaltyMin = desLoc(map.get("bluePenaltyMin"));
|
||||
if (map.containsKey("bluePenaltyMax")) a.bluePenaltyMax = desLoc(map.get("bluePenaltyMax"));
|
||||
if (map.containsKey("redPenaltySpot")) a.redPenaltySpot = desLoc(map.get("redPenaltySpot"));
|
||||
if (map.containsKey("bluePenaltySpot")) a.bluePenaltySpot = desLoc(map.get("bluePenaltySpot"));
|
||||
return a;
|
||||
}
|
||||
|
||||
@@ -338,7 +344,25 @@ public class Arena implements ConfigurationSerializable {
|
||||
public void setBluePenaltyMin(Location l) { this.bluePenaltyMin = l; }
|
||||
public Location getBluePenaltyMax() { return bluePenaltyMax; }
|
||||
public void setBluePenaltyMax(Location l) { this.bluePenaltyMax = l; }
|
||||
public boolean hasManualpPenaltyAreas() { return redPenaltyMin != null && redPenaltyMax != null
|
||||
|
||||
// ── Elfmeter-Punkte ──────────────────────────────────────────────────────
|
||||
public Location getRedPenaltySpot() { return redPenaltySpot; }
|
||||
public void setRedPenaltySpot(Location l) { this.redPenaltySpot = l; }
|
||||
public Location getBluePenaltySpot() { return bluePenaltySpot; }
|
||||
public void setBluePenaltySpot(Location l) { this.bluePenaltySpot = l; }
|
||||
|
||||
/**
|
||||
* Gibt den Elfmeter-Punkt für ein Team zurück.
|
||||
* Falls nicht gesetzt, wird ballSpawn als Fallback verwendet.
|
||||
*/
|
||||
public Location getPenaltySpot(de.fussball.plugin.game.Team team) {
|
||||
if (team == de.fussball.plugin.game.Team.RED) {
|
||||
return redPenaltySpot != null ? redPenaltySpot : ballSpawn;
|
||||
} else {
|
||||
return bluePenaltySpot != null ? bluePenaltySpot : ballSpawn;
|
||||
}
|
||||
}
|
||||
public boolean hasManualPenaltyAreas() { return redPenaltyMin != null && redPenaltyMax != null
|
||||
&& bluePenaltyMin != null && bluePenaltyMax != null; }
|
||||
public int getMinPlayers() { return minPlayers; }
|
||||
public void setMinPlayers(int n) { this.minPlayers = n; }
|
||||
|
||||
Reference in New Issue
Block a user