From ab17e05cf725f475ef3d0833be96fff4db0d830b Mon Sep 17 00:00:00 2001 From: james <75051061+notsceptor@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:30:33 +0000 Subject: [PATCH] Removed the redundant variable declaration and changed the permission name. --- .../java/dev/plex/extras/command/ClownfishCommand.java | 7 +++---- .../java/dev/plex/extras/listener/ClownfishListener.java | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/dev/plex/extras/command/ClownfishCommand.java b/src/main/java/dev/plex/extras/command/ClownfishCommand.java index ff026db..b3fe481 100644 --- a/src/main/java/dev/plex/extras/command/ClownfishCommand.java +++ b/src/main/java/dev/plex/extras/command/ClownfishCommand.java @@ -61,7 +61,7 @@ public class ClownfishCommand extends PlexCommand } else if (args[0].equals("restrict") && args.length == 2) { - if (silentCheckPermission(commandSender, "plex.tfmextras.restrictclownfish")) + if (silentCheckPermission(commandSender, "plex.tfmextras.clownfish.restrict")) { PlexPlayer target = DataUtils.getPlayer(args[1]); if (target == null) @@ -99,7 +99,7 @@ public class ClownfishCommand extends PlexCommand @Override public @NotNull List smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException { - if (silentCheckPermission(sender, "plex.tfmextras.restrictclownfish")) + if (silentCheckPermission(sender, "plex.tfmextras.clownfish.restrict")) { if (args.length == 1) { @@ -110,8 +110,7 @@ public class ClownfishCommand extends PlexCommand return PlexUtils.getPlayerNameList(); } } - - if (args.length == 1) + else if (args.length == 1) { return List.of("toggle"); } diff --git a/src/main/java/dev/plex/extras/listener/ClownfishListener.java b/src/main/java/dev/plex/extras/listener/ClownfishListener.java index 09e2765..26e0940 100644 --- a/src/main/java/dev/plex/extras/listener/ClownfishListener.java +++ b/src/main/java/dev/plex/extras/listener/ClownfishListener.java @@ -74,8 +74,7 @@ public class ClownfishListener extends PlexListener { target.setFlying(false); - final Sound[] listOfSounds = Sound.values(); - for (Sound sound : listOfSounds) + for (Sound sound : Sound.values()) { if (sound.toString().contains("HIT")) { @@ -92,8 +91,7 @@ public class ClownfishListener extends PlexListener if (!pushedPlayers.isEmpty()) { - final Sound[] listOfSounds = Sound.values(); - for (Sound sound : listOfSounds) + for (Sound sound : Sound.values()) { if (sound.toString().contains("HIT")) {