Some improvements to the messages

This commit is contained in:
Telesphoreo 2022-05-19 21:07:38 -05:00
parent b39ba8ed86
commit ff16347981
5 changed files with 75 additions and 70 deletions

49
.idea/codeStyles/Plexus_Code_Style.xml generated Normal file
View File

@ -0,0 +1,49 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Plexus Code Style" version="1">
<JavaCodeStyleSettings>
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="20" />
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="false" />
<package name="" withSubpackages="true" static="true" />
</value>
</option>
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
</JetCodeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="BRACE_STYLE" value="2" />
<option name="CLASS_BRACE_STYLE" value="2" />
<option name="METHOD_BRACE_STYLE" value="2" />
<option name="LAMBDA_BRACE_STYLE" value="2" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="0" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -1,49 +1,5 @@
<component name="ProjectCodeStyleConfiguration"> <component name="ProjectCodeStyleConfiguration">
<code_scheme name="Plexus Code Style" version="1"> <state>
<JavaCodeStyleSettings> <option name="PREFERRED_PROJECT_CODE_STYLE" value="Plexus Code Style" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="20" /> </state>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="false" />
<package name="" withSubpackages="true" static="true" />
</value>
</option>
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
</JetCodeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="BRACE_STYLE" value="2" />
<option name="CLASS_BRACE_STYLE" value="2" />
<option name="METHOD_BRACE_STYLE" value="2" />
<option name="LAMBDA_BRACE_STYLE" value="2" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="0" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
</codeStyleSettings>
</code_scheme>
</component> </component>

View File

@ -7,7 +7,6 @@ import dev.plex.listener.impl.BlockListener;
import dev.plex.rank.enums.Rank; import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -30,7 +29,8 @@ public class BlockEditCMD extends PlexCommand
if (args[0].equalsIgnoreCase("list")) if (args[0].equalsIgnoreCase("list"))
{ {
send(sender, "The following have block modification abilities restricted:"); send(sender, messageComponent("listOfPlayersBlocked"));
int count = 0; int count = 0;
for (String player : bl.blockedPlayers.stream().toList()) for (String player : bl.blockedPlayers.stream().toList())
{ {
@ -45,7 +45,7 @@ public class BlockEditCMD extends PlexCommand
} }
else if (args[0].equalsIgnoreCase("purge")) 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; int count = 0;
for (String player : bl.blockedPlayers.stream().toList()) for (String player : bl.blockedPlayers.stream().toList())
{ {
@ -55,11 +55,11 @@ public class BlockEditCMD extends PlexCommand
++count; ++count;
} }
} }
return messageComponent("unblockedEditsSize", count); return messageComponent("blockeditSize", "Unblocked", count);
} }
else if (args[0].equalsIgnoreCase("all")) 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; int count = 0;
for (final Player player : Bukkit.getOnlinePlayers()) 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]); final Player player = getNonNullPlayer(args[0]);
@ -81,16 +81,16 @@ public class BlockEditCMD extends PlexCommand
send(sender, messageComponent("higherRankThanYou")); send(sender, messageComponent("higherRankThanYou"));
return null; return null;
} }
PlexUtils.broadcast(messageComponent("blockingEditFor", sender.getName(), player.getName())); PlexUtils.broadcast(messageComponent("blockingEdits", sender.getName(), player.getName()));
bl.blockedPlayers.add(player.getName()); bl.blockedPlayers.add(player.getName());
send(player, messageComponent("yourEditsHaveBeenBlocked")); send(player, messageComponent("editsModified", "blocked"));
send(sender, messageComponent("editsBlocked", player.getName())); send(sender, messageComponent("editsBlocked", player.getName()));
} }
else else
{ {
PlexUtils.broadcast(messageComponent("unblockingEditFor", sender.getName(), player.getName())); PlexUtils.broadcast(messageComponent("unblockingEdits", sender.getName(), player.getName()));
bl.blockedPlayers.remove(player.getName()); bl.blockedPlayers.remove(player.getName());
send(player, messageComponent("yourEditsHaveBeenUnblocked")); send(player, messageComponent("editsModified", "unblocked"));
send(sender, messageComponent("editsUnblocked", player.getName())); send(sender, messageComponent("editsUnblocked", player.getName()));
} }
return null; return null;

View File

@ -53,6 +53,6 @@ public class LockupCMD extends PlexCommand
@Override @Override
public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException public @NotNull List<String> 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();
} }
} }

View File

@ -131,20 +131,20 @@ prefixCleared: "<aqua>Your prefix has been cleared."
otherPrefixCleared: "<aqua>You have cleared {0}'s prefix." otherPrefixCleared: "<aqua>You have cleared {0}'s prefix."
# 0 - The new prefix # 0 - The new prefix
prefixSetTo: "<aqua>Your prefix has been set to {0}" prefixSetTo: "<aqua>Your prefix has been set to {0}"
# 0 - The amount of players whose edits are blocked # 0 - The action (blocked / unblocked)
blockedEditsSize: "Blocked block modification abilities for {0} players." # 1 - The amount of players
# 0 - The amount of players whose edits are unblocked blockeditSize: "<gray>{0} all block modification abilities for {1} players."
unblockedEditsSize: "Unblocked all block modification abilities for {0} players." # The action (blocked or restored)
# 0 - The command sender editsModified: "<gray>Your block modification abilities have been {0}."
# 1 - The player name listOfPlayersBlocked: "<gray>The following have block modification abilities restricted:"
blockingEditFor: "<red>{0} - Blocking block modification abilities for {1}"
# 0 - The command sender
# 1 - The player name
unblockingEditFor: "<aqua>{0} - Unblocking block modification abilities for {1}"
yourEditsHaveBeenBlocked: "<gray>Your block modification abilities have been blocked."
yourEditsHaveBeenUnblocked: "<gray>Your block modification abilities have been restored."
# 0 - The player name # 0 - The player name
editsBlocked: "<gray>Blocked block modification abilities for {0}" editsBlocked: "<gray>Blocked block modification abilities for {0}"
# 0 - The command sender
# 1 - The player name
blockingEdits: "<red>{0} - Blocking block modification abilities for {1}"
# 0 - The command sender
# 1 - The player
unblockingEdits: "<aqua>{0} - Unblocking block modification abilities for {1}"
# 0 - The player name # 0 - The player name
editsUnblocked: "<gray>Unblocked block modification abilities for {0}" editsUnblocked: "<gray>Unblocked block modification abilities for {0}"
# 0 - The command sender # 0 - The command sender