diff --git a/src/main/java/rip/tilly/bedwars/game/Game.java b/src/main/java/rip/tilly/bedwars/game/Game.java index ef18457..cc1fea6 100644 --- a/src/main/java/rip/tilly/bedwars/game/Game.java +++ b/src/main/java/rip/tilly/bedwars/game/Game.java @@ -15,6 +15,7 @@ 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.generators.GeneratorTier; import rip.tilly.bedwars.utils.CC; import rip.tilly.bedwars.utils.TimeUtils; @@ -49,6 +50,9 @@ public class Game { private List activatedGenerators = new ArrayList<>(); + private GeneratorTier diamondGeneratorTier = GeneratorTier.ONE; + private GeneratorTier emeraldGeneratorTier = GeneratorTier.ONE; + 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 458b936..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,9 +4,6 @@ import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; -import org.bukkit.Bukkit; -import rip.tilly.bedwars.generators.GeneratorTier; -import rip.tilly.bedwars.utils.CC; import rip.tilly.bedwars.utils.CustomLocation; import java.util.ArrayList; @@ -45,9 +42,6 @@ public class Arena { private List diamondGenerators = new ArrayList<>(); private List emeraldGenerators = new ArrayList<>(); - private GeneratorTier diamondGeneratorTier = GeneratorTier.ONE; - private GeneratorTier emeraldGeneratorTier = GeneratorTier.ONE; - private boolean enabled; public CopiedArena getAvailableArena() { diff --git a/src/main/java/rip/tilly/bedwars/generators/GeneratorTier.java b/src/main/java/rip/tilly/bedwars/generators/GeneratorTier.java index beefc02..8dca031 100644 --- a/src/main/java/rip/tilly/bedwars/generators/GeneratorTier.java +++ b/src/main/java/rip/tilly/bedwars/generators/GeneratorTier.java @@ -1,5 +1,7 @@ package rip.tilly.bedwars.generators; +import java.util.Arrays; + public enum GeneratorTier { ONE, @@ -24,4 +26,8 @@ public enum GeneratorTier { return "I"; } + + public static GeneratorTier getByName(String name) { + return Arrays.stream(values()).filter(type -> type.name().equalsIgnoreCase(name)).findFirst().orElse(null); + } } diff --git a/src/main/java/rip/tilly/bedwars/listeners/PartyChatListener.java b/src/main/java/rip/tilly/bedwars/listeners/PartyChatListener.java index 7c5e371..684c0f7 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/PartyChatListener.java +++ b/src/main/java/rip/tilly/bedwars/listeners/PartyChatListener.java @@ -24,7 +24,7 @@ public class PartyChatListener implements Listener { if (party == null && !settings.isPartyChatEnabled()) { return; } - + String chatMessage = event.getMessage(); if (party != null) { if (settings.isPartyChatEnabled()) {