From 3b2566039d9789ca7f321f3cbe3e44d55420a18d Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Fri, 25 Feb 2022 01:15:13 -0600 Subject: [PATCH] Fix commandspy --- src/main/java/dev/plex/command/impl/CommandSpyCMD.java | 5 +++-- src/main/java/dev/plex/event/AdminAddEvent.java | 2 +- src/main/java/dev/plex/event/AdminRemoveEvent.java | 2 +- src/main/java/dev/plex/event/AdminSetRankEvent.java | 2 +- src/main/java/dev/plex/event/GameModeUpdateEvent.java | 2 +- src/main/java/dev/plex/services/impl/GameRuleService.java | 1 + src/main/resources/messages.yml | 6 +++--- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/dev/plex/command/impl/CommandSpyCMD.java b/src/main/java/dev/plex/command/impl/CommandSpyCMD.java index 4996093..461e055 100644 --- a/src/main/java/dev/plex/command/impl/CommandSpyCMD.java +++ b/src/main/java/dev/plex/command/impl/CommandSpyCMD.java @@ -7,6 +7,7 @@ import dev.plex.command.annotation.CommandPermissions; import dev.plex.command.source.RequiredCommandSource; import dev.plex.player.PlexPlayer; import dev.plex.rank.enums.Rank; +import dev.plex.util.PlexUtils; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.command.CommandSender; @@ -26,9 +27,9 @@ public class CommandSpyCMD extends PlexCommand PlexPlayer plexPlayer = DataUtils.getPlayer(playerSender.getUniqueId()); plexPlayer.setCommandSpy(!plexPlayer.isCommandSpy()); DataUtils.update(plexPlayer); - return Component.text("CommandSpy has been").color(NamedTextColor.GRAY) + return Component.text(PlexUtils.messageString("toggleCommandSpy")).color(NamedTextColor.GRAY) .append(Component.space()) - .append(Component.text(plexPlayer.isCommandSpy() ? "enabled." : "disabled.").color(NamedTextColor.GRAY)); + .append(Component.text(plexPlayer.isCommandSpy() ? PlexUtils.messageString("enabled") : PlexUtils.messageString("disabled")).color(NamedTextColor.GRAY)); } return null; } diff --git a/src/main/java/dev/plex/event/AdminAddEvent.java b/src/main/java/dev/plex/event/AdminAddEvent.java index a3887f9..bb6f3fb 100644 --- a/src/main/java/dev/plex/event/AdminAddEvent.java +++ b/src/main/java/dev/plex/event/AdminAddEvent.java @@ -10,7 +10,7 @@ import org.bukkit.event.HandlerList; /** * Event that is ran when a player is added to the admin list */ -@EqualsAndHashCode(callSuper = true) +@EqualsAndHashCode(callSuper = false) @Data public class AdminAddEvent extends Event { diff --git a/src/main/java/dev/plex/event/AdminRemoveEvent.java b/src/main/java/dev/plex/event/AdminRemoveEvent.java index 9f2c6ac..67038a8 100644 --- a/src/main/java/dev/plex/event/AdminRemoveEvent.java +++ b/src/main/java/dev/plex/event/AdminRemoveEvent.java @@ -10,7 +10,7 @@ import org.bukkit.event.HandlerList; /** * Event that is ran when a player is removed from the admin list */ -@EqualsAndHashCode(callSuper = true) +@EqualsAndHashCode(callSuper = false) @Data public class AdminRemoveEvent extends Event { diff --git a/src/main/java/dev/plex/event/AdminSetRankEvent.java b/src/main/java/dev/plex/event/AdminSetRankEvent.java index 0769030..a13f7e5 100644 --- a/src/main/java/dev/plex/event/AdminSetRankEvent.java +++ b/src/main/java/dev/plex/event/AdminSetRankEvent.java @@ -11,7 +11,7 @@ import org.bukkit.event.HandlerList; /** * Event that is ran when an admin's rank is set */ -@EqualsAndHashCode(callSuper = true) +@EqualsAndHashCode(callSuper = false) @Data public class AdminSetRankEvent extends Event { diff --git a/src/main/java/dev/plex/event/GameModeUpdateEvent.java b/src/main/java/dev/plex/event/GameModeUpdateEvent.java index 133b8e6..dc359ab 100644 --- a/src/main/java/dev/plex/event/GameModeUpdateEvent.java +++ b/src/main/java/dev/plex/event/GameModeUpdateEvent.java @@ -9,7 +9,7 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; -@EqualsAndHashCode(callSuper = true) +@EqualsAndHashCode(callSuper = false) @Data public class GameModeUpdateEvent extends Event { diff --git a/src/main/java/dev/plex/services/impl/GameRuleService.java b/src/main/java/dev/plex/services/impl/GameRuleService.java index 725dd50..7306473 100644 --- a/src/main/java/dev/plex/services/impl/GameRuleService.java +++ b/src/main/java/dev/plex/services/impl/GameRuleService.java @@ -34,6 +34,7 @@ public class GameRuleService extends AbstractService world.setGameRule(GameRule.COMMAND_BLOCK_OUTPUT, false); world.setGameRule(GameRule.NATURAL_REGENERATION, true); world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false); + world.setGameRule(GameRule.DO_WEATHER_CYCLE, false); world.setGameRule(GameRule.ANNOUNCE_ADVANCEMENTS, false); world.setGameRule(GameRule.SHOW_DEATH_MESSAGES, false); world.setGameRule(GameRule.SEND_COMMAND_FEEDBACK, false); diff --git a/src/main/resources/messages.yml b/src/main/resources/messages.yml index 57353d7..2d19445 100644 --- a/src/main/resources/messages.yml +++ b/src/main/resources/messages.yml @@ -98,7 +98,7 @@ banningPlayer: " - Banning " unbanningPlayer: " - Unbanning " playerNotBanned: "That player is not banned!" teleportedToWorldSpawn: "Teleporting to the local spawn" -toggleCommandSpy: "CommandSpy has been " -enabled: "enabled" -disabled: "disabled" +toggleCommandSpy: "CommandSpy has been" +enabled: "enabled." +disabled: "disabled." adminChatFormat: '&8[&9AdminChat&8] &4 &7ยป &6' \ No newline at end of file