i hate you

This commit is contained in:
Luca 2021-11-23 15:42:44 +01:00
parent 4f2702331e
commit 91f20ff303
5 changed files with 51 additions and 3 deletions

View File

@ -21,7 +21,8 @@ public enum GameType {
Material.IRON_SWORD,
0, 6),
V4(16, "BedWars 4v4", Arrays.asList(" ", "&9You are now a master,", "&9you can go up against", "&9the undefeated PvP bot &7(Coming soon)"),
Material.DIAMOND_SWORD, 0, 8);
Material.DIAMOND_SWORD,
0, 8);
private final int slot;
private final String name;

View File

@ -42,6 +42,12 @@ public class Arena {
private List<CustomLocation> diamondGenerators = new ArrayList<>();
private List<CustomLocation> emeraldGenerators = new ArrayList<>();
private CustomLocation teamAshop;
private CustomLocation teamBshop;
private CustomLocation teamAupgrades;
private CustomLocation teamBupgrades;
private boolean enabled;
public CopiedArena getAvailableArena() {

View File

@ -31,4 +31,10 @@ public class CopiedArena {
private List<CustomLocation> diamondGenerators = new ArrayList<>();
private List<CustomLocation> emeraldGenerators = new ArrayList<>();
private CustomLocation teamAshop;
private CustomLocation teamBshop;
private CustomLocation teamAupgrades;
private CustomLocation teamBupgrades;
}

View File

@ -55,6 +55,11 @@ public class ArenaManager {
List<String> diamondGenerators = section.getStringList(name + ".diamond-generators");
List<String> emeraldGenerators = section.getStringList(name + ".emerald-generators");
String teamAshop = section.getString(name + ".teamAshop");
String teamBshop = section.getString(name + ".teamBshop");
String teamAupgrades = section.getString(name + ".teamAupgrades");
String teamBupgrades = section.getString(name + ".teamAupgrades");
CustomLocation spawnA = CustomLocation.stringToLocation(a);
CustomLocation spawnB = CustomLocation.stringToLocation(b);
CustomLocation locMin = CustomLocation.stringToLocation(min);
@ -79,6 +84,11 @@ public class ArenaManager {
emeraldGeneratorLocations.add(CustomLocation.stringToLocation(location));
}
CustomLocation locTeamAshop = CustomLocation.stringToLocation(teamAshop);
CustomLocation locTeamBshop = CustomLocation.stringToLocation(teamBshop);
CustomLocation locTeamAupgrades = CustomLocation.stringToLocation(teamAupgrades);
CustomLocation locTeamBupgrades = CustomLocation.stringToLocation(teamBupgrades);
List<CopiedArena> copiedArenas = new ArrayList<>();
ConfigurationSection copiedSection = section.getConfigurationSection(name + ".copiedArenas");
if (copiedSection != null) {
@ -96,6 +106,11 @@ public class ArenaManager {
List<String> copyDiamondGenerators = copiedSection.getStringList(copy + ".diamond-generators");
List<String> copyEmeraldGenerators = copiedSection.getStringList(copy + ".emerald-generators");
String copyTeamAshop = section.getString(copy + ".teamAshop");
String copyTeamBshop = section.getString(copy + ".teamBshop");
String copyTeamAupgrades = section.getString(copy + ".teamAupgrades");
String copyTeamBupgrades = section.getString(copy + ".teamAupgrades");
CustomLocation copySpawnA = CustomLocation.stringToLocation(copyA);
CustomLocation copySpawnB = CustomLocation.stringToLocation(copyB);
CustomLocation copyLocMin = CustomLocation.stringToLocation(copyMin);
@ -120,6 +135,11 @@ public class ArenaManager {
copyEmeraldGeneratorLocations.add(CustomLocation.stringToLocation(location));
}
CustomLocation copyLocTeamAshop = CustomLocation.stringToLocation(copyTeamAshop);
CustomLocation copyLocTeamBshop = CustomLocation.stringToLocation(copyTeamBshop);
CustomLocation copyLocTeamAupgrades = CustomLocation.stringToLocation(copyTeamAupgrades);
CustomLocation copyLocTeamBupgrades = CustomLocation.stringToLocation(copyTeamBupgrades);
CopiedArena copiedArena = new CopiedArena(
copySpawnA,
copySpawnB,
@ -132,7 +152,12 @@ public class ArenaManager {
copyTeamGeneratorLocations,
copyDiamondGeneratorLocations,
copyEmeraldGeneratorLocations
copyEmeraldGeneratorLocations,
copyLocTeamAshop,
copyLocTeamBshop,
copyLocTeamAupgrades,
copyLocTeamBupgrades
);
this.plugin.getChunkClearingManager().copyArena(copiedArena);
@ -164,6 +189,11 @@ public class ArenaManager {
diamondGeneratorLocations,
emeraldGeneratorLocations,
locTeamAshop,
locTeamBshop,
locTeamAupgrades,
locTeamBupgrades,
enabled
);

View File

@ -79,7 +79,12 @@ public class ArenaCommandRunnable implements Runnable {
emeraldGenerators.add(newEmeraldGenerator);
}
CopiedArena copiedArena = new CopiedArena(a, b, min, max, teamAmin, teamAmax, teamBmin, teamBmax, teamGenerators, diamondGenerators, emeraldGenerators);
CustomLocation teamAshop = new CustomLocation((arena.getTeamAshop().getX() + this.getOffsetX()), arena.getTeamAshop().getY(), (arena.getTeamAshop().getZ() + this.getOffsetZ()), arena.getTeamAshop().getYaw(), arena.getTeamAshop().getPitch());
CustomLocation teamBshop = new CustomLocation((arena.getTeamBshop().getX() + this.getOffsetX()), arena.getTeamBshop().getY(), (arena.getTeamBshop().getZ() + this.getOffsetZ()), arena.getTeamBshop().getYaw(), arena.getTeamBshop().getPitch());
CustomLocation teamAupgrades = new CustomLocation((arena.getTeamAupgrades().getX() + this.getOffsetX()), arena.getTeamAupgrades().getY(), (arena.getTeamAupgrades().getZ() + this.getOffsetZ()), arena.getTeamAupgrades().getYaw(), arena.getTeamAupgrades().getPitch());
CustomLocation teamBupgrades = new CustomLocation((arena.getTeamBupgrades().getX() + this.getOffsetX()), arena.getTeamBupgrades().getY(), (arena.getTeamBupgrades().getZ() + this.getOffsetZ()), arena.getTeamBupgrades().getYaw(), arena.getTeamBupgrades().getPitch());
CopiedArena copiedArena = new CopiedArena(a, b, min, max, teamAmin, teamAmax, teamBmin, teamBmax, teamGenerators, diamondGenerators, emeraldGenerators, teamAshop, teamBshop, teamAupgrades, teamBupgrades);
arena.addCopiedArena(copiedArena);
arena.addAvailableArena(copiedArena);