diff --git a/src/main/java/rip/tilly/bedwars/commands/arena/ArenaCommand.java b/src/main/java/rip/tilly/bedwars/commands/arena/ArenaCommand.java index 130107f..18c81d3 100644 --- a/src/main/java/rip/tilly/bedwars/commands/arena/ArenaCommand.java +++ b/src/main/java/rip/tilly/bedwars/commands/arena/ArenaCommand.java @@ -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; } } diff --git a/src/main/java/rip/tilly/bedwars/commands/arena/SetDiamondGeneratorCommand.java b/src/main/java/rip/tilly/bedwars/commands/arena/SetDiamondGeneratorCommand.java index 1a36a0b..99b95e1 100644 --- a/src/main/java/rip/tilly/bedwars/commands/arena/SetDiamondGeneratorCommand.java +++ b/src/main/java/rip/tilly/bedwars/commands/arena/SetDiamondGeneratorCommand.java @@ -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(); + } } diff --git a/src/main/java/rip/tilly/bedwars/commands/arena/SetEmeraldGeneratorCommand.java b/src/main/java/rip/tilly/bedwars/commands/arena/SetEmeraldGeneratorCommand.java index ed2ae79..f0b3e1a 100644 --- a/src/main/java/rip/tilly/bedwars/commands/arena/SetEmeraldGeneratorCommand.java +++ b/src/main/java/rip/tilly/bedwars/commands/arena/SetEmeraldGeneratorCommand.java @@ -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(); + } } diff --git a/src/main/java/rip/tilly/bedwars/commands/arena/SetPlayerGeneratorCommand.java b/src/main/java/rip/tilly/bedwars/commands/arena/SetPlayerGeneratorCommand.java deleted file mode 100644 index 32bb98e..0000000 --- a/src/main/java/rip/tilly/bedwars/commands/arena/SetPlayerGeneratorCommand.java +++ /dev/null @@ -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 getTabCompletions(CommandSender sender, Command cmd, String label, String[] args) { - List tabCompletions = new ArrayList(); - - return tabCompletions; - } -} diff --git a/src/main/java/rip/tilly/bedwars/commands/arena/GeneratorCommand.java b/src/main/java/rip/tilly/bedwars/commands/arena/SetTeamGeneratorCommand.java similarity index 60% rename from src/main/java/rip/tilly/bedwars/commands/arena/GeneratorCommand.java rename to src/main/java/rip/tilly/bedwars/commands/arena/SetTeamGeneratorCommand.java index f6fe466..238ed9b 100644 --- a/src/main/java/rip/tilly/bedwars/commands/arena/GeneratorCommand.java +++ b/src/main/java/rip/tilly/bedwars/commands/arena/SetTeamGeneratorCommand.java @@ -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(); } } diff --git a/src/main/java/rip/tilly/bedwars/game/Game.java b/src/main/java/rip/tilly/bedwars/game/Game.java index 781dae5..2a8f876 100644 --- a/src/main/java/rip/tilly/bedwars/game/Game.java +++ b/src/main/java/rip/tilly/bedwars/game/Game.java @@ -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 activatedGenerators = new ArrayList<>(); + public Game(Arena arena, GameType gameType, GameTeam... teams) { this.arena = arena; this.gameType = gameType; diff --git a/src/main/java/rip/tilly/bedwars/game/arena/Arena.java b/src/main/java/rip/tilly/bedwars/game/arena/Arena.java index 9d51734..42b73f1 100644 --- a/src/main/java/rip/tilly/bedwars/game/arena/Arena.java +++ b/src/main/java/rip/tilly/bedwars/game/arena/Arena.java @@ -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 teamGenerators = new ArrayList<>(); + private List diamondGenerators = new ArrayList<>(); + private List emeraldGenerators = new ArrayList<>(); + private boolean enabled; public CopiedArena getAvailableArena() { diff --git a/src/main/java/rip/tilly/bedwars/game/arena/CopiedArena.java b/src/main/java/rip/tilly/bedwars/game/arena/CopiedArena.java index 52857dd..63480f0 100644 --- a/src/main/java/rip/tilly/bedwars/game/arena/CopiedArena.java +++ b/src/main/java/rip/tilly/bedwars/game/arena/CopiedArena.java @@ -27,5 +27,8 @@ public class CopiedArena { private CustomLocation teamBmin; private CustomLocation teamBmax; - private List generators = new ArrayList<>(); + private List teamGenerators = new ArrayList<>(); + private List diamondGenerators = new ArrayList<>(); + private List emeraldGenerators = new ArrayList<>(); + } diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java index 09a5c93..0322bf3 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/GameEndListener.java @@ -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); diff --git a/src/main/java/rip/tilly/bedwars/listeners/game/GameStartListener.java b/src/main/java/rip/tilly/bedwars/listeners/game/GameStartListener.java index 3c2869f..24f4514 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/game/GameStartListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/game/GameStartListener.java @@ -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 gamePlayers = new HashSet<>(); game.getTeams().forEach(team -> team.playingPlayers().forEach(player -> { gamePlayers.add(player); diff --git a/src/main/java/rip/tilly/bedwars/managers/arena/ArenaManager.java b/src/main/java/rip/tilly/bedwars/managers/arena/ArenaManager.java index a3c3610..e393cfd 100644 --- a/src/main/java/rip/tilly/bedwars/managers/arena/ArenaManager.java +++ b/src/main/java/rip/tilly/bedwars/managers/arena/ArenaManager.java @@ -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 generators = section.getStringList(name + ".generators"); + List teamGenerators = section.getStringList(name + ".team-generators"); + List diamondGenerators = section.getStringList(name + ".diamond-generators"); + List 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 generatorLocations = new ArrayList<>(); - for (String location : generators) { - generatorLocations.add(CustomLocation.stringToLocation(location)); + List teamGeneratorLocations = new ArrayList<>(); + for (String location : teamGenerators) { + teamGeneratorLocations.add(CustomLocation.stringToLocation(location)); + } + + List diamondGeneratorLocations = new ArrayList<>(); + for (String location : diamondGenerators) { + diamondGeneratorLocations.add(CustomLocation.stringToLocation(location)); + } + + List emeraldGeneratorLocations = new ArrayList<>(); + for (String location : emeraldGenerators) { + emeraldGeneratorLocations.add(CustomLocation.stringToLocation(location)); } List copiedArenas = new ArrayList<>(); @@ -81,7 +92,9 @@ public class ArenaManager { String copyTeamBmin = copiedSection.getString(copy + ".teamBmin"); String copyTeamBmax = copiedSection.getString(copy + ".teamBmax"); - List copyGenerators = copiedSection.getStringList(copy + ".generators"); + List copyTeamGenerators = copiedSection.getStringList(copy + ".team-generators"); + List copyDiamondGenerators = copiedSection.getStringList(copy + ".diamond-generators"); + List 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 copyGeneratorLocations = new ArrayList<>(); - for (String location : copyGenerators) { - copyGeneratorLocations.add(CustomLocation.stringToLocation(location)); + List copyTeamGeneratorLocations = new ArrayList<>(); + for (String location : copyTeamGenerators) { + copyTeamGeneratorLocations.add(CustomLocation.stringToLocation(location)); + } + + List copyDiamondGeneratorLocations = new ArrayList<>(); + for (String location : copyDiamondGenerators) { + copyDiamondGeneratorLocations.add(CustomLocation.stringToLocation(location)); + } + + List 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++; } diff --git a/src/main/java/rip/tilly/bedwars/menus/shop/ShopType.java b/src/main/java/rip/tilly/bedwars/menus/shop/ShopType.java index 392332c..cf96628 100644 --- a/src/main/java/rip/tilly/bedwars/menus/shop/ShopType.java +++ b/src/main/java/rip/tilly/bedwars/menus/shop/ShopType.java @@ -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; +//} diff --git a/src/main/java/rip/tilly/bedwars/menus/shop/ShopTypeButton.java b/src/main/java/rip/tilly/bedwars/menus/shop/ShopTypeButton.java index 1fb3d2d..0945b83 100644 --- a/src/main/java/rip/tilly/bedwars/menus/shop/ShopTypeButton.java +++ b/src/main/java/rip/tilly/bedwars/menus/shop/ShopTypeButton.java @@ -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; +//} diff --git a/src/main/java/rip/tilly/bedwars/menus/shop/blocks/BlocksMenu.java b/src/main/java/rip/tilly/bedwars/menus/shop/blocks/BlocksMenu.java index 25f987b..2113445 100644 --- a/src/main/java/rip/tilly/bedwars/menus/shop/blocks/BlocksMenu.java +++ b/src/main/java/rip/tilly/bedwars/menus/shop/blocks/BlocksMenu.java @@ -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 getButtons(Player player) { - Map 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 getButtons(Player player) { +// Map buttons = new HashMap<>(); +// +// +// } +//} diff --git a/src/main/java/rip/tilly/bedwars/runnables/ArenaCommandRunnable.java b/src/main/java/rip/tilly/bedwars/runnables/ArenaCommandRunnable.java index 832b6e9..e02d43c 100644 --- a/src/main/java/rip/tilly/bedwars/runnables/ArenaCommandRunnable.java +++ b/src/main/java/rip/tilly/bedwars/runnables/ArenaCommandRunnable.java @@ -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 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 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 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 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);