From b565144bb26fb58bc26cb87fbdf6eb6a270146fc Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Thu, 16 Nov 2017 18:25:10 +0100 Subject: [PATCH] Rename some classes to keep --- .../github/dre2n/dungeonsxl/DungeonsXL.java | 12 +++---- .../dungeonsxl/command/BreakCommand.java | 4 +-- .../dre2n/dungeonsxl/command/ChatCommand.java | 4 +-- .../dungeonsxl/command/ChatSpyCommand.java | 4 +-- .../dungeonsxl/command/CreateCommand.java | 4 +-- .../dungeonsxl/command/DeleteCommand.java | 4 +-- .../dre2n/dungeonsxl/command/EditCommand.java | 4 +-- .../dungeonsxl/command/EnterCommand.java | 6 ++-- .../dungeonsxl/command/EscapeCommand.java | 4 +-- .../dre2n/dungeonsxl/command/GameCommand.java | 4 +-- .../dungeonsxl/command/GroupCommand.java | 10 +++--- .../dre2n/dungeonsxl/command/HelpCommand.java | 4 +-- .../dungeonsxl/command/ImportCommand.java | 4 +-- .../dungeonsxl/command/InviteCommand.java | 4 +-- .../dre2n/dungeonsxl/command/JoinCommand.java | 4 +-- .../dre2n/dungeonsxl/command/KickCommand.java | 4 +-- .../dungeonsxl/command/LeaveCommand.java | 4 +-- .../dre2n/dungeonsxl/command/ListCommand.java | 4 +-- .../dungeonsxl/command/LivesCommand.java | 4 +-- .../dre2n/dungeonsxl/command/MainCommand.java | 4 +-- .../dre2n/dungeonsxl/command/MsgCommand.java | 4 +-- .../dre2n/dungeonsxl/command/PlayCommand.java | 6 ++-- .../dungeonsxl/command/PortalCommand.java | 4 +-- .../dungeonsxl/command/ReloadCommand.java | 4 +-- .../command/ReloadCommandNoSpigot.java | 4 +-- .../dungeonsxl/command/RenameCommand.java | 4 +-- .../command/ResourcePackCommand.java | 4 +-- .../dre2n/dungeonsxl/command/SaveCommand.java | 4 +-- .../dungeonsxl/command/StatusCommand.java | 4 +-- .../dre2n/dungeonsxl/command/TestCommand.java | 6 ++-- .../dungeonsxl/command/UninviteCommand.java | 4 +-- .../global/GlobalProtectionListener.java | 4 +-- .../{DClasses.java => DClassCache.java} | 4 +-- .../dre2n/dungeonsxl/player/DGamePlayer.java | 4 +-- .../dungeonsxl/player/DGlobalPlayer.java | 6 ++-- .../dre2n/dungeonsxl/player/DGroup.java | 4 +-- .../{DPermissions.java => DPermission.java} | 34 +++++++++---------- .../dungeonsxl/player/DPlayerListener.java | 14 ++++---- .../dungeonsxl/player/SecureModeTask.java | 2 +- .../requirement/PermissionRequirement.java | 4 +-- .../dungeonsxl/reward/RewardListener.java | 4 +-- .../dre2n/dungeonsxl/sign/DSignListener.java | 4 +-- .../dungeonsxl/sign/DSignTypeDefault.java | 4 +-- .../github/dre2n/dungeonsxl/util/DColor.java | 3 +- 44 files changed, 118 insertions(+), 117 deletions(-) rename src/main/java/io/github/dre2n/dungeonsxl/player/{DClasses.java => DClassCache.java} (96%) rename src/main/java/io/github/dre2n/dungeonsxl/player/{DPermissions.java => DPermission.java} (85%) diff --git a/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java b/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java index 1f46d6a1..e8b35348 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java @@ -33,10 +33,10 @@ import io.github.dre2n.dungeonsxl.global.GlobalProtectionCache; import io.github.dre2n.dungeonsxl.loottable.DLootTableCache; import io.github.dre2n.dungeonsxl.mob.DMobTypeCache; import io.github.dre2n.dungeonsxl.mob.ExternalMobProviderCache; -import io.github.dre2n.dungeonsxl.player.DClasses; +import io.github.dre2n.dungeonsxl.player.DClassCache; import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGroup; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.player.DPlayerCache; import io.github.dre2n.dungeonsxl.requirement.RequirementTypeCache; import io.github.dre2n.dungeonsxl.reward.RewardTypeCache; @@ -89,7 +89,7 @@ public class DungeonsXL extends DREPlugin { private ExternalMobProviderCache dMobProviders; private DPlayerCache dPlayers; private AnnouncerCache announcers; - private DClasses dClasses; + private DClassCache dClasses; private DLootTableCache dLootTables; private DMobTypeCache dMobTypes; private SignScriptCache signScripts; @@ -122,7 +122,7 @@ public class DungeonsXL extends DREPlugin { super.onEnable(); instance = this; - DPermissions.register(); + DPermission.register(); initFolders(); loadCore(); loadData(); @@ -476,7 +476,7 @@ public class DungeonsXL extends DREPlugin { /** * @return the loaded instance of DClasseCache */ - public DClasses getDClasses() { + public DClassCache getDClasses() { return dClasses; } @@ -484,7 +484,7 @@ public class DungeonsXL extends DREPlugin { * load / reload a new instance of DClasseCache */ public void loadDClasses(File file) { - dClasses = new DClasses(file); + dClasses = new DClassCache(file); } /** diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java index fab031bf..d2d747b8 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java @@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -35,7 +35,7 @@ public class BreakCommand extends DRECommand { setMinArgs(0); setMaxArgs(0); setHelp(DMessage.HELP_CMD_BREAK.getMessage()); - setPermission(DPermissions.BREAK.getNode()); + setPermission(DPermission.BREAK.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java index 0e936620..36277ca2 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java @@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGroup; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -36,7 +36,7 @@ public class ChatCommand extends DRECommand { setMinArgs(0); setMaxArgs(0); setHelp(DMessage.HELP_CMD_CHAT.getMessage()); - setPermission(DPermissions.CHAT.getNode()); + setPermission(DPermission.CHAT.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java index 4c45ce21..d8aa2e52 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java @@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -35,7 +35,7 @@ public class ChatSpyCommand extends DRECommand { setMinArgs(0); setMaxArgs(0); setHelp(DMessage.HELP_CMD_CHATSPY.getMessage()); - setPermission(DPermissions.CHAT_SPY.getNode()); + setPermission(DPermission.CHAT_SPY.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java index eda2b7c6..dc6960b9 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java @@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DEditPlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DEditWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld; import java.io.File; @@ -42,7 +42,7 @@ public class CreateCommand extends DRECommand { setMaxArgs(1); setCommand("create"); setHelp(DMessage.HELP_CMD_CREATE.getMessage()); - setPermission(DPermissions.CREATE.getNode()); + setPermission(DPermission.CREATE.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java index c06985c6..847e2455 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/DeleteCommand.java @@ -22,7 +22,7 @@ import io.github.dre2n.commons.compatibility.CompatibilityHandler; import io.github.dre2n.commons.misc.FileUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DEditWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld; import io.github.dre2n.dungeonsxl.world.DWorldCache; @@ -42,7 +42,7 @@ public class DeleteCommand extends DRECommand { setMinArgs(1); setMaxArgs(2); setHelp(DMessage.HELP_CMD_DELETE.getMessage()); - setPermission(DPermissions.DELETE.getNode()); + setPermission(DPermission.DELETE.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java index ceb1ddee..b551c685 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java @@ -24,7 +24,7 @@ import io.github.dre2n.dungeonsxl.player.DEditPlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DInstancePlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DEditWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld; import io.github.dre2n.dungeonsxl.world.DWorldCache; @@ -62,7 +62,7 @@ public class EditCommand extends DRECommand { return; } - if (!resource.isInvitedPlayer(player) && !DPermissions.hasPermission(player, DPermissions.EDIT)) { + if (!resource.isInvitedPlayer(player) && !DPermission.hasPermission(player, DPermission.EDIT)) { MessageUtil.sendMessage(player, DMessage.ERROR_NO_PERMISSIONS.getMessage()); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java index b136f860..99ddfdf1 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java @@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.game.Game; import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGroup; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -37,7 +37,7 @@ public class EnterCommand extends DRECommand { setMaxArgs(2); setCommand("enter"); setHelp(DMessage.HELP_CMD_ENTER.getMessage()); - setPermission(DPermissions.ENTER.getNode()); + setPermission(DPermission.ENTER.getNode()); setPlayerCommand(true); } @@ -76,7 +76,7 @@ public class EnterCommand extends DRECommand { joining = new DGroup(captain, game.getDungeon()); } - if (joining.getCaptain() != captain && !DPermissions.hasPermission(sender, DPermissions.BYPASS)) { + if (joining.getCaptain() != captain && !DPermission.hasPermission(sender, DPermission.BYPASS)) { MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_CAPTAIN.getMessage()); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java index 8979f665..b024b37b 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java @@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DEditPlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGroup; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DEditWorld; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -37,7 +37,7 @@ public class EscapeCommand extends DRECommand { setMinArgs(0); setMaxArgs(0); setHelp(DMessage.HELP_CMD_ESCAPE.getMessage()); - setPermission(DPermissions.ESCAPE.getNode()); + setPermission(DPermission.ESCAPE.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java index 1ca2ef23..2673921d 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java @@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.game.Game; import io.github.dre2n.dungeonsxl.player.DGroup; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DGameWorld; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -36,7 +36,7 @@ public class GameCommand extends DRECommand { setMinArgs(0); setMaxArgs(0); setHelp(DMessage.HELP_CMD_GAME.getMessage()); - setPermission(DPermissions.GAME.getNode()); + setPermission(DPermission.GAME.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java index c7457bd7..5892d633 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java @@ -25,7 +25,7 @@ import io.github.dre2n.dungeonsxl.event.dgroup.DGroupDisbandEvent; import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerKickEvent; import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGroup; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -40,7 +40,7 @@ public class GroupCommand extends DRECommand { setMinArgs(0); setMaxArgs(2); setHelp(DMessage.HELP_CMD_GROUP.getMessage()); - setPermission(DPermissions.GROUP.getNode()); + setPermission(DPermission.GROUP.getNode()); setPlayerCommand(true); } @@ -89,7 +89,7 @@ public class GroupCommand extends DRECommand { createGroup(); return; - } else if (args[1].equalsIgnoreCase("disband") && DPermissions.hasPermission(sender, DPermissions.GROUP_ADMIN)) { + } else if (args[1].equalsIgnoreCase("disband") && DPermission.hasPermission(sender, DPermission.GROUP_ADMIN)) { disbandGroup(DGroup.getByName(args[2])); return; @@ -97,7 +97,7 @@ public class GroupCommand extends DRECommand { joinGroup(DGroup.getByName(args[2])); return; - } else if (args[1].equalsIgnoreCase("show") && DPermissions.hasPermission(sender, DPermissions.GROUP_ADMIN)) { + } else if (args[1].equalsIgnoreCase("show") && DPermission.hasPermission(sender, DPermission.GROUP_ADMIN)) { DGroup group = DGroup.getByName(args[2]); Player player = Bukkit.getPlayer(args[2]); if (group == null && player != null) { @@ -206,7 +206,7 @@ public class GroupCommand extends DRECommand { return; } - if (!dGroup.getInvitedPlayers().contains(player) && !DPermissions.hasPermission(player, DPermissions.BYPASS)) { + if (!dGroup.getInvitedPlayers().contains(player) && !DPermission.hasPermission(player, DPermission.BYPASS)) { MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_INVITED.getMessage(args[2])); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java index e3e75e55..22dfbafb 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java @@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.commons.misc.NumberUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import java.util.ArrayList; import java.util.Set; import org.bukkit.command.CommandSender; @@ -38,7 +38,7 @@ public class HelpCommand extends DRECommand { setMinArgs(0); setMaxArgs(1); setHelp(DMessage.HELP_CMD_HELP.getMessage()); - setPermission(DPermissions.HELP.getNode()); + setPermission(DPermission.HELP.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java index 765f3be4..b93ac20b 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ImportCommand.java @@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.commons.misc.FileUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DResourceWorld; import java.io.File; import org.bukkit.Bukkit; @@ -41,7 +41,7 @@ public class ImportCommand extends DRECommand { setMaxArgs(1); setCommand("import"); setHelp(DMessage.HELP_CMD_IMPORT.getMessage()); - setPermission(DPermissions.IMPORT.getNode()); + setPermission(DPermission.IMPORT.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java index 40e3a15b..907c622c 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java @@ -20,7 +20,7 @@ import io.github.dre2n.commons.chat.MessageUtil; import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DResourceWorld; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; @@ -36,7 +36,7 @@ public class InviteCommand extends DRECommand { setMaxArgs(2); setCommand("invite"); setHelp(DMessage.HELP_CMD_INVITE.getMessage()); - setPermission(DPermissions.INVITE.getNode()); + setPermission(DPermission.INVITE.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java index f03b649d..96aa7b86 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/JoinCommand.java @@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.announcer.Announcer; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DInstancePlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -37,7 +37,7 @@ public class JoinCommand extends DRECommand { setMinArgs(1); setMaxArgs(1); setHelp(DMessage.HELP_CMD_JOIN.getMessage()); - setPermission(DPermissions.JOIN.getNode()); + setPermission(DPermission.JOIN.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java index 0361b20b..e88ff930 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/KickCommand.java @@ -20,7 +20,7 @@ import io.github.dre2n.commons.chat.MessageUtil; import io.github.dre2n.commons.command.DRECommand; import static io.github.dre2n.dungeonsxl.command.DCommandCache.LEAVE; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -35,7 +35,7 @@ public class KickCommand extends DRECommand { setMinArgs(1); setMaxArgs(1); setHelp(DMessage.HELP_CMD_KICK.getMessage()); - setPermission(DPermissions.KICK.getNode()); + setPermission(DPermission.KICK.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java index 35a3f0b2..9a7ff924 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java @@ -28,7 +28,7 @@ import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DInstancePlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -43,7 +43,7 @@ public class LeaveCommand extends DRECommand { setMinArgs(0); setMaxArgs(0); setHelp(DMessage.HELP_CMD_LEAVE.getMessage()); - setPermission(DPermissions.LEAVE.getNode()); + setPermission(DPermission.LEAVE.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java index 49fbfbcf..2d883e09 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java @@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.dungeon.Dungeon; import io.github.dre2n.dungeonsxl.dungeon.DungeonConfig; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DEditWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld; @@ -46,7 +46,7 @@ public class ListCommand extends DRECommand { setMinArgs(0); setMaxArgs(3); setHelp(DMessage.HELP_CMD_LIST.getMessage()); - setPermission(DPermissions.LIST.getNode()); + setPermission(DPermission.LIST.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java index 2f232c9a..06f23a8a 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java @@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGroup; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -36,7 +36,7 @@ public class LivesCommand extends DRECommand { setMinArgs(0); setMaxArgs(1); setHelp(DMessage.HELP_CMD_LIVES.getMessage()); - setPermission(DPermissions.LIVES.getNode()); + setPermission(DPermission.LIVES.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java index c2bf328c..0fa66edc 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java @@ -23,7 +23,7 @@ import io.github.dre2n.commons.compatibility.CompatibilityHandler; import io.github.dre2n.commons.compatibility.Internals; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.plugin.PluginManager; @@ -38,7 +38,7 @@ public class MainCommand extends DRECommand { public MainCommand() { setCommand("main"); setHelp(DMessage.HELP_CMD_MAIN.getMessage()); - setPermission(DPermissions.MAIN.getNode()); + setPermission(DPermission.MAIN.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java index d7b6ac02..9ace860b 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java @@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.chat.MessageUtil; import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DEditWorld; import io.github.dre2n.dungeonsxl.world.WorldConfig; import org.bukkit.ChatColor; @@ -36,7 +36,7 @@ public class MsgCommand extends DRECommand { setMaxArgs(-1); setCommand("msg"); setHelp(DMessage.HELP_CMD_MSG.getMessage()); - setPermission(DPermissions.MESSAGE.getNode()); + setPermission(DPermission.MESSAGE.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java index e169fef3..6cd87a1a 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java @@ -27,7 +27,7 @@ import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DInstancePlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DResourceWorld; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; @@ -45,7 +45,7 @@ public class PlayCommand extends DRECommand { setMinArgs(1); setMaxArgs(1); setHelp(DMessage.HELP_CMD_PLAY.getMessage()); - setPermission(DPermissions.PLAY.getNode()); + setPermission(DPermission.PLAY.getNode()); setPlayerCommand(true); setConsoleCommand(false); } @@ -83,7 +83,7 @@ public class PlayCommand extends DRECommand { dGroup = null; } } - if (!dGroup.getCaptain().equals(player) && !DPermissions.hasPermission(player, DPermissions.BYPASS)) { + if (!dGroup.getCaptain().equals(player) && !DPermission.hasPermission(player, DPermission.BYPASS)) { MessageUtil.sendMessage(player, DMessage.ERROR_NOT_CAPTAIN.getMessage()); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java index 2c7cc8b2..832c1017 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java @@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.global.DPortal; import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.Material; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -41,7 +41,7 @@ public class PortalCommand extends DRECommand { setMinArgs(0); setMaxArgs(1); setHelp(DMessage.HELP_CMD_PORTAL.getMessage()); - setPermission(DPermissions.PORTAL.getNode()); + setPermission(DPermission.PORTAL.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java index aea0c431..fe18621e 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java @@ -25,7 +25,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.event.DataReloadEvent; import io.github.dre2n.dungeonsxl.player.DInstancePlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import java.util.List; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.TextComponent; @@ -46,7 +46,7 @@ public class ReloadCommand extends DRECommand { setMinArgs(0); setMaxArgs(1); setHelp(DMessage.HELP_CMD_RELOAD.getMessage()); - setPermission(DPermissions.RELOAD.getNode()); + setPermission(DPermission.RELOAD.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommandNoSpigot.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommandNoSpigot.java index 503d29fd..8cb6a7d1 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommandNoSpigot.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommandNoSpigot.java @@ -24,7 +24,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.event.DataReloadEvent; import io.github.dre2n.dungeonsxl.player.DInstancePlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; @@ -42,7 +42,7 @@ public class ReloadCommandNoSpigot extends DRECommand { setMinArgs(0); setMaxArgs(1); setHelp(DMessage.HELP_CMD_RELOAD.getMessage()); - setPermission(DPermissions.RELOAD.getNode()); + setPermission(DPermission.RELOAD.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java index 8d0929fb..484c6574 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/RenameCommand.java @@ -25,7 +25,7 @@ import io.github.dre2n.dungeonsxl.dungeon.DungeonConfig; import io.github.dre2n.dungeonsxl.global.GameSign; import io.github.dre2n.dungeonsxl.global.GlobalProtection; import io.github.dre2n.dungeonsxl.global.GroupSign; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DResourceWorld; import java.io.File; import java.io.IOException; @@ -45,7 +45,7 @@ public class RenameCommand extends DRECommand { setMinArgs(2); setMaxArgs(2); setHelp(DMessage.HELP_CMD_RENAME.getMessage()); - setPermission(DPermissions.RENAME.getNode()); + setPermission(DPermission.RENAME.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java index 63730bc0..44387de6 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ResourcePackCommand.java @@ -20,7 +20,7 @@ import io.github.dre2n.commons.chat.MessageUtil; import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -34,7 +34,7 @@ public class ResourcePackCommand extends DRECommand { setMinArgs(1); setMaxArgs(1); setHelp(DMessage.HELP_CMD_RESOURCE_PACK.getMessage()); - setPermission(DPermissions.RESOURCE_PACK.getNode()); + setPermission(DPermission.RESOURCE_PACK.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java index aa51d585..6b41dd06 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java @@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.MainConfig; import io.github.dre2n.dungeonsxl.config.MainConfig.BackupMode; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DEditWorld; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -39,7 +39,7 @@ public class SaveCommand extends DRECommand { setMinArgs(0); setMaxArgs(0); setHelp(DMessage.HELP_CMD_SAVE.getMessage()); - setPermission(DPermissions.SAVE.getNode()); + setPermission(DPermission.SAVE.getNode()); setPlayerCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java index f5c3bace..69859996 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/StatusCommand.java @@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.commons.compatibility.CompatibilityHandler; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; @@ -45,7 +45,7 @@ public class StatusCommand extends DRECommand { setMinArgs(0); setMaxArgs(0); setHelp(DMessage.HELP_CMD_STATUS.getMessage()); - setPermission(DPermissions.STATUS.getNode()); + setPermission(DPermission.STATUS.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java index db7c7938..eb23debb 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java @@ -27,7 +27,7 @@ import io.github.dre2n.dungeonsxl.player.DEditPlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGroup; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld; import org.bukkit.command.CommandSender; @@ -43,7 +43,7 @@ public class TestCommand extends DRECommand { setMinArgs(0); setMaxArgs(0); setHelp(DMessage.HELP_CMD_TEST.getMessage()); - setPermission(DPermissions.TEST.getNode()); + setPermission(DPermission.TEST.getNode()); setPlayerCommand(true); setConsoleCommand(false); } @@ -60,7 +60,7 @@ public class TestCommand extends DRECommand { return; } - if (!dGroup.getCaptain().equals(player) && !DPermissions.hasPermission(player, DPermissions.BYPASS)) { + if (!dGroup.getCaptain().equals(player) && !DPermission.hasPermission(player, DPermission.BYPASS)) { MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_CAPTAIN.getMessage()); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java index 3d560949..4f34a525 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java @@ -20,7 +20,7 @@ import io.github.dre2n.commons.chat.MessageUtil; import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DResourceWorld; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; @@ -36,7 +36,7 @@ public class UninviteCommand extends DRECommand { setMinArgs(2); setMaxArgs(2); setHelp(DMessage.HELP_CMD_UNINVITE.getMessage()); - setPermission(DPermissions.UNINVITE.getNode()); + setPermission(DPermission.UNINVITE.getNode()); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java index c9b70806..5415531f 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GlobalProtectionListener.java @@ -20,7 +20,7 @@ import io.github.dre2n.commons.misc.NumberUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.world.DEditWorld; import java.util.List; import org.bukkit.Material; @@ -213,7 +213,7 @@ public class GlobalProtectionListener implements Listener { // Group Signs if (DEditWorld.getByWorld(player.getWorld()) == null) { - if (!DPermissions.hasPermission(player, DPermissions.SIGN)) { + if (!DPermission.hasPermission(player, DPermission.SIGN)) { return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DClasses.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DClassCache.java similarity index 96% rename from src/main/java/io/github/dre2n/dungeonsxl/player/DClasses.java rename to src/main/java/io/github/dre2n/dungeonsxl/player/DClassCache.java index 633d4eb5..83bf7f97 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DClasses.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DClassCache.java @@ -26,11 +26,11 @@ import java.util.List; * * @author Daniel Saukel */ -public class DClasses { +public class DClassCache { private List dClasses = new ArrayList<>(); - public DClasses(File file) { + public DClassCache(File file) { if (file.isDirectory()) { for (File script : FileUtil.getFilesForFolder(file)) { dClasses.add(new DClass(script)); diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java index 268645e5..55bc970c 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DGamePlayer.java @@ -591,7 +591,7 @@ public class DGamePlayer extends DInstancePlayer { } public boolean checkRequirements(Game game) { - if (DPermissions.hasPermission(player, DPermissions.IGNORE_REQUIREMENTS)) { + if (DPermission.hasPermission(player, DPermission.IGNORE_REQUIREMENTS)) { return true; } @@ -669,7 +669,7 @@ public class DGamePlayer extends DInstancePlayer { } public boolean checkTime(Game game) { - if (DPermissions.hasPermission(player, DPermissions.IGNORE_TIME_LIMIT)) { + if (DPermission.hasPermission(player, DPermission.IGNORE_TIME_LIMIT)) { return true; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java index bf041f8d..7ab0387b 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DGlobalPlayer.java @@ -269,8 +269,8 @@ public class DGlobalPlayer implements PlayerWrapper { * the permission to check * @return if the player has the permission */ - public boolean hasPermission(DPermissions permission) { - return DPermissions.hasPermission(player, permission); + public boolean hasPermission(DPermission permission) { + return DPermission.hasPermission(player, permission); } /** @@ -301,7 +301,7 @@ public class DGlobalPlayer implements PlayerWrapper { * @return if the player has the permission */ public boolean hasPermission(String permission) { - return DPermissions.hasPermission(player, permission); + return DPermission.hasPermission(player, permission); } /* Actions */ diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java index f10df5c4..47580f15 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java @@ -882,7 +882,7 @@ public class DGroup { } public boolean checkTime(Game game) { - if (DPermissions.hasPermission(getCaptain(), DPermissions.IGNORE_TIME_LIMIT)) { + if (DPermission.hasPermission(getCaptain(), DPermission.IGNORE_TIME_LIMIT)) { return true; } @@ -896,7 +896,7 @@ public class DGroup { } public boolean checkRequirements(Game game) { - if (DPermissions.hasPermission(getCaptain(), DPermissions.IGNORE_REQUIREMENTS)) { + if (DPermission.hasPermission(getCaptain(), DPermission.IGNORE_REQUIREMENTS)) { return true; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DPermissions.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DPermission.java similarity index 85% rename from src/main/java/io/github/dre2n/dungeonsxl/player/DPermissions.java rename to src/main/java/io/github/dre2n/dungeonsxl/player/DPermission.java index bde2d050..b906a9e5 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DPermissions.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DPermission.java @@ -29,7 +29,7 @@ import static org.bukkit.permissions.PermissionDefault.*; /** * @author Daniel Saukel */ -public enum DPermissions { +public enum DPermission { // Main nodes BREAK("break", OP), @@ -96,14 +96,14 @@ public enum DPermissions { private String node; private PermissionDefault isDefault; - private List children = new ArrayList<>(); + private List children = new ArrayList<>(); - DPermissions(String node, PermissionDefault isDefault) { + DPermission(String node, PermissionDefault isDefault) { this.node = node; this.isDefault = isDefault; } - DPermissions(String node, PermissionDefault isDefault, DPermissions... children) { + DPermission(String node, PermissionDefault isDefault, DPermission... children) { this(node, isDefault); this.children = Arrays.asList(children); } @@ -132,7 +132,7 @@ public enum DPermissions { /** * @return the child permissions */ - public List getChildren() { + public List getChildren() { return children; } @@ -140,10 +140,10 @@ public enum DPermissions { * @param node * the node String, with or without "dxl." * @return - * the DPermissions value + * the DPermission value */ - public static DPermissions getByNode(String node) { - for (DPermissions permission : values()) { + public static DPermission getByNode(String node) { + for (DPermission permission : values()) { if (permission.getNode().equals(node) || permission.node.equals(node)) { return permission; } @@ -157,12 +157,12 @@ public enum DPermissions { * the permission to check * @return if the player has the permission */ - public static boolean hasPermission(CommandSender sender, DPermissions permission) { + public static boolean hasPermission(CommandSender sender, DPermission permission) { if (sender.hasPermission(permission.getNode())) { return true; } - for (DPermissions parent : DPermissions.values()) { + for (DPermission parent : DPermission.values()) { if (parent.getChildren().contains(permission) && sender.hasPermission(parent.getNode())) { return true; } @@ -181,19 +181,19 @@ public enum DPermissions { return true; } - DPermissions dPermission = null; - if (EnumUtil.isValidEnum(DPermissions.class, permission)) { - dPermission = DPermissions.valueOf(permission); + DPermission dPermission = null; + if (EnumUtil.isValidEnum(DPermission.class, permission)) { + dPermission = DPermission.valueOf(permission); - } else if (DPermissions.getByNode(permission) != null) { - dPermission = DPermissions.getByNode(permission); + } else if (DPermission.getByNode(permission) != null) { + dPermission = DPermission.getByNode(permission); } if (dPermission == null) { return false; } - for (DPermissions parent : DPermissions.values()) { + for (DPermission parent : DPermission.values()) { if (parent.getChildren().contains(dPermission) && sender.hasPermission(parent.getNode())) { return true; } @@ -206,7 +206,7 @@ public enum DPermissions { * Registers the permissions. */ public static void register() { - for (DPermissions permission : values()) { + for (DPermission permission : values()) { Bukkit.getPluginManager().addPermission(new Permission(permission.getNode(), permission.isDefault())); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java index e7f2ba05..2a8fb4ff 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayerListener.java @@ -245,7 +245,7 @@ public class DPlayerListener implements Listener { return; } - if (DPermissions.hasPermission(player, DPermissions.BYPASS)) { + if (DPermission.hasPermission(player, DPermission.BYPASS)) { return; } @@ -260,7 +260,7 @@ public class DPlayerListener implements Listener { Game game = Game.getByWorld(dPlayer.getWorld()); if (dPlayer instanceof DEditPlayer) { - if (DPermissions.hasPermission(player, DPermissions.CMD_EDIT)) { + if (DPermission.hasPermission(player, DPermission.CMD_EDIT)) { return; } else { @@ -315,7 +315,7 @@ public class DPlayerListener implements Listener { return; } - if (dPlayer instanceof DEditPlayer && !config.getDropItems() && !DPermissions.hasPermission(player, DPermissions.INSECURE)) { + if (dPlayer instanceof DEditPlayer && !config.getDropItems() && !DPermission.hasPermission(player, DPermission.INSECURE)) { event.setCancelled(true); } @@ -532,7 +532,7 @@ public class DPlayerListener implements Listener { return; } - if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) { + if (!DPermission.hasPermission(player, DPermission.BYPASS)) { event.setCancelled(true); } } @@ -555,13 +555,13 @@ public class DPlayerListener implements Listener { if (dGameWorld != null || DEditWorld.getByWorld(player.getWorld()) != null) { if (event.getAction() != Action.LEFT_CLICK_BLOCK) { if (clickedBlock.getType() == Material.ENDER_CHEST) { - if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) { + if (!DPermission.hasPermission(player, DPermission.BYPASS)) { MessageUtil.sendMessage(player, DMessage.ERROR_ENDERCHEST.getMessage()); event.setCancelled(true); } } else if (clickedBlock.getType() == Material.BED_BLOCK) { - if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) { + if (!DPermission.hasPermission(player, DPermission.BYPASS)) { MessageUtil.sendMessage(player, DMessage.ERROR_BED.getMessage()); event.setCancelled(true); } @@ -573,7 +573,7 @@ public class DPlayerListener implements Listener { if (dGameWorld != null) { if (event.getAction() != Action.LEFT_CLICK_BLOCK) { if (clickedBlock.getType() == Material.DISPENSER) { - if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) { + if (!DPermission.hasPermission(player, DPermission.BYPASS)) { MessageUtil.sendMessage(player, DMessage.ERROR_DISPENSER.getMessage()); event.setCancelled(true); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java b/src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java index 7c38b976..0e894972 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/SecureModeTask.java @@ -35,7 +35,7 @@ public class SecureModeTask extends BukkitRunnable { } if (!(dGlobalPlayer instanceof DGamePlayer || dGlobalPlayer instanceof DEditPlayer)) { - if (player.getWorld().getName().startsWith("DXL_Game_") | player.getWorld().getName().startsWith("DXL_Edit_") && !DPermissions.hasPermission(player, DPermissions.INSECURE)) { + if (player.getWorld().getName().startsWith("DXL_Game_") | player.getWorld().getName().startsWith("DXL_Edit_") && !DPermission.hasPermission(player, DPermission.INSECURE)) { player.teleport(Bukkit.getWorlds().get(0).getSpawnLocation()); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/requirement/PermissionRequirement.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/PermissionRequirement.java index 746ee957..98e434fe 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/requirement/PermissionRequirement.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/requirement/PermissionRequirement.java @@ -16,7 +16,7 @@ */ package io.github.dre2n.dungeonsxl.requirement; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import java.util.ArrayList; import java.util.List; import org.bukkit.configuration.ConfigurationSection; @@ -61,7 +61,7 @@ public class PermissionRequirement extends Requirement { @Override public boolean check(Player player) { for (String permission : permissions) { - if (!DPermissions.hasPermission(player, permission)) { + if (!DPermission.hasPermission(player, permission)) { return false; } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java index 97682347..826299f5 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/RewardListener.java @@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.reward; import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.util.PageGUI; import io.github.dre2n.dungeonsxl.world.DEditWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld; @@ -97,7 +97,7 @@ public class RewardListener implements Listener { event.setCancelled(true); } - if (!plugin.getMainConfig().getOpenInventories() && !DPermissions.hasPermission(event.getPlayer(), DPermissions.INSECURE)) { + if (!plugin.getMainConfig().getOpenInventories() && !DPermission.hasPermission(event.getPlayer(), DPermission.INSECURE)) { World world = event.getPlayer().getWorld(); if (event.getInventory().getType() != InventoryType.CREATIVE && DEditWorld.getByWorld(world) != null) { event.setCancelled(true); diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java index 5dbaa9b7..ad9531a0 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignListener.java @@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.sign; import io.github.dre2n.commons.chat.MessageUtil; import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.player.DGamePlayer; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; import io.github.dre2n.dungeonsxl.world.DEditWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld; @@ -97,7 +97,7 @@ public class DSignListener implements Listener { return; } - if (!DPermissions.hasPermission(player, dsign.getType().getBuildPermission())) { + if (!DPermission.hasPermission(player, dsign.getType().getBuildPermission())) { MessageUtil.sendMessage(player, DMessage.ERROR_NO_PERMISSIONS.getMessage()); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java index 57c6e5d9..6b9494dc 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/DSignTypeDefault.java @@ -16,7 +16,7 @@ */ package io.github.dre2n.dungeonsxl.sign; -import io.github.dre2n.dungeonsxl.player.DPermissions; +import io.github.dre2n.dungeonsxl.player.DPermission; import io.github.dre2n.dungeonsxl.sign.lobby.ClassesSign; import io.github.dre2n.dungeonsxl.sign.lobby.LobbySign; import io.github.dre2n.dungeonsxl.sign.lobby.ReadySign; @@ -94,7 +94,7 @@ public enum DSignTypeDefault implements DSignType { @Override public String getBuildPermission() { - return DPermissions.SIGN.getNode() + "." + buildPermission; + return DPermission.SIGN.getNode() + "." + buildPermission; } @Override diff --git a/src/main/java/io/github/dre2n/dungeonsxl/util/DColor.java b/src/main/java/io/github/dre2n/dungeonsxl/util/DColor.java index b087c522..d587d33a 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/util/DColor.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/util/DColor.java @@ -18,7 +18,6 @@ package io.github.dre2n.dungeonsxl.util; import org.bukkit.ChatColor; import org.bukkit.DyeColor; -import org.bukkit.inventory.ItemStack; /** * Links different color types together. @@ -74,8 +73,10 @@ public enum DColor { } /** + * @deprecated Use getDyeColor() instead * @return the wool DV */ + @Deprecated public byte getWoolData() { return dye.getWoolData(); }