mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Rename some classes to keep
This commit is contained in:
parent
cb1a1cc56e
commit
b565144bb2
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -26,11 +26,11 @@ import java.util.List;
|
||||
*
|
||||
* @author Daniel Saukel
|
||||
*/
|
||||
public class DClasses {
|
||||
public class DClassCache {
|
||||
|
||||
private List<DClass> 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));
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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<DPermissions> children = new ArrayList<>();
|
||||
private List<DPermission> 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<DPermissions> getChildren() {
|
||||
public List<DPermission> 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()));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user