Rename some classes to keep

This commit is contained in:
Daniel Saukel 2017-11-16 18:25:10 +01:00
parent cb1a1cc56e
commit b565144bb2
44 changed files with 118 additions and 117 deletions

View File

@ -33,10 +33,10 @@ import io.github.dre2n.dungeonsxl.global.GlobalProtectionCache;
import io.github.dre2n.dungeonsxl.loottable.DLootTableCache; import io.github.dre2n.dungeonsxl.loottable.DLootTableCache;
import io.github.dre2n.dungeonsxl.mob.DMobTypeCache; import io.github.dre2n.dungeonsxl.mob.DMobTypeCache;
import io.github.dre2n.dungeonsxl.mob.ExternalMobProviderCache; 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.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; 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.player.DPlayerCache;
import io.github.dre2n.dungeonsxl.requirement.RequirementTypeCache; import io.github.dre2n.dungeonsxl.requirement.RequirementTypeCache;
import io.github.dre2n.dungeonsxl.reward.RewardTypeCache; import io.github.dre2n.dungeonsxl.reward.RewardTypeCache;
@ -89,7 +89,7 @@ public class DungeonsXL extends DREPlugin {
private ExternalMobProviderCache dMobProviders; private ExternalMobProviderCache dMobProviders;
private DPlayerCache dPlayers; private DPlayerCache dPlayers;
private AnnouncerCache announcers; private AnnouncerCache announcers;
private DClasses dClasses; private DClassCache dClasses;
private DLootTableCache dLootTables; private DLootTableCache dLootTables;
private DMobTypeCache dMobTypes; private DMobTypeCache dMobTypes;
private SignScriptCache signScripts; private SignScriptCache signScripts;
@ -122,7 +122,7 @@ public class DungeonsXL extends DREPlugin {
super.onEnable(); super.onEnable();
instance = this; instance = this;
DPermissions.register(); DPermission.register();
initFolders(); initFolders();
loadCore(); loadCore();
loadData(); loadData();
@ -476,7 +476,7 @@ public class DungeonsXL extends DREPlugin {
/** /**
* @return the loaded instance of DClasseCache * @return the loaded instance of DClasseCache
*/ */
public DClasses getDClasses() { public DClassCache getDClasses() {
return dClasses; return dClasses;
} }
@ -484,7 +484,7 @@ public class DungeonsXL extends DREPlugin {
* load / reload a new instance of DClasseCache * load / reload a new instance of DClasseCache
*/ */
public void loadDClasses(File file) { public void loadDClasses(File file) {
dClasses = new DClasses(file); dClasses = new DClassCache(file);
} }
/** /**

View File

@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; 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.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -35,7 +35,7 @@ public class BreakCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(0); setMaxArgs(0);
setHelp(DMessage.HELP_CMD_BREAK.getMessage()); setHelp(DMessage.HELP_CMD_BREAK.getMessage());
setPermission(DPermissions.BREAK.getNode()); setPermission(DPermission.BREAK.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; 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.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -36,7 +36,7 @@ public class ChatCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(0); setMaxArgs(0);
setHelp(DMessage.HELP_CMD_CHAT.getMessage()); setHelp(DMessage.HELP_CMD_CHAT.getMessage());
setPermission(DPermissions.CHAT.getNode()); setPermission(DPermission.CHAT.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; 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.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -35,7 +35,7 @@ public class ChatSpyCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(0); setMaxArgs(0);
setHelp(DMessage.HELP_CMD_CHATSPY.getMessage()); setHelp(DMessage.HELP_CMD_CHATSPY.getMessage());
setPermission(DPermissions.CHAT_SPY.getNode()); setPermission(DPermission.CHAT_SPY.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DEditPlayer; import io.github.dre2n.dungeonsxl.player.DEditPlayer;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; 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.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DResourceWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld;
import java.io.File; import java.io.File;
@ -42,7 +42,7 @@ public class CreateCommand extends DRECommand {
setMaxArgs(1); setMaxArgs(1);
setCommand("create"); setCommand("create");
setHelp(DMessage.HELP_CMD_CREATE.getMessage()); setHelp(DMessage.HELP_CMD_CREATE.getMessage());
setPermission(DPermissions.CREATE.getNode()); setPermission(DPermission.CREATE.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -22,7 +22,7 @@ import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.misc.FileUtil; import io.github.dre2n.commons.misc.FileUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; 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.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DResourceWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld;
import io.github.dre2n.dungeonsxl.world.DWorldCache; import io.github.dre2n.dungeonsxl.world.DWorldCache;
@ -42,7 +42,7 @@ public class DeleteCommand extends DRECommand {
setMinArgs(1); setMinArgs(1);
setMaxArgs(2); setMaxArgs(2);
setHelp(DMessage.HELP_CMD_DELETE.getMessage()); setHelp(DMessage.HELP_CMD_DELETE.getMessage());
setPermission(DPermissions.DELETE.getNode()); setPermission(DPermission.DELETE.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -24,7 +24,7 @@ import io.github.dre2n.dungeonsxl.player.DEditPlayer;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DGroup;
import io.github.dre2n.dungeonsxl.player.DInstancePlayer; 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.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DResourceWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld;
import io.github.dre2n.dungeonsxl.world.DWorldCache; import io.github.dre2n.dungeonsxl.world.DWorldCache;
@ -62,7 +62,7 @@ public class EditCommand extends DRECommand {
return; 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()); MessageUtil.sendMessage(player, DMessage.ERROR_NO_PERMISSIONS.getMessage());
return; return;
} }

View File

@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.game.Game; import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; 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.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -37,7 +37,7 @@ public class EnterCommand extends DRECommand {
setMaxArgs(2); setMaxArgs(2);
setCommand("enter"); setCommand("enter");
setHelp(DMessage.HELP_CMD_ENTER.getMessage()); setHelp(DMessage.HELP_CMD_ENTER.getMessage());
setPermission(DPermissions.ENTER.getNode()); setPermission(DPermission.ENTER.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }
@ -76,7 +76,7 @@ public class EnterCommand extends DRECommand {
joining = new DGroup(captain, game.getDungeon()); 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()); MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_CAPTAIN.getMessage());
return; return;
} }

View File

@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DEditPlayer; import io.github.dre2n.dungeonsxl.player.DEditPlayer;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; 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 io.github.dre2n.dungeonsxl.world.DEditWorld;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -37,7 +37,7 @@ public class EscapeCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(0); setMaxArgs(0);
setHelp(DMessage.HELP_CMD_ESCAPE.getMessage()); setHelp(DMessage.HELP_CMD_ESCAPE.getMessage());
setPermission(DPermissions.ESCAPE.getNode()); setPermission(DPermission.ESCAPE.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.game.Game; import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.player.DGroup; 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.DGameWorld;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -36,7 +36,7 @@ public class GameCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(0); setMaxArgs(0);
setHelp(DMessage.HELP_CMD_GAME.getMessage()); setHelp(DMessage.HELP_CMD_GAME.getMessage());
setPermission(DPermissions.GAME.getNode()); setPermission(DPermission.GAME.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -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.event.dplayer.DPlayerKickEvent;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; 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.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -40,7 +40,7 @@ public class GroupCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(2); setMaxArgs(2);
setHelp(DMessage.HELP_CMD_GROUP.getMessage()); setHelp(DMessage.HELP_CMD_GROUP.getMessage());
setPermission(DPermissions.GROUP.getNode()); setPermission(DPermission.GROUP.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }
@ -89,7 +89,7 @@ public class GroupCommand extends DRECommand {
createGroup(); createGroup();
return; 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])); disbandGroup(DGroup.getByName(args[2]));
return; return;
@ -97,7 +97,7 @@ public class GroupCommand extends DRECommand {
joinGroup(DGroup.getByName(args[2])); joinGroup(DGroup.getByName(args[2]));
return; 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]); DGroup group = DGroup.getByName(args[2]);
Player player = Bukkit.getPlayer(args[2]); Player player = Bukkit.getPlayer(args[2]);
if (group == null && player != null) { if (group == null && player != null) {
@ -206,7 +206,7 @@ public class GroupCommand extends DRECommand {
return; 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])); MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_INVITED.getMessage(args[2]));
return; return;
} }

View File

@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.commons.misc.NumberUtil; import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; 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.ArrayList;
import java.util.Set; import java.util.Set;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -38,7 +38,7 @@ public class HelpCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(1); setMaxArgs(1);
setHelp(DMessage.HELP_CMD_HELP.getMessage()); setHelp(DMessage.HELP_CMD_HELP.getMessage());
setPermission(DPermissions.HELP.getNode()); setPermission(DPermission.HELP.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.commons.misc.FileUtil; import io.github.dre2n.commons.misc.FileUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; 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 io.github.dre2n.dungeonsxl.world.DResourceWorld;
import java.io.File; import java.io.File;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -41,7 +41,7 @@ public class ImportCommand extends DRECommand {
setMaxArgs(1); setMaxArgs(1);
setCommand("import"); setCommand("import");
setHelp(DMessage.HELP_CMD_IMPORT.getMessage()); setHelp(DMessage.HELP_CMD_IMPORT.getMessage());
setPermission(DPermissions.IMPORT.getNode()); setPermission(DPermission.IMPORT.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -20,7 +20,7 @@ import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; 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 io.github.dre2n.dungeonsxl.world.DResourceWorld;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
@ -36,7 +36,7 @@ public class InviteCommand extends DRECommand {
setMaxArgs(2); setMaxArgs(2);
setCommand("invite"); setCommand("invite");
setHelp(DMessage.HELP_CMD_INVITE.getMessage()); setHelp(DMessage.HELP_CMD_INVITE.getMessage());
setPermission(DPermissions.INVITE.getNode()); setPermission(DPermission.INVITE.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.announcer.Announcer;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DInstancePlayer; 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.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -37,7 +37,7 @@ public class JoinCommand extends DRECommand {
setMinArgs(1); setMinArgs(1);
setMaxArgs(1); setMaxArgs(1);
setHelp(DMessage.HELP_CMD_JOIN.getMessage()); setHelp(DMessage.HELP_CMD_JOIN.getMessage());
setPermission(DPermissions.JOIN.getNode()); setPermission(DPermission.JOIN.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -20,7 +20,7 @@ import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.commons.command.DRECommand;
import static io.github.dre2n.dungeonsxl.command.DCommandCache.LEAVE; import static io.github.dre2n.dungeonsxl.command.DCommandCache.LEAVE;
import io.github.dre2n.dungeonsxl.config.DMessage; 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.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -35,7 +35,7 @@ public class KickCommand extends DRECommand {
setMinArgs(1); setMinArgs(1);
setMaxArgs(1); setMaxArgs(1);
setHelp(DMessage.HELP_CMD_KICK.getMessage()); setHelp(DMessage.HELP_CMD_KICK.getMessage());
setPermission(DPermissions.KICK.getNode()); setPermission(DPermission.KICK.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -28,7 +28,7 @@ import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DGroup;
import io.github.dre2n.dungeonsxl.player.DInstancePlayer; 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.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -43,7 +43,7 @@ public class LeaveCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(0); setMaxArgs(0);
setHelp(DMessage.HELP_CMD_LEAVE.getMessage()); setHelp(DMessage.HELP_CMD_LEAVE.getMessage());
setPermission(DPermissions.LEAVE.getNode()); setPermission(DPermission.LEAVE.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.dungeon.Dungeon; import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
import io.github.dre2n.dungeonsxl.dungeon.DungeonConfig; 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.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld;
import io.github.dre2n.dungeonsxl.world.DResourceWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld;
@ -46,7 +46,7 @@ public class ListCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(3); setMaxArgs(3);
setHelp(DMessage.HELP_CMD_LIST.getMessage()); setHelp(DMessage.HELP_CMD_LIST.getMessage());
setPermission(DPermissions.LIST.getNode()); setPermission(DPermission.LIST.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; 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.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -36,7 +36,7 @@ public class LivesCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(1); setMaxArgs(1);
setHelp(DMessage.HELP_CMD_LIVES.getMessage()); setHelp(DMessage.HELP_CMD_LIVES.getMessage());
setPermission(DPermissions.LIVES.getNode()); setPermission(DPermission.LIVES.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -23,7 +23,7 @@ import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Internals; import io.github.dre2n.commons.compatibility.Internals;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; 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.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
@ -38,7 +38,7 @@ public class MainCommand extends DRECommand {
public MainCommand() { public MainCommand() {
setCommand("main"); setCommand("main");
setHelp(DMessage.HELP_CMD_MAIN.getMessage()); setHelp(DMessage.HELP_CMD_MAIN.getMessage());
setPermission(DPermissions.MAIN.getNode()); setPermission(DPermission.MAIN.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.command;
import io.github.dre2n.commons.chat.MessageUtil; import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.config.DMessage; 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.DEditWorld;
import io.github.dre2n.dungeonsxl.world.WorldConfig; import io.github.dre2n.dungeonsxl.world.WorldConfig;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -36,7 +36,7 @@ public class MsgCommand extends DRECommand {
setMaxArgs(-1); setMaxArgs(-1);
setCommand("msg"); setCommand("msg");
setHelp(DMessage.HELP_CMD_MSG.getMessage()); setHelp(DMessage.HELP_CMD_MSG.getMessage());
setPermission(DPermissions.MESSAGE.getNode()); setPermission(DPermission.MESSAGE.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -27,7 +27,7 @@ import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DGroup;
import io.github.dre2n.dungeonsxl.player.DInstancePlayer; 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 io.github.dre2n.dungeonsxl.world.DResourceWorld;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -45,7 +45,7 @@ public class PlayCommand extends DRECommand {
setMinArgs(1); setMinArgs(1);
setMaxArgs(1); setMaxArgs(1);
setHelp(DMessage.HELP_CMD_PLAY.getMessage()); setHelp(DMessage.HELP_CMD_PLAY.getMessage());
setPermission(DPermissions.PLAY.getNode()); setPermission(DPermission.PLAY.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(false); setConsoleCommand(false);
} }
@ -83,7 +83,7 @@ public class PlayCommand extends DRECommand {
dGroup = null; 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()); MessageUtil.sendMessage(player, DMessage.ERROR_NOT_CAPTAIN.getMessage());
return; return;
} }

View File

@ -23,7 +23,7 @@ import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.global.DPortal; import io.github.dre2n.dungeonsxl.global.DPortal;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; 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.Material;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -41,7 +41,7 @@ public class PortalCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(1); setMaxArgs(1);
setHelp(DMessage.HELP_CMD_PORTAL.getMessage()); setHelp(DMessage.HELP_CMD_PORTAL.getMessage());
setPermission(DPermissions.PORTAL.getNode()); setPermission(DPermission.PORTAL.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -25,7 +25,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.DataReloadEvent; import io.github.dre2n.dungeonsxl.event.DataReloadEvent;
import io.github.dre2n.dungeonsxl.player.DInstancePlayer; 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 java.util.List;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
@ -46,7 +46,7 @@ public class ReloadCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(1); setMaxArgs(1);
setHelp(DMessage.HELP_CMD_RELOAD.getMessage()); setHelp(DMessage.HELP_CMD_RELOAD.getMessage());
setPermission(DPermissions.RELOAD.getNode()); setPermission(DPermission.RELOAD.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -24,7 +24,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.event.DataReloadEvent; import io.github.dre2n.dungeonsxl.event.DataReloadEvent;
import io.github.dre2n.dungeonsxl.player.DInstancePlayer; 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 java.util.List;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -42,7 +42,7 @@ public class ReloadCommandNoSpigot extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(1); setMaxArgs(1);
setHelp(DMessage.HELP_CMD_RELOAD.getMessage()); setHelp(DMessage.HELP_CMD_RELOAD.getMessage());
setPermission(DPermissions.RELOAD.getNode()); setPermission(DPermission.RELOAD.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -25,7 +25,7 @@ import io.github.dre2n.dungeonsxl.dungeon.DungeonConfig;
import io.github.dre2n.dungeonsxl.global.GameSign; import io.github.dre2n.dungeonsxl.global.GameSign;
import io.github.dre2n.dungeonsxl.global.GlobalProtection; import io.github.dre2n.dungeonsxl.global.GlobalProtection;
import io.github.dre2n.dungeonsxl.global.GroupSign; 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 io.github.dre2n.dungeonsxl.world.DResourceWorld;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -45,7 +45,7 @@ public class RenameCommand extends DRECommand {
setMinArgs(2); setMinArgs(2);
setMaxArgs(2); setMaxArgs(2);
setHelp(DMessage.HELP_CMD_RENAME.getMessage()); setHelp(DMessage.HELP_CMD_RENAME.getMessage());
setPermission(DPermissions.RENAME.getNode()); setPermission(DPermission.RENAME.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -20,7 +20,7 @@ import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; 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.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -34,7 +34,7 @@ public class ResourcePackCommand extends DRECommand {
setMinArgs(1); setMinArgs(1);
setMaxArgs(1); setMaxArgs(1);
setHelp(DMessage.HELP_CMD_RESOURCE_PACK.getMessage()); setHelp(DMessage.HELP_CMD_RESOURCE_PACK.getMessage());
setPermission(DPermissions.RESOURCE_PACK.getNode()); setPermission(DPermission.RESOURCE_PACK.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -22,7 +22,7 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.config.MainConfig; import io.github.dre2n.dungeonsxl.config.MainConfig;
import io.github.dre2n.dungeonsxl.config.MainConfig.BackupMode; 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 io.github.dre2n.dungeonsxl.world.DEditWorld;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -39,7 +39,7 @@ public class SaveCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(0); setMaxArgs(0);
setHelp(DMessage.HELP_CMD_SAVE.getMessage()); setHelp(DMessage.HELP_CMD_SAVE.getMessage());
setPermission(DPermissions.SAVE.getNode()); setPermission(DPermission.SAVE.getNode());
setPlayerCommand(true); setPlayerCommand(true);
} }

View File

@ -21,7 +21,7 @@ import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.commons.compatibility.CompatibilityHandler; import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; 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.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -45,7 +45,7 @@ public class StatusCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(0); setMaxArgs(0);
setHelp(DMessage.HELP_CMD_STATUS.getMessage()); setHelp(DMessage.HELP_CMD_STATUS.getMessage());
setPermission(DPermissions.STATUS.getNode()); setPermission(DPermission.STATUS.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -27,7 +27,7 @@ import io.github.dre2n.dungeonsxl.player.DEditPlayer;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
import io.github.dre2n.dungeonsxl.player.DGroup; 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.DGameWorld;
import io.github.dre2n.dungeonsxl.world.DResourceWorld; import io.github.dre2n.dungeonsxl.world.DResourceWorld;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -43,7 +43,7 @@ public class TestCommand extends DRECommand {
setMinArgs(0); setMinArgs(0);
setMaxArgs(0); setMaxArgs(0);
setHelp(DMessage.HELP_CMD_TEST.getMessage()); setHelp(DMessage.HELP_CMD_TEST.getMessage());
setPermission(DPermissions.TEST.getNode()); setPermission(DPermission.TEST.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(false); setConsoleCommand(false);
} }
@ -60,7 +60,7 @@ public class TestCommand extends DRECommand {
return; 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()); MessageUtil.sendMessage(sender, DMessage.ERROR_NOT_CAPTAIN.getMessage());
return; return;
} }

View File

@ -20,7 +20,7 @@ import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.commons.command.DRECommand; import io.github.dre2n.commons.command.DRECommand;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; 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 io.github.dre2n.dungeonsxl.world.DResourceWorld;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
@ -36,7 +36,7 @@ public class UninviteCommand extends DRECommand {
setMinArgs(2); setMinArgs(2);
setMaxArgs(2); setMaxArgs(2);
setHelp(DMessage.HELP_CMD_UNINVITE.getMessage()); setHelp(DMessage.HELP_CMD_UNINVITE.getMessage());
setPermission(DPermissions.UNINVITE.getNode()); setPermission(DPermission.UNINVITE.getNode());
setPlayerCommand(true); setPlayerCommand(true);
setConsoleCommand(true); setConsoleCommand(true);
} }

View File

@ -20,7 +20,7 @@ import io.github.dre2n.commons.misc.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; 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 io.github.dre2n.dungeonsxl.world.DEditWorld;
import java.util.List; import java.util.List;
import org.bukkit.Material; import org.bukkit.Material;
@ -213,7 +213,7 @@ public class GlobalProtectionListener implements Listener {
// Group Signs // Group Signs
if (DEditWorld.getByWorld(player.getWorld()) == null) { if (DEditWorld.getByWorld(player.getWorld()) == null) {
if (!DPermissions.hasPermission(player, DPermissions.SIGN)) { if (!DPermission.hasPermission(player, DPermission.SIGN)) {
return; return;
} }

View File

@ -26,11 +26,11 @@ import java.util.List;
* *
* @author Daniel Saukel * @author Daniel Saukel
*/ */
public class DClasses { public class DClassCache {
private List<DClass> dClasses = new ArrayList<>(); private List<DClass> dClasses = new ArrayList<>();
public DClasses(File file) { public DClassCache(File file) {
if (file.isDirectory()) { if (file.isDirectory()) {
for (File script : FileUtil.getFilesForFolder(file)) { for (File script : FileUtil.getFilesForFolder(file)) {
dClasses.add(new DClass(script)); dClasses.add(new DClass(script));

View File

@ -591,7 +591,7 @@ public class DGamePlayer extends DInstancePlayer {
} }
public boolean checkRequirements(Game game) { public boolean checkRequirements(Game game) {
if (DPermissions.hasPermission(player, DPermissions.IGNORE_REQUIREMENTS)) { if (DPermission.hasPermission(player, DPermission.IGNORE_REQUIREMENTS)) {
return true; return true;
} }
@ -669,7 +669,7 @@ public class DGamePlayer extends DInstancePlayer {
} }
public boolean checkTime(Game game) { public boolean checkTime(Game game) {
if (DPermissions.hasPermission(player, DPermissions.IGNORE_TIME_LIMIT)) { if (DPermission.hasPermission(player, DPermission.IGNORE_TIME_LIMIT)) {
return true; return true;
} }

View File

@ -269,8 +269,8 @@ public class DGlobalPlayer implements PlayerWrapper {
* the permission to check * the permission to check
* @return if the player has the permission * @return if the player has the permission
*/ */
public boolean hasPermission(DPermissions permission) { public boolean hasPermission(DPermission permission) {
return DPermissions.hasPermission(player, permission); return DPermission.hasPermission(player, permission);
} }
/** /**
@ -301,7 +301,7 @@ public class DGlobalPlayer implements PlayerWrapper {
* @return if the player has the permission * @return if the player has the permission
*/ */
public boolean hasPermission(String permission) { public boolean hasPermission(String permission) {
return DPermissions.hasPermission(player, permission); return DPermission.hasPermission(player, permission);
} }
/* Actions */ /* Actions */

View File

@ -882,7 +882,7 @@ public class DGroup {
} }
public boolean checkTime(Game game) { public boolean checkTime(Game game) {
if (DPermissions.hasPermission(getCaptain(), DPermissions.IGNORE_TIME_LIMIT)) { if (DPermission.hasPermission(getCaptain(), DPermission.IGNORE_TIME_LIMIT)) {
return true; return true;
} }
@ -896,7 +896,7 @@ public class DGroup {
} }
public boolean checkRequirements(Game game) { public boolean checkRequirements(Game game) {
if (DPermissions.hasPermission(getCaptain(), DPermissions.IGNORE_REQUIREMENTS)) { if (DPermission.hasPermission(getCaptain(), DPermission.IGNORE_REQUIREMENTS)) {
return true; return true;
} }

View File

@ -29,7 +29,7 @@ import static org.bukkit.permissions.PermissionDefault.*;
/** /**
* @author Daniel Saukel * @author Daniel Saukel
*/ */
public enum DPermissions { public enum DPermission {
// Main nodes // Main nodes
BREAK("break", OP), BREAK("break", OP),
@ -96,14 +96,14 @@ public enum DPermissions {
private String node; private String node;
private PermissionDefault isDefault; private PermissionDefault isDefault;
private List<DPermissions> children = new ArrayList<>(); private List<DPermission> children = new ArrayList<>();
DPermissions(String node, PermissionDefault isDefault) { DPermission(String node, PermissionDefault isDefault) {
this.node = node; this.node = node;
this.isDefault = isDefault; this.isDefault = isDefault;
} }
DPermissions(String node, PermissionDefault isDefault, DPermissions... children) { DPermission(String node, PermissionDefault isDefault, DPermission... children) {
this(node, isDefault); this(node, isDefault);
this.children = Arrays.asList(children); this.children = Arrays.asList(children);
} }
@ -132,7 +132,7 @@ public enum DPermissions {
/** /**
* @return the child permissions * @return the child permissions
*/ */
public List<DPermissions> getChildren() { public List<DPermission> getChildren() {
return children; return children;
} }
@ -140,10 +140,10 @@ public enum DPermissions {
* @param node * @param node
* the node String, with or without "dxl." * the node String, with or without "dxl."
* @return * @return
* the DPermissions value * the DPermission value
*/ */
public static DPermissions getByNode(String node) { public static DPermission getByNode(String node) {
for (DPermissions permission : values()) { for (DPermission permission : values()) {
if (permission.getNode().equals(node) || permission.node.equals(node)) { if (permission.getNode().equals(node) || permission.node.equals(node)) {
return permission; return permission;
} }
@ -157,12 +157,12 @@ public enum DPermissions {
* the permission to check * the permission to check
* @return if the player has the permission * @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())) { if (sender.hasPermission(permission.getNode())) {
return true; return true;
} }
for (DPermissions parent : DPermissions.values()) { for (DPermission parent : DPermission.values()) {
if (parent.getChildren().contains(permission) && sender.hasPermission(parent.getNode())) { if (parent.getChildren().contains(permission) && sender.hasPermission(parent.getNode())) {
return true; return true;
} }
@ -181,19 +181,19 @@ public enum DPermissions {
return true; return true;
} }
DPermissions dPermission = null; DPermission dPermission = null;
if (EnumUtil.isValidEnum(DPermissions.class, permission)) { if (EnumUtil.isValidEnum(DPermission.class, permission)) {
dPermission = DPermissions.valueOf(permission); dPermission = DPermission.valueOf(permission);
} else if (DPermissions.getByNode(permission) != null) { } else if (DPermission.getByNode(permission) != null) {
dPermission = DPermissions.getByNode(permission); dPermission = DPermission.getByNode(permission);
} }
if (dPermission == null) { if (dPermission == null) {
return false; return false;
} }
for (DPermissions parent : DPermissions.values()) { for (DPermission parent : DPermission.values()) {
if (parent.getChildren().contains(dPermission) && sender.hasPermission(parent.getNode())) { if (parent.getChildren().contains(dPermission) && sender.hasPermission(parent.getNode())) {
return true; return true;
} }
@ -206,7 +206,7 @@ public enum DPermissions {
* Registers the permissions. * Registers the permissions.
*/ */
public static void register() { public static void register() {
for (DPermissions permission : values()) { for (DPermission permission : values()) {
Bukkit.getPluginManager().addPermission(new Permission(permission.getNode(), permission.isDefault())); Bukkit.getPluginManager().addPermission(new Permission(permission.getNode(), permission.isDefault()));
} }
} }

View File

@ -245,7 +245,7 @@ public class DPlayerListener implements Listener {
return; return;
} }
if (DPermissions.hasPermission(player, DPermissions.BYPASS)) { if (DPermission.hasPermission(player, DPermission.BYPASS)) {
return; return;
} }
@ -260,7 +260,7 @@ public class DPlayerListener implements Listener {
Game game = Game.getByWorld(dPlayer.getWorld()); Game game = Game.getByWorld(dPlayer.getWorld());
if (dPlayer instanceof DEditPlayer) { if (dPlayer instanceof DEditPlayer) {
if (DPermissions.hasPermission(player, DPermissions.CMD_EDIT)) { if (DPermission.hasPermission(player, DPermission.CMD_EDIT)) {
return; return;
} else { } else {
@ -315,7 +315,7 @@ public class DPlayerListener implements Listener {
return; 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); event.setCancelled(true);
} }
@ -532,7 +532,7 @@ public class DPlayerListener implements Listener {
return; return;
} }
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) { if (!DPermission.hasPermission(player, DPermission.BYPASS)) {
event.setCancelled(true); event.setCancelled(true);
} }
} }
@ -555,13 +555,13 @@ public class DPlayerListener implements Listener {
if (dGameWorld != null || DEditWorld.getByWorld(player.getWorld()) != null) { if (dGameWorld != null || DEditWorld.getByWorld(player.getWorld()) != null) {
if (event.getAction() != Action.LEFT_CLICK_BLOCK) { if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
if (clickedBlock.getType() == Material.ENDER_CHEST) { 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()); MessageUtil.sendMessage(player, DMessage.ERROR_ENDERCHEST.getMessage());
event.setCancelled(true); event.setCancelled(true);
} }
} else if (clickedBlock.getType() == Material.BED_BLOCK) { } 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()); MessageUtil.sendMessage(player, DMessage.ERROR_BED.getMessage());
event.setCancelled(true); event.setCancelled(true);
} }
@ -573,7 +573,7 @@ public class DPlayerListener implements Listener {
if (dGameWorld != null) { if (dGameWorld != null) {
if (event.getAction() != Action.LEFT_CLICK_BLOCK) { if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
if (clickedBlock.getType() == Material.DISPENSER) { if (clickedBlock.getType() == Material.DISPENSER) {
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) { if (!DPermission.hasPermission(player, DPermission.BYPASS)) {
MessageUtil.sendMessage(player, DMessage.ERROR_DISPENSER.getMessage()); MessageUtil.sendMessage(player, DMessage.ERROR_DISPENSER.getMessage());
event.setCancelled(true); event.setCancelled(true);
} }

View File

@ -35,7 +35,7 @@ public class SecureModeTask extends BukkitRunnable {
} }
if (!(dGlobalPlayer instanceof DGamePlayer || dGlobalPlayer instanceof DEditPlayer)) { 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()); player.teleport(Bukkit.getWorlds().get(0).getSpawnLocation());
} }
} }

View File

@ -16,7 +16,7 @@
*/ */
package io.github.dre2n.dungeonsxl.requirement; 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.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
@ -61,7 +61,7 @@ public class PermissionRequirement extends Requirement {
@Override @Override
public boolean check(Player player) { public boolean check(Player player) {
for (String permission : permissions) { for (String permission : permissions) {
if (!DPermissions.hasPermission(player, permission)) { if (!DPermission.hasPermission(player, permission)) {
return false; return false;
} }
} }

View File

@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.reward;
import io.github.dre2n.dungeonsxl.DungeonsXL; import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; 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.util.PageGUI;
import io.github.dre2n.dungeonsxl.world.DEditWorld; import io.github.dre2n.dungeonsxl.world.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld;
@ -97,7 +97,7 @@ public class RewardListener implements Listener {
event.setCancelled(true); 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(); World world = event.getPlayer().getWorld();
if (event.getInventory().getType() != InventoryType.CREATIVE && DEditWorld.getByWorld(world) != null) { if (event.getInventory().getType() != InventoryType.CREATIVE && DEditWorld.getByWorld(world) != null) {
event.setCancelled(true); event.setCancelled(true);

View File

@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.sign;
import io.github.dre2n.commons.chat.MessageUtil; import io.github.dre2n.commons.chat.MessageUtil;
import io.github.dre2n.dungeonsxl.config.DMessage; import io.github.dre2n.dungeonsxl.config.DMessage;
import io.github.dre2n.dungeonsxl.player.DGamePlayer; 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.trigger.InteractTrigger;
import io.github.dre2n.dungeonsxl.world.DEditWorld; import io.github.dre2n.dungeonsxl.world.DEditWorld;
import io.github.dre2n.dungeonsxl.world.DGameWorld; import io.github.dre2n.dungeonsxl.world.DGameWorld;
@ -97,7 +97,7 @@ public class DSignListener implements Listener {
return; return;
} }
if (!DPermissions.hasPermission(player, dsign.getType().getBuildPermission())) { if (!DPermission.hasPermission(player, dsign.getType().getBuildPermission())) {
MessageUtil.sendMessage(player, DMessage.ERROR_NO_PERMISSIONS.getMessage()); MessageUtil.sendMessage(player, DMessage.ERROR_NO_PERMISSIONS.getMessage());
return; return;
} }

View File

@ -16,7 +16,7 @@
*/ */
package io.github.dre2n.dungeonsxl.sign; 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.ClassesSign;
import io.github.dre2n.dungeonsxl.sign.lobby.LobbySign; import io.github.dre2n.dungeonsxl.sign.lobby.LobbySign;
import io.github.dre2n.dungeonsxl.sign.lobby.ReadySign; import io.github.dre2n.dungeonsxl.sign.lobby.ReadySign;
@ -94,7 +94,7 @@ public enum DSignTypeDefault implements DSignType {
@Override @Override
public String getBuildPermission() { public String getBuildPermission() {
return DPermissions.SIGN.getNode() + "." + buildPermission; return DPermission.SIGN.getNode() + "." + buildPermission;
} }
@Override @Override

View File

@ -18,7 +18,6 @@ package io.github.dre2n.dungeonsxl.util;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.inventory.ItemStack;
/** /**
* Links different color types together. * Links different color types together.
@ -74,8 +73,10 @@ public enum DColor {
} }
/** /**
* @deprecated Use getDyeColor() instead
* @return the wool DV * @return the wool DV
*/ */
@Deprecated
public byte getWoolData() { public byte getWoolData() {
return dye.getWoolData(); return dye.getWoolData();
} }