Hopefully made arenas with generators?

This commit is contained in:
Luca 2021-11-23 10:57:52 +01:00
parent 5e63d85468
commit 03512ae139
15 changed files with 225 additions and 157 deletions

View File

@ -114,8 +114,8 @@ public class ArenaCommand implements CommandExecutor {
new SetBuildMaxCommand().executeAs(sender, cmd, label, args);
break;
case "setplayergenerator":
new SetPlayerGeneratorCommand().executeAs(sender, cmd, label, args);
case "setteamgenerator":
new SetTeamGeneratorCommand().executeAs(sender, cmd, label, args);
break;
case "setdiamondgenerator":
@ -153,9 +153,6 @@ public class ArenaCommand implements CommandExecutor {
case "generate":
new GenerateCommand().executeAs(sender, cmd, label, args);
break;
case "generator":
new GeneratorCommand().executeAs(sender, cmd, label, args);
break;
}
}

View File

@ -1,15 +1,16 @@
package rip.tilly.bedwars.commands.arena;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import rip.tilly.bedwars.BedWars;
import rip.tilly.bedwars.commands.BaseCommand;
import rip.tilly.bedwars.game.arena.Arena;
import rip.tilly.bedwars.generators.Generator;
import rip.tilly.bedwars.generators.GeneratorType;
import rip.tilly.bedwars.utils.CC;
import rip.tilly.bedwars.utils.CustomLocation;
import java.util.ArrayList;
import java.util.List;
@ -27,14 +28,18 @@ public class SetDiamondGeneratorCommand extends BaseCommand {
if (arena != null) {
Location location = player.getLocation();
Generator diamondGenerator;
// Generator diamondGenerator;
diamondGenerator = new Generator(location, GeneratorType.DIAMOND, false);
diamondGenerator.setActivated(true);
diamondGenerator.spawn();
// diamondGenerator = new Generator(location, GeneratorType.DIAMOND, false);
// diamondGenerator.setActivated(true);
// diamondGenerator.spawn();
// arena.getDiamondGenerators().add(diamondGenerator);
player.sendMessage(CC.translate("&aSuccessfully set the diamond generator for the arena called &a&l" + args[1]));
player.sendMessage(ChatColor.GREEN + "Successfully set the generator point #" + this.main.getArenaManager().getArena(arena.getName()).getDiamondGenerators().size() + ".");
arena.getDiamondGenerators().add(CustomLocation.fromBukkitLocation(location));
this.saveStringsGenerators(arena);
// player.sendMessage(CC.translate("&aSuccessfully set the diamond generator for the arena called &a&l" + args[1]));
} else {
player.sendMessage(CC.translate("&cThis arena does not already exist"));
}
@ -46,4 +51,10 @@ public class SetDiamondGeneratorCommand extends BaseCommand {
return tabCompletions;
}
private void saveStringsGenerators(Arena arena) {
FileConfiguration config = this.main.getArenasConfig().getConfig();
config.set("arenas." + arena.getName() + ".diamond-generators", this.main.getArenaManager().fromLocations(arena.getDiamondGenerators()));
this.main.getArenasConfig().save();
}
}

View File

@ -1,15 +1,16 @@
package rip.tilly.bedwars.commands.arena;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import rip.tilly.bedwars.BedWars;
import rip.tilly.bedwars.commands.BaseCommand;
import rip.tilly.bedwars.game.arena.Arena;
import rip.tilly.bedwars.generators.Generator;
import rip.tilly.bedwars.generators.GeneratorType;
import rip.tilly.bedwars.utils.CC;
import rip.tilly.bedwars.utils.CustomLocation;
import java.util.ArrayList;
import java.util.List;
@ -27,13 +28,17 @@ public class SetEmeraldGeneratorCommand extends BaseCommand {
if (arena != null) {
Location location = player.getLocation();
Generator emeraldGenerator;
// Generator emeraldGenerator;
emeraldGenerator = new Generator(location, GeneratorType.EMERALD, false);
emeraldGenerator.spawn();
// emeraldGenerator = new Generator(location, GeneratorType.EMERALD, false);
// emeraldGenerator.spawn();
// arena.getEmeraldGenerators().add(emeraldGenerator);
player.sendMessage(CC.translate("&aSuccessfully set the emerald generator for the arena called &a&l" + args[1]));
// player.sendMessage(CC.translate("&aSuccessfully set the emerald generator for the arena called &a&l" + args[1]));
player.sendMessage(ChatColor.GREEN + "Successfully set the generator point #" + this.main.getArenaManager().getArena(arena.getName()).getEmeraldGenerators().size() + ".");
arena.getEmeraldGenerators().add(CustomLocation.fromBukkitLocation(location));
this.saveStringsGenerators(arena);
} else {
player.sendMessage(CC.translate("&cThis arena does not already exist"));
}
@ -45,4 +50,10 @@ public class SetEmeraldGeneratorCommand extends BaseCommand {
return tabCompletions;
}
private void saveStringsGenerators(Arena arena) {
FileConfiguration config = this.main.getArenasConfig().getConfig();
config.set("arenas." + arena.getName() + ".emerald-generators", this.main.getArenaManager().fromLocations(arena.getEmeraldGenerators()));
this.main.getArenasConfig().save();
}
}

View File

@ -1,57 +0,0 @@
package rip.tilly.bedwars.commands.arena;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import rip.tilly.bedwars.BedWars;
import rip.tilly.bedwars.commands.BaseCommand;
import rip.tilly.bedwars.game.arena.Arena;
import rip.tilly.bedwars.generators.Generator;
import rip.tilly.bedwars.generators.GeneratorType;
import rip.tilly.bedwars.utils.CC;
import rip.tilly.bedwars.utils.CustomLocation;
import java.util.ArrayList;
import java.util.List;
public class SetPlayerGeneratorCommand extends BaseCommand {
private BedWars main = BedWars.getInstance();
@Override
public void executeAs(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
Arena arena = this.main.getArenaManager().getArena(args[1]);
if (arena != null) {
Location location = player.getLocation();
Generator playerGenerator;
playerGenerator = new Generator(location, GeneratorType.IRON, true);
// arena.getPlayerGenerators().add(playerGenerator);
playerGenerator = new Generator(location, GeneratorType.GOLD, true);
// arena.getPlayerGenerators().add(playerGenerator);
playerGenerator = new Generator(location, GeneratorType.EMERALD, true);
// arena.getPlayerGenerators().add(playerGenerator);
player.sendMessage(CC.translate("&aSuccessfully set the player's generator for the arena called &a&l" + args[1]));
} else {
player.sendMessage(CC.translate("&cThis arena does not already exist"));
}
}
@Override
public List<String> getTabCompletions(CommandSender sender, Command cmd, String label, String[] args) {
List<String> tabCompletions = new ArrayList<String>();
return tabCompletions;
}
}

View File

@ -10,11 +10,12 @@ import rip.tilly.bedwars.BedWars;
import rip.tilly.bedwars.commands.BaseCommand;
import rip.tilly.bedwars.game.arena.Arena;
import rip.tilly.bedwars.utils.CC;
import rip.tilly.bedwars.utils.CustomLocation;
import java.util.ArrayList;
import java.util.List;
public class GeneratorCommand extends BaseCommand {
public class SetTeamGeneratorCommand extends BaseCommand {
private BedWars main = BedWars.getInstance();
@ -26,7 +27,25 @@ public class GeneratorCommand extends BaseCommand {
if (arena != null) {
Location location = player.getLocation();
player.sendMessage(ChatColor.GREEN + "Successfully set the generator point #" + this.main.getArenaManager().getArena(arena.getName()).getGenerators().size() + ".");
// Generator playerGenerator;
// playerGenerator = new Generator(location, GeneratorType.IRON, true);
// arena.getPlayerGenerators().add(playerGenerator);
// playerGenerator = new Generator(location, GeneratorType.GOLD, true);
// arena.getPlayerGenerators().add(playerGenerator);
// playerGenerator = new Generator(location, GeneratorType.EMERALD, true);
// arena.getPlayerGenerators().add(playerGenerator);
// player.sendMessage(CC.translate("&aSuccessfully set the player's generator for the arena called &a&l" + args[1]));
player.sendMessage(ChatColor.GREEN + "Successfully set the generator point #" + this.main.getArenaManager().getArena(arena.getName()).getTeamGenerators().size() + ".");
arena.getTeamGenerators().add(CustomLocation.fromBukkitLocation(location));
this.saveStringsGenerators(arena);
} else {
player.sendMessage(CC.translate("&cThis arena does not already exist"));
@ -42,7 +61,7 @@ public class GeneratorCommand extends BaseCommand {
private void saveStringsGenerators(Arena arena) {
FileConfiguration config = this.main.getArenasConfig().getConfig();
config.set("arenas." + arena.getName() + ".generators", this.main.getArenaManager().fromLocations(arena.getGenerators()));
config.set("arenas." + arena.getName() + ".team-generators", this.main.getArenaManager().fromLocations(arena.getTeamGenerators()));
this.main.getArenasConfig().save();
}
}

View File

@ -13,6 +13,7 @@ import org.github.paperspigot.Title;
import rip.tilly.bedwars.BedWars;
import rip.tilly.bedwars.game.arena.Arena;
import rip.tilly.bedwars.game.arena.CopiedArena;
import rip.tilly.bedwars.generators.Generator;
import rip.tilly.bedwars.utils.CC;
import rip.tilly.bedwars.utils.TimeUtils;
@ -42,6 +43,8 @@ public class Game {
private int durationTimer;
private int winningTeamId;
private List<Generator> activatedGenerators = new ArrayList<>();
public Game(Arena arena, GameType gameType, GameTeam... teams) {
this.arena = arena;
this.gameType = gameType;

View File

@ -4,7 +4,6 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import rip.tilly.bedwars.generators.Generator;
import rip.tilly.bedwars.utils.CustomLocation;
import java.util.ArrayList;
@ -39,6 +38,10 @@ public class Arena {
private int deadZone;
private int buildMax;
private List<CustomLocation> teamGenerators = new ArrayList<>();
private List<CustomLocation> diamondGenerators = new ArrayList<>();
private List<CustomLocation> emeraldGenerators = new ArrayList<>();
private boolean enabled;
public CopiedArena getAvailableArena() {

View File

@ -27,5 +27,8 @@ public class CopiedArena {
private CustomLocation teamBmin;
private CustomLocation teamBmax;
private List<CustomLocation> generators = new ArrayList<>();
private List<CustomLocation> teamGenerators = new ArrayList<>();
private List<CustomLocation> diamondGenerators = new ArrayList<>();
private List<CustomLocation> emeraldGenerators = new ArrayList<>();
}

View File

@ -8,6 +8,7 @@ import rip.tilly.bedwars.events.GameEndEvent;
import rip.tilly.bedwars.game.Game;
import rip.tilly.bedwars.game.GameState;
import rip.tilly.bedwars.game.GameTeam;
import rip.tilly.bedwars.generators.Generator;
import rip.tilly.bedwars.playerdata.PlayerData;
import rip.tilly.bedwars.utils.CC;
import rip.tilly.bedwars.utils.PlayerUtil;
@ -27,6 +28,10 @@ public class GameEndListener implements Listener {
game.setWinningTeamId(winningTeam.getId());
for (Generator generator : game.getActivatedGenerators()) {
generator.setActivated(false);
}
game.getTeams().forEach(team -> team.allPlayers().forEach(player -> {
PlayerUtil.clearPlayer(player);

View File

@ -8,6 +8,9 @@ import rip.tilly.bedwars.BedWars;
import rip.tilly.bedwars.events.GameStartEvent;
import rip.tilly.bedwars.game.Game;
import rip.tilly.bedwars.game.GameType;
import rip.tilly.bedwars.game.arena.CopiedArena;
import rip.tilly.bedwars.generators.Generator;
import rip.tilly.bedwars.generators.GeneratorType;
import rip.tilly.bedwars.playerdata.PlayerData;
import rip.tilly.bedwars.playerdata.PlayerState;
import rip.tilly.bedwars.runnables.GameRunnable;
@ -36,6 +39,30 @@ public class GameStartListener implements Listener {
return;
}
CopiedArena currentArena = game.getCopiedArena();
for (CustomLocation location : currentArena.getTeamGenerators()) {
Generator teamGen = new Generator(location.toBukkitLocation(), GeneratorType.IRON, false);
teamGen.setActivated(true);
game.getActivatedGenerators().add(teamGen);
}
for (CustomLocation location : currentArena.getDiamondGenerators()) {
Generator diaGen = new Generator(location.toBukkitLocation(), GeneratorType.DIAMOND, true);
diaGen.setActivated(true);
game.getActivatedGenerators().add(diaGen);
}
for (CustomLocation location : currentArena.getEmeraldGenerators()) {
Generator emeGen = new Generator(location.toBukkitLocation(), GeneratorType.EMERALD, true);
emeGen.setActivated(true);
game.getActivatedGenerators().add(emeGen);
}
Set<Player> gamePlayers = new HashSet<>();
game.getTeams().forEach(team -> team.playingPlayers().forEach(player -> {
gamePlayers.add(player);

View File

@ -8,7 +8,6 @@ import org.bukkit.configuration.file.FileConfiguration;
import rip.tilly.bedwars.BedWars;
import rip.tilly.bedwars.game.arena.Arena;
import rip.tilly.bedwars.game.arena.CopiedArena;
import rip.tilly.bedwars.generators.Generator;
import rip.tilly.bedwars.utils.CustomLocation;
import rip.tilly.bedwars.utils.config.file.Config;
@ -52,7 +51,9 @@ public class ArenaManager {
int deadZone = section.getInt(name + ".deadZone");
int buildMax = section.getInt(name + ".buildMax");
List<String> generators = section.getStringList(name + ".generators");
List<String> teamGenerators = section.getStringList(name + ".team-generators");
List<String> diamondGenerators = section.getStringList(name + ".diamond-generators");
List<String> emeraldGenerators = section.getStringList(name + ".emerald-generators");
CustomLocation spawnA = CustomLocation.stringToLocation(a);
CustomLocation spawnB = CustomLocation.stringToLocation(b);
@ -63,9 +64,19 @@ public class ArenaManager {
CustomLocation locTeamBmin = CustomLocation.stringToLocation(teamBmin);
CustomLocation locTeamBmax = CustomLocation.stringToLocation(teamBmax);
List<CustomLocation> generatorLocations = new ArrayList<>();
for (String location : generators) {
generatorLocations.add(CustomLocation.stringToLocation(location));
List<CustomLocation> teamGeneratorLocations = new ArrayList<>();
for (String location : teamGenerators) {
teamGeneratorLocations.add(CustomLocation.stringToLocation(location));
}
List<CustomLocation> diamondGeneratorLocations = new ArrayList<>();
for (String location : diamondGenerators) {
diamondGeneratorLocations.add(CustomLocation.stringToLocation(location));
}
List<CustomLocation> emeraldGeneratorLocations = new ArrayList<>();
for (String location : emeraldGenerators) {
emeraldGeneratorLocations.add(CustomLocation.stringToLocation(location));
}
List<CopiedArena> copiedArenas = new ArrayList<>();
@ -81,7 +92,9 @@ public class ArenaManager {
String copyTeamBmin = copiedSection.getString(copy + ".teamBmin");
String copyTeamBmax = copiedSection.getString(copy + ".teamBmax");
List<String> copyGenerators = copiedSection.getStringList(copy + ".generators");
List<String> copyTeamGenerators = copiedSection.getStringList(copy + ".team-generators");
List<String> copyDiamondGenerators = copiedSection.getStringList(copy + ".diamond-generators");
List<String> copyEmeraldGenerators = copiedSection.getStringList(copy + ".emerald-generators");
CustomLocation copySpawnA = CustomLocation.stringToLocation(copyA);
CustomLocation copySpawnB = CustomLocation.stringToLocation(copyB);
@ -92,9 +105,19 @@ public class ArenaManager {
CustomLocation copyLocTeamBmin = CustomLocation.stringToLocation(copyTeamBmin);
CustomLocation copyLocTeamBmax = CustomLocation.stringToLocation(copyTeamBmax);
List<CustomLocation> copyGeneratorLocations = new ArrayList<>();
for (String location : copyGenerators) {
copyGeneratorLocations.add(CustomLocation.stringToLocation(location));
List<CustomLocation> copyTeamGeneratorLocations = new ArrayList<>();
for (String location : copyTeamGenerators) {
copyTeamGeneratorLocations.add(CustomLocation.stringToLocation(location));
}
List<CustomLocation> copyDiamondGeneratorLocations = new ArrayList<>();
for (String location : copyDiamondGenerators) {
copyDiamondGeneratorLocations.add(CustomLocation.stringToLocation(location));
}
List<CustomLocation> copyEmeraldGeneratorLocations = new ArrayList<>();
for (String location : copyEmeraldGenerators) {
copyEmeraldGeneratorLocations.add(CustomLocation.stringToLocation(location));
}
CopiedArena copiedArena = new CopiedArena(
@ -106,7 +129,10 @@ public class ArenaManager {
copyLocTeamAmax,
copyLocTeamBmin,
copyLocTeamBmax,
copyGeneratorLocations
copyTeamGeneratorLocations,
copyDiamondGeneratorLocations,
copyEmeraldGeneratorLocations
);
this.plugin.getChunkClearingManager().copyArena(copiedArena);
@ -133,7 +159,11 @@ public class ArenaManager {
locTeamBmax,
deadZone,
buildMax,
generatorLocations,
teamGeneratorLocations,
diamondGeneratorLocations,
emeraldGeneratorLocations,
enabled
);
@ -177,7 +207,9 @@ public class ArenaManager {
fileConfig.set(root + ".deadZone", deadZone);
fileConfig.set(root + ".buildMax", buildMax);
fileConfig.set(root + ".generators", this.fromLocations(arena.getGenerators()));
fileConfig.set(root + ".team-generators", this.fromLocations(arena.getTeamGenerators()));
fileConfig.set(root + ".diamond-generators", this.fromLocations(arena.getDiamondGenerators()));
fileConfig.set(root + ".emerald-generators", this.fromLocations(arena.getEmeraldGenerators()));
fileConfig.set(root + ".enabled", arena.isEnabled());
fileConfig.set(root + ".copiedArenas", null);
@ -205,7 +237,9 @@ public class ArenaManager {
fileConfig.set(copyRoot + ".teamBmin", copyTeamBmin);
fileConfig.set(copyRoot + ".teamBmax", copyTeamBmax);
fileConfig.set(copyRoot + ".generators", this.fromLocations(copiedArena.getGenerators()));
fileConfig.set(copyRoot + ".team-generators", this.fromLocations(copiedArena.getTeamGenerators()));
fileConfig.set(copyRoot + ".diamond-generators", this.fromLocations(copiedArena.getDiamondGenerators()));
fileConfig.set(copyRoot + ".emerald-generators", this.fromLocations(copiedArena.getEmeraldGenerators()));
i++;
}

View File

@ -1,20 +1,20 @@
package rip.tilly.bedwars.menus.shop;
import lombok.RequiredArgsConstructor;
import org.bukkit.Material;
@RequiredArgsConstructor
public enum ShopType {
QUICK("Quick Buy"),
BLOCKS("Blocks"),
ARMOR("Armor"),
TOOLS("Tools"),
WEAPONS("Weapons"),
RANGED("Ranged"),
POTIONS("Potions"),
UTILITY("Utility");
private final String name;
private final Material material;
}
//package rip.tilly.bedwars.menus.shop;
//
//import lombok.RequiredArgsConstructor;
//import org.bukkit.Material;
//
//@RequiredArgsConstructor
//public enum ShopType {
//
// QUICK("Quick Buy"),
// BLOCKS("Blocks"),
// ARMOR("Armor"),
// TOOLS("Tools"),
// WEAPONS("Weapons"),
// RANGED("Ranged"),
// POTIONS("Potions"),
// UTILITY("Utility");
//
// private final String name;
// private final Material material;
//}

View File

@ -1,10 +1,10 @@
package rip.tilly.bedwars.menus.shop;
import lombok.AllArgsConstructor;
import rip.tilly.bedwars.utils.menu.Button;
@AllArgsConstructor
public class ShopTypeButton extends Button {
private final ShopType shopType;
}
//package rip.tilly.bedwars.menus.shop;
//
//import lombok.AllArgsConstructor;
//import rip.tilly.bedwars.utils.menu.Button;
//
//@AllArgsConstructor
//public class ShopTypeButton extends Button {
//
// private final ShopType shopType;
//}

View File

@ -1,29 +1,29 @@
package rip.tilly.bedwars.menus.shop.blocks;
import org.bukkit.entity.Player;
import rip.tilly.bedwars.utils.CC;
import rip.tilly.bedwars.utils.menu.Button;
import rip.tilly.bedwars.utils.menu.Menu;
import java.util.HashMap;
import java.util.Map;
public class BlocksMenu extends Menu {
@Override
public boolean isUpdateAfterClick() {
return true;
}
@Override
public String getTitle(Player player) {
return CC.translate("&eBlocks");
}
@Override
public Map<Integer, Button> getButtons(Player player) {
Map<Integer, Button> buttons = new HashMap<>();
}
}
//package rip.tilly.bedwars.menus.shop.blocks;
//
//import org.bukkit.entity.Player;
//import rip.tilly.bedwars.utils.CC;
//import rip.tilly.bedwars.utils.menu.Button;
//import rip.tilly.bedwars.utils.menu.Menu;
//
//import java.util.HashMap;
//import java.util.Map;
//
//public class BlocksMenu extends Menu {
//
// @Override
// public boolean isUpdateAfterClick() {
// return true;
// }
//
// @Override
// public String getTitle(Player player) {
// return CC.translate("&eBlocks");
// }
//
// @Override
// public Map<Integer, Button> getButtons(Player player) {
// Map<Integer, Button> buttons = new HashMap<>();
//
//
// }
//}

View File

@ -61,13 +61,25 @@ public class ArenaCommandRunnable implements Runnable {
CustomLocation teamBmin = new CustomLocation(bMinX, arena.getTeamBmin().getY(), bMinZ, arena.getTeamBmin().getYaw(), arena.getTeamBmin().getPitch());
CustomLocation teamBmax = new CustomLocation(bMaxX, arena.getTeamBmax().getY(), bMaxZ, arena.getTeamBmax().getYaw(), arena.getTeamBmax().getPitch());
List<CustomLocation> generators = new ArrayList<>();
for (CustomLocation generator : arena.getGenerators()) {
CustomLocation newGenerator = new CustomLocation((generator.getX() + this.getOffsetX()), generator.getY(), (generator.getZ() + this.getOffsetZ()), generator.getYaw(), generator.getPitch());
generators.add(newGenerator);
List<CustomLocation> teamGenerators = new ArrayList<>();
for (CustomLocation location : arena.getTeamGenerators()) {
CustomLocation newTeamGenerator = new CustomLocation((location.getX() + this.getOffsetX()), location.getY(), (location.getZ() + this.getOffsetZ()), location.getYaw(), location.getPitch());
teamGenerators.add(newTeamGenerator);
}
CopiedArena copiedArena = new CopiedArena(a, b, min, max, teamAmin, teamAmax, teamBmin, teamBmax, generators);
List<CustomLocation> diamondGenerators = new ArrayList<>();
for (CustomLocation location : arena.getDiamondGenerators()) {
CustomLocation newDiamondGenerator = new CustomLocation((location.getX() + this.getOffsetX()), location.getY(), (location.getZ() + this.getOffsetZ()), location.getYaw(), location.getPitch());
diamondGenerators.add(newDiamondGenerator);
}
List<CustomLocation> emeraldGenerators = new ArrayList<>();
for (CustomLocation location : arena.getEmeraldGenerators()) {
CustomLocation newEmeraldGenerator = new CustomLocation((location.getX() + this.getOffsetX()), location.getY(), (location.getZ() + this.getOffsetZ()), location.getYaw(), location.getPitch());
emeraldGenerators.add(newEmeraldGenerator);
}
CopiedArena copiedArena = new CopiedArena(a, b, min, max, teamAmin, teamAmax, teamBmin, teamBmax, teamGenerators, diamondGenerators, emeraldGenerators);
arena.addCopiedArena(copiedArena);
arena.addAvailableArena(copiedArena);