mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
Code review
This commit is contained in:
parent
6763878d74
commit
223eaf30b3
@ -130,7 +130,7 @@ public class Plex extends JavaPlugin
|
||||
|
||||
if (!setupPermissions() && system.equalsIgnoreCase("permissions") && !getServer().getPluginManager().isPluginEnabled("Vault"))
|
||||
{
|
||||
throw new RuntimeException("Vault is required to run on the server if you use 'permissions!'");
|
||||
throw new RuntimeException("Vault is required to run on the server if you use permissions!");
|
||||
}
|
||||
|
||||
updateChecker = new UpdateChecker();
|
||||
|
@ -25,7 +25,7 @@ public class ConsoleSayCommand extends PlexCommand
|
||||
return usage();
|
||||
}
|
||||
|
||||
PlexUtils.broadcast(PlexUtils.messageComponent("consoleSayCommand", sender.getName(), PlexUtils.mmStripColor(StringUtils.join(args, " "))));
|
||||
PlexUtils.broadcast(PlexUtils.messageComponent("consoleSayMessage", sender.getName(), PlexUtils.mmStripColor(StringUtils.join(args, " "))));
|
||||
return null;
|
||||
}
|
||||
}
|
@ -22,7 +22,7 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "pdebug", description = "Plex's debug command", usage = "/<command> <redis-reset <player> | gamerules>")
|
||||
@CommandParameters(name = "pdebug", description = "Plex's debug command", usage = "/<command> <aliases <command> | redis-reset <player> | gamerules>")
|
||||
@CommandPermissions(level = Rank.EXECUTIVE, permission = "plex.debug")
|
||||
@System(debug = true)
|
||||
public class DebugCMD extends PlexCommand
|
||||
|
@ -52,14 +52,13 @@ public class PlexCMD extends PlexCommand
|
||||
plugin.getPunishmentManager().mergeIndefiniteBans();
|
||||
send(sender, "Reloaded indefinite bans");
|
||||
plugin.commands.load();
|
||||
// plugin.getCommandBlockerManager().syncCommands();
|
||||
send(sender, "Reloaded blocked commands file");
|
||||
plugin.getRankManager().importDefaultRanks();
|
||||
send(sender, "Imported ranks");
|
||||
plugin.setSystem(plugin.config.getString("system"));
|
||||
if (!plugin.setupPermissions() && plugin.getSystem().equalsIgnoreCase("permissions") && !plugin.getServer().getPluginManager().isPluginEnabled("Vault"))
|
||||
{
|
||||
throw new RuntimeException("Vault is required to run on the server if you use 'permissions!'");
|
||||
throw new RuntimeException("Vault is required to run on the server if you use permissions!");
|
||||
}
|
||||
plugin.getServiceManager().endServices();
|
||||
plugin.getServiceManager().startServices();
|
||||
|
@ -26,7 +26,7 @@ public class SayCMD extends PlexCommand
|
||||
return usage();
|
||||
}
|
||||
|
||||
PlexUtils.broadcast(PlexUtils.messageComponent("sayCommand", sender.getName(), PlexUtils.mmStripColor(StringUtils.join(args, " "))));
|
||||
PlexUtils.broadcast(PlexUtils.messageComponent("sayMessage", sender.getName(), PlexUtils.mmStripColor(StringUtils.join(args, " "))));
|
||||
return null;
|
||||
}
|
||||
}
|
@ -27,7 +27,6 @@ public class CommandBlockerService extends AbstractService
|
||||
public void run()
|
||||
{
|
||||
BLOCKED_COMMANDS.clear();
|
||||
PlexLog.debug("RUNNING COMMAND BLOCKING SERVICE");
|
||||
plugin.commands.getStringList("commands").forEach(s ->
|
||||
{
|
||||
BlockedCommand command = new BlockedCommand();
|
||||
@ -44,7 +43,8 @@ public class CommandBlockerService extends AbstractService
|
||||
PlexLog.debug(" Regex: " + command.getRegex());
|
||||
PlexLog.debug(" Message: " + command.getMessage());
|
||||
PlexLog.debug("====================");*/
|
||||
} else if (s.toLowerCase(Locale.ROOT).startsWith("m"))
|
||||
}
|
||||
else if (s.toLowerCase(Locale.ROOT).startsWith("m"))
|
||||
{
|
||||
command.setRequiredLevel(args[1]);
|
||||
command.setCommand(args[2]);
|
||||
@ -52,7 +52,7 @@ public class CommandBlockerService extends AbstractService
|
||||
Command cmd = plugin.getServer().getCommandMap().getCommand(command.getCommand().split(" ")[0]);
|
||||
if (cmd == null)
|
||||
{
|
||||
PlexLog.error("Command '{0}' specified in the configuration was null!", command.getCommand().split(" ")[0]);
|
||||
PlexLog.error("Command '{0}' does not belong to any plugin!", command.getCommand().split(" ")[0]);
|
||||
return;
|
||||
}
|
||||
command.setCommandAliases(cmd.getAliases());
|
||||
|
@ -432,7 +432,6 @@ public class PlexUtils extends PlexBase
|
||||
Bukkit.broadcast(component));
|
||||
}
|
||||
|
||||
|
||||
public static Object simpleGET(String url)
|
||||
{
|
||||
try
|
||||
|
@ -170,7 +170,7 @@ allowDropsEnabled: "<gray>Now allowing drops from players."
|
||||
commandBlocked: "<gray>That command is blocked."
|
||||
# 0 - The command sender
|
||||
# 1 - The message being said
|
||||
sayCommand: "<blue>[Server: {0}] {1}"
|
||||
sayMessage: "<blue>[Server: {0}] {1}"
|
||||
# 0 - The command sender
|
||||
# 1 - The message being said
|
||||
consoleSayCommand: "<gray>[Console: {0}] <white>{1}"
|
||||
consoleSayMessage: "<gray>[Console: {0}] <white>{1}"
|
Loading…
Reference in New Issue
Block a user