diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBar.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBar.java index b201996..66fa84d 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBar.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBar.java @@ -8,10 +8,10 @@ import net.kyori.adventure.text.Component; @AllArgsConstructor public class BossBar { @Getter @Setter private Component name; - @Getter @Setter private BossBarColor color; + @Getter @Setter private String color; @Getter @Setter private long max; @Getter @Setter private String players; - @Getter @Setter private BossBarStyle style; + @Getter @Setter private String style; @Getter @Setter private int value; @Getter @Setter private boolean visible; } diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBarColor.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBarColor.java index 30786a4..e812ffa 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBarColor.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBarColor.java @@ -1,17 +1,11 @@ package land.chipmunk.chayapak.chomens_bot.data; -public enum BossBarColor { - BLUE("blue"), - GREEN("green"), - PINK("pink"), - PURPLE("purple"), - RED("red"), - WHITE("white"), - YELLOW("yellow"),; - - public final String color; - - BossBarColor (String color) { - this.color = color; - } +public class BossBarColor { + public static final String BLUE = "blue"; + public static final String GREEN = "green"; + public static final String PINK = "pink"; + public static final String PURPLE = "purple"; + public static final String RED = "red"; + public static final String WHITE = "white"; + public static final String YELLOW = "yellow"; } diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBarStyle.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBarStyle.java index c9477f1..536907c 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBarStyle.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/data/BossBarStyle.java @@ -1,15 +1,9 @@ package land.chipmunk.chayapak.chomens_bot.data; -public enum BossBarStyle { - NOTCHED_10("notched_10"), - NOTCHED_12("notched_12"), - NOTCHED_20("notched_20"), - NOTCHED_6("notched_6"), - PROGRESS("progress"); - - public final String style; - - BossBarStyle (String style) { - this.style = style; - } +public class BossBarStyle { + public static final String NOTCHED_10 = "notched_10"; + public static final String NOTCHED_12 = "notched_12"; + public static final String NOTCHED_20 = "notched_20"; + public static final String NOTCHED_6 = "notched_6"; + public static final String PROGRESS = "progress"; } diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/BossbarManagerPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/BossbarManagerPlugin.java index b62e42e..0683ae9 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/BossbarManagerPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/BossbarManagerPlugin.java @@ -44,9 +44,9 @@ public class BossbarManagerPlugin extends Bot.Listener { if (!actionBar) { bot.core().run("minecraft:bossbar add " + bossBarPrefix + name + " \"\""); bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " players " + bossBar.players()); - bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " color " + bossBar.color().color); + bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " color " + bossBar.color()); bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " visible " + bossBar.visible()); - bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " style " + bossBar.style().style); + bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " style " + bossBar.style()); bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " max " + bossBar.max()); bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " name " + stringifiedComponent); bot.core().run("minecraft:bossbar set " + bossBarPrefix + name + " value " + bossBar.value()); diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TPSPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TPSPlugin.java index 3d3074b..040da04 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TPSPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TPSPlugin.java @@ -100,7 +100,7 @@ public class TPSPlugin extends Bot.Listener { else return NamedTextColor.DARK_RED; } - private BossBarColor getBossBarColor (double tickRate) { + private String getBossBarColor (double tickRate) { if (tickRate > 15) return BossBarColor.GREEN; else if (tickRate == 15) return BossBarColor.YELLOW; else if (tickRate < 15 && tickRate > 10) return BossBarColor.RED;