diff --git a/.idea/codeStyles/Plexus_Code_Style.xml b/.idea/codeStyles/Plexus_Code_Style.xml new file mode 100644 index 0000000..a7db3e4 --- /dev/null +++ b/.idea/codeStyles/Plexus_Code_Style.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml index a7db3e4..df773a2 100644 --- a/.idea/codeStyles/codeStyleConfig.xml +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -1,49 +1,5 @@ - - - - - - - - - - - + + \ No newline at end of file diff --git a/server/src/main/java/dev/plex/command/impl/BlockEditCMD.java b/server/src/main/java/dev/plex/command/impl/BlockEditCMD.java index 6fdbcc2..c5f6617 100644 --- a/server/src/main/java/dev/plex/command/impl/BlockEditCMD.java +++ b/server/src/main/java/dev/plex/command/impl/BlockEditCMD.java @@ -7,7 +7,6 @@ import dev.plex.listener.impl.BlockListener; 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.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -30,7 +29,8 @@ public class BlockEditCMD extends PlexCommand if (args[0].equalsIgnoreCase("list")) { - send(sender, "The following have block modification abilities restricted:"); + send(sender, messageComponent("listOfPlayersBlocked")); + int count = 0; for (String player : bl.blockedPlayers.stream().toList()) { @@ -45,7 +45,7 @@ public class BlockEditCMD extends PlexCommand } else if (args[0].equalsIgnoreCase("purge")) { - PlexUtils.broadcast(componentFromString(sender.getName() + " - Unblocking block modification abilities for all players").color(NamedTextColor.AQUA)); + PlexUtils.broadcast(messageComponent("unblockingEdits", sender.getName(), "all players")); int count = 0; for (String player : bl.blockedPlayers.stream().toList()) { @@ -55,11 +55,11 @@ public class BlockEditCMD extends PlexCommand ++count; } } - return messageComponent("unblockedEditsSize", count); + return messageComponent("blockeditSize", "Unblocked", count); } else if (args[0].equalsIgnoreCase("all")) { - PlexUtils.broadcast(componentFromString(sender.getName() + " - Blocking block modification abilities for all non-admins").color(NamedTextColor.RED)); + PlexUtils.broadcast(messageComponent("blockingEdits", sender.getName(), "all non-admins")); int count = 0; for (final Player player : Bukkit.getOnlinePlayers()) { @@ -70,7 +70,7 @@ public class BlockEditCMD extends PlexCommand } } - return messageComponent("blockedEditsSize", count); + return messageComponent("blockeditSize", "Blocked", count); } final Player player = getNonNullPlayer(args[0]); @@ -81,16 +81,16 @@ public class BlockEditCMD extends PlexCommand send(sender, messageComponent("higherRankThanYou")); return null; } - PlexUtils.broadcast(messageComponent("blockingEditFor", sender.getName(), player.getName())); + PlexUtils.broadcast(messageComponent("blockingEdits", sender.getName(), player.getName())); bl.blockedPlayers.add(player.getName()); - send(player, messageComponent("yourEditsHaveBeenBlocked")); + send(player, messageComponent("editsModified", "blocked")); send(sender, messageComponent("editsBlocked", player.getName())); } else { - PlexUtils.broadcast(messageComponent("unblockingEditFor", sender.getName(), player.getName())); + PlexUtils.broadcast(messageComponent("unblockingEdits", sender.getName(), player.getName())); bl.blockedPlayers.remove(player.getName()); - send(player, messageComponent("yourEditsHaveBeenUnblocked")); + send(player, messageComponent("editsModified", "unblocked")); send(sender, messageComponent("editsUnblocked", player.getName())); } return null; diff --git a/server/src/main/java/dev/plex/command/impl/LockupCMD.java b/server/src/main/java/dev/plex/command/impl/LockupCMD.java index b31e44b..65ef907 100644 --- a/server/src/main/java/dev/plex/command/impl/LockupCMD.java +++ b/server/src/main/java/dev/plex/command/impl/LockupCMD.java @@ -53,6 +53,6 @@ public class LockupCMD extends PlexCommand @Override public @NotNull List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException { - return args.length == 1 && checkTab(sender, Rank.ADMIN, "plex.mute") ? PlexUtils.getPlayerNameList() : ImmutableList.of(); + return args.length == 1 && checkTab(sender, Rank.ADMIN, "plex.lockup") ? PlexUtils.getPlayerNameList() : ImmutableList.of(); } } \ No newline at end of file diff --git a/server/src/main/resources/messages.yml b/server/src/main/resources/messages.yml index 22d6465..bbc1c26 100644 --- a/server/src/main/resources/messages.yml +++ b/server/src/main/resources/messages.yml @@ -131,20 +131,20 @@ prefixCleared: "Your prefix has been cleared." otherPrefixCleared: "You have cleared {0}'s prefix." # 0 - The new prefix prefixSetTo: "Your prefix has been set to {0}" -# 0 - The amount of players whose edits are blocked -blockedEditsSize: "Blocked block modification abilities for {0} players." -# 0 - The amount of players whose edits are unblocked -unblockedEditsSize: "Unblocked all block modification abilities for {0} players." -# 0 - The command sender -# 1 - The player name -blockingEditFor: "{0} - Blocking block modification abilities for {1}" -# 0 - The command sender -# 1 - The player name -unblockingEditFor: "{0} - Unblocking block modification abilities for {1}" -yourEditsHaveBeenBlocked: "Your block modification abilities have been blocked." -yourEditsHaveBeenUnblocked: "Your block modification abilities have been restored." +# 0 - The action (blocked / unblocked) +# 1 - The amount of players +blockeditSize: "{0} all block modification abilities for {1} players." +# The action (blocked or restored) +editsModified: "Your block modification abilities have been {0}." +listOfPlayersBlocked: "The following have block modification abilities restricted:" # 0 - The player name editsBlocked: "Blocked block modification abilities for {0}" +# 0 - The command sender +# 1 - The player name +blockingEdits: "{0} - Blocking block modification abilities for {1}" +# 0 - The command sender +# 1 - The player +unblockingEdits: "{0} - Unblocking block modification abilities for {1}" # 0 - The player name editsUnblocked: "Unblocked block modification abilities for {0}" # 0 - The command sender