From 63ffd6a3f897cf0097494c809724feee984a324d Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Fri, 29 Apr 2016 01:24:59 +0200 Subject: [PATCH] Use Message util by BRCommons --- README.md | 2 +- pom.xml | 2 +- .../github/dre2n/dungeonsxl/DungeonsXL.java | 5 +- .../dungeonsxl/command/BreakCommand.java | 10 +- .../dre2n/dungeonsxl/command/ChatCommand.java | 12 +- .../dungeonsxl/command/ChatSpyCommand.java | 10 +- .../dungeonsxl/command/CreateCommand.java | 26 +- .../command/DeletePortalCommand.java | 8 +- .../dre2n/dungeonsxl/command/EditCommand.java | 16 +- .../dungeonsxl/command/EnterCommand.java | 16 +- .../dungeonsxl/command/EscapeCommand.java | 14 +- .../dre2n/dungeonsxl/command/GameCommand.java | 12 +- .../dungeonsxl/command/GroupCommand.java | 56 ++-- .../dre2n/dungeonsxl/command/HelpCommand.java | 6 +- .../dungeonsxl/command/InviteCommand.java | 10 +- .../dungeonsxl/command/LeaveCommand.java | 16 +- .../dre2n/dungeonsxl/command/ListCommand.java | 6 +- .../dungeonsxl/command/LivesCommand.java | 12 +- .../dre2n/dungeonsxl/command/MainCommand.java | 14 +- .../dre2n/dungeonsxl/command/MsgCommand.java | 18 +- .../dre2n/dungeonsxl/command/PlayCommand.java | 24 +- .../dungeonsxl/command/PortalCommand.java | 28 +- .../dungeonsxl/command/ReloadCommand.java | 12 +- .../dre2n/dungeonsxl/command/SaveCommand.java | 10 +- .../dre2n/dungeonsxl/command/TestCommand.java | 16 +- .../dungeonsxl/command/UninviteCommand.java | 10 +- .../dre2n/dungeonsxl/config/DMessages.java | 208 ++++++++++++ .../dungeonsxl/config/MessageConfig.java | 307 ------------------ .../dungeonsxl/dungeon/DLootInventory.java | 4 +- .../event/dgroup/DGroupFinishFloorEvent.java | 2 +- .../event/dgroup/DGroupStartFloorEvent.java | 2 +- .../event/dsign/DSignRegistrationEvent.java | 2 +- .../io/github/dre2n/dungeonsxl/game/Game.java | 4 +- .../dre2n/dungeonsxl/game/GameChest.java | 12 +- .../dungeonsxl/game/GamePlaceableBlock.java | 2 +- .../dre2n/dungeonsxl/global/DPortal.java | 8 +- .../dre2n/dungeonsxl/global/GameSign.java | 14 +- .../dre2n/dungeonsxl/global/GroupSign.java | 10 +- .../dre2n/dungeonsxl/global/LeaveSign.java | 4 +- .../dungeonsxl/listener/BlockListener.java | 16 +- .../dungeonsxl/listener/PlayerListener.java | 32 +- .../github/dre2n/dungeonsxl/mob/DMobType.java | 6 +- .../dre2n/dungeonsxl/player/DGroup.java | 22 +- .../dre2n/dungeonsxl/player/DPlayer.java | 20 +- .../requirement/FeeLevelRequirement.java | 4 +- .../requirement/FeeMoneyRequirement.java | 4 +- .../dre2n/dungeonsxl/reward/LevelReward.java | 4 +- .../dre2n/dungeonsxl/reward/MoneyReward.java | 4 +- .../dre2n/dungeonsxl/sign/CheckpointSign.java | 8 +- .../dre2n/dungeonsxl/sign/ClassesSign.java | 2 +- .../dre2n/dungeonsxl/sign/CommandSign.java | 2 +- .../github/dre2n/dungeonsxl/sign/EndSign.java | 2 +- .../dre2n/dungeonsxl/sign/FloorSign.java | 2 +- .../dre2n/dungeonsxl/sign/InteractSign.java | 4 +- .../dre2n/dungeonsxl/sign/LeaveSign.java | 2 +- .../dre2n/dungeonsxl/sign/ReadySign.java | 8 +- .../dre2n/dungeonsxl/sign/RedstoneSign.java | 2 +- .../dre2n/dungeonsxl/sign/TriggerSign.java | 4 +- .../dungeonsxl/task/DelayedPowerTask.java | 2 +- .../dre2n/dungeonsxl/task/LazyUpdateTask.java | 2 +- .../dungeonsxl/task/RedstoneEventTask.java | 2 +- .../dungeonsxl/task/TimeIsRunningTask.java | 8 +- .../dungeonsxl/task/WorldUnloadTask.java | 2 +- 63 files changed, 508 insertions(+), 606 deletions(-) create mode 100644 src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java delete mode 100644 src/main/java/io/github/dre2n/dungeonsxl/config/MessageConfig.java diff --git a/README.md b/README.md index 8be08c09..002d8b82 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Instead of referencing the internals of the implementation directly, DungeonsXL The shaded version of DXL (standard version) contains this library, while the original version needs it as an external plugin. Have a look at the [installation instructions](../../wiki/getting-started#installation) for detailed information. -DungeonsXL currently uses BRCommons 0.4. +DungeonsXL currently uses BRCommons 0.5. ### Java 7 and higher diff --git a/pom.xml b/pom.xml index e8dd90ac..b900b35a 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ io.github.dre2n commons - 0.4 + 0.5 io.github.dre2n diff --git a/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java b/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java index bbe444d2..3a7d3dc3 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/DungeonsXL.java @@ -18,13 +18,14 @@ package io.github.dre2n.dungeonsxl; import io.github.dre2n.commons.command.BRCommands; import io.github.dre2n.commons.compatibility.Internals; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.javaplugin.BRPlugin; import io.github.dre2n.commons.javaplugin.BRPluginSettings; import io.github.dre2n.commons.util.FileUtil; import io.github.dre2n.dungeonsxl.command.*; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.DataConfig; import io.github.dre2n.dungeonsxl.config.MainConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig; import io.github.dre2n.dungeonsxl.config.WorldConfig; import io.github.dre2n.dungeonsxl.dungeon.DLootInventory; import io.github.dre2n.dungeonsxl.dungeon.Dungeons; @@ -279,7 +280,7 @@ public class DungeonsXL extends BRPlugin { * load / reload a new instance of MessageConfig */ public void loadMessageConfig(File file) { - messageConfig = new MessageConfig(file); + messageConfig = new MessageConfig(DMessages.class, file); } /** diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java index 5cafce7d..9cc5324e 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/BreakCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -37,7 +37,7 @@ public class BreakCommand extends BRCommand { setCommand("break"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_BREAK)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_BREAK)); setPermission("dxl.break"); setPlayerCommand(true); } @@ -49,11 +49,11 @@ public class BreakCommand extends BRCommand { if (dGlobalPlayer.isInBreakMode()) { dGlobalPlayer.setInBreakMode(false); - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.CMD_BREAK_PROTECTED_MODE)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.CMD_BREAK_PROTECTED_MODE)); } else { dGlobalPlayer.setInBreakMode(true); - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.CMD_BREAK_BREAK_MODE)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.CMD_BREAK_BREAK_MODE)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java index ae4eeddb..cbcb8cbc 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DPlayer; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -37,7 +37,7 @@ public class ChatCommand extends BRCommand { setCommand("chat"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_CHAT)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_CHAT)); setPermission("dxl.chat"); setPlayerCommand(true); } @@ -48,17 +48,17 @@ public class ChatCommand extends BRCommand { DPlayer dPlayer = DPlayer.getByPlayer(player); if (dPlayer == null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_JOIN_GROUP)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP)); return; } if (dPlayer.isInDungeonChat()) { dPlayer.setInDungeonChat(false); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_CHAT_NORMAL_CHAT)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_CHAT_NORMAL_CHAT)); } else { dPlayer.setInDungeonChat(true); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_CHAT_DUNGEON_CHAT)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_CHAT_DUNGEON_CHAT)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java index 35370af3..f26a00cf 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ChatSpyCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -37,7 +37,7 @@ public class ChatSpyCommand extends BRCommand { setCommand("chatspy"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_CHATSPY)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_CHATSPY)); setPermission("dxl.chatspy"); setPlayerCommand(true); } @@ -49,11 +49,11 @@ public class ChatSpyCommand extends BRCommand { if (dGlobalPlayer.isInChatSpyMode()) { dGlobalPlayer.setInChatSpyMode(false); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_CHATSPY_STOPPED)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_CHATSPY_STOPPED)); } else { dGlobalPlayer.setInChatSpyMode(true); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_CHATSPY_START)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_CHATSPY_START)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java index ce7d7d8d..f48cabb6 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/CreateCommand.java @@ -17,12 +17,12 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; -import io.github.dre2n.dungeonsxl.world.EditWorld; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DPlayer; +import io.github.dre2n.dungeonsxl.world.EditWorld; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; @@ -39,7 +39,7 @@ public class CreateCommand extends BRCommand { setMinArgs(1); setMaxArgs(1); setCommand("create"); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_CREATE)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_CREATE)); setPermission("dxl.create"); setPlayerCommand(true); setConsoleCommand(true); @@ -52,8 +52,8 @@ public class CreateCommand extends BRCommand { if (sender instanceof ConsoleCommandSender) { if (name.length() <= 15) { // Msg create - plugin.getLogger().info(messageConfig.getMessage(Messages.LOG_NEW_DUNGEON)); - plugin.getLogger().info(messageConfig.getMessage(Messages.LOG_GENERATE_NEW_WORLD)); + MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_NEW_DUNGEON)); + MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_GENERATE_NEW_WORLD)); // Create World EditWorld editWorld = new EditWorld(); @@ -63,24 +63,24 @@ public class CreateCommand extends BRCommand { editWorld.delete(); // MSG Done - plugin.getLogger().info(messageConfig.getMessage(Messages.LOG_WORLD_GENERATION_FINISHED)); + MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_WORLD_GENERATION_FINISHED)); } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NAME_TO_LONG)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NAME_TO_LONG)); } } else if (sender instanceof Player) { Player player = (Player) sender; if (DPlayer.getByPlayer(player) != null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_LEAVE_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON)); return; } if (name.length() <= 15) { // Msg create - plugin.getLogger().info(messageConfig.getMessage(Messages.LOG_NEW_DUNGEON)); - plugin.getLogger().info(messageConfig.getMessage(Messages.LOG_GENERATE_NEW_WORLD)); + MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_NEW_DUNGEON)); + MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_GENERATE_NEW_WORLD)); // Create World EditWorld editWorld = new EditWorld(); @@ -88,13 +88,13 @@ public class CreateCommand extends BRCommand { editWorld.setMapName(name); // MSG Done - plugin.getLogger().info(messageConfig.getMessage(Messages.LOG_WORLD_GENERATION_FINISHED)); + MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_WORLD_GENERATION_FINISHED)); // Tp Player new DPlayer(player, editWorld.getWorld(), true); } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NAME_TO_LONG)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NAME_TO_LONG)); } } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java index 75293ef1..a966fd5c 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/DeletePortalCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.global.DPortal; import java.util.Set; import org.bukkit.Material; @@ -52,10 +52,10 @@ public class DeletePortalCommand extends BRCommand { if (dPortal != null) { dPortal.delete(); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.PLAYER_PROTECTED_BLOCK_DELETED)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PROTECTED_BLOCK_DELETED)); } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NO_PROTECTED_BLOCK)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NO_PROTECTED_BLOCK)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java index faebc1a4..6fe5c5ae 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/EditCommand.java @@ -17,13 +17,13 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; -import io.github.dre2n.dungeonsxl.world.EditWorld; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; +import io.github.dre2n.dungeonsxl.world.EditWorld; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -39,7 +39,7 @@ public class EditCommand extends BRCommand { setCommand("edit"); setMinArgs(1); setMaxArgs(1); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_EDIT)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_EDIT)); setPlayerCommand(true); } @@ -53,22 +53,22 @@ public class EditCommand extends BRCommand { DPlayer dPlayer = DPlayer.getByPlayer(player); if (!(EditWorld.isInvitedPlayer(mapName, player.getUniqueId(), player.getName()) || player.hasPermission("dxl.edit"))) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NO_PERMISSIONS)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NO_PERMISSIONS)); return; } if (dPlayer != null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_LEAVE_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON)); return; } if (dGroup != null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_LEAVE_GROUP)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_GROUP)); return; } if (editWorld == null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_DUNGEON_NOT_EXIST, mapName)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_DUNGEON_NOT_EXIST, mapName)); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java index 5b3aa1e1..ce110cc2 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/EnterCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.game.Game; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; @@ -39,7 +39,7 @@ public class EnterCommand extends BRCommand { setMinArgs(1); setMaxArgs(2); setCommand("enter"); - setHelp(messageConfig.getMessage(MessageConfig.Messages.HELP_CMD_ENTER)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_ENTER)); setPermission("dxl.enter"); setPlayerCommand(true); } @@ -53,18 +53,18 @@ public class EnterCommand extends BRCommand { DGroup target = DGroup.getByName(targetName); if (target == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_SUCH_GROUP, targetName)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_GROUP, targetName)); return; } Game game = Game.getByDGroup(target); if (game == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NOT_IN_GAME, targetName)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_IN_GAME, targetName)); return; } if (Game.getByDGroup(joining) != null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_LEAVE_GAME)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_LEAVE_GAME)); return; } @@ -73,13 +73,13 @@ public class EnterCommand extends BRCommand { } if (joining.getCaptain() != captain && !sender.hasPermission("dxl.bypass")) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NOT_CAPTAIN)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_CAPTAIN)); return; } joining.setGameWorld(game.getWorld()); game.addDGroup(joining); - joining.sendMessage(messageConfig.getMessage(Messages.CMD_ENTER_SUCCESS, joining.getName(), targetName)); + joining.sendMessage(messageConfig.getMessage(DMessages.CMD_ENTER_SUCCESS, joining.getName(), targetName)); for (Player player : joining.getPlayers()) { new DPlayer(player, game.getWorld()).ready(); diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java index 2ae80c60..1f191533 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/EscapeCommand.java @@ -17,13 +17,13 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; -import io.github.dre2n.dungeonsxl.world.EditWorld; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; +import io.github.dre2n.dungeonsxl.world.EditWorld; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -39,7 +39,7 @@ public class EscapeCommand extends BRCommand { setCommand("escape"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_ESCAPE)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_ESCAPE)); setPermission("dxl.escape"); setPlayerCommand(true); } @@ -51,7 +51,7 @@ public class EscapeCommand extends BRCommand { if (dPlayer != null) { if (!dPlayer.isEditing()) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_LEAVE_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON)); return; } @@ -70,10 +70,10 @@ public class EscapeCommand extends BRCommand { DGroup dGroup = DGroup.getByPlayer(player); if (dGroup != null) { dGroup.removePlayer(player); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_LEAVE_SUCCESS)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_LEAVE_SUCCESS)); return; } - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NOT_IN_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java index be7ae738..de9ee969 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/GameCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.game.Game; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.world.GameWorld; @@ -39,7 +39,7 @@ public class GameCommand extends BRCommand { setCommand("game"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_GAME)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_GAME)); setPermission("dxl.game"); setPlayerCommand(true); } @@ -49,19 +49,19 @@ public class GameCommand extends BRCommand { Player player = (Player) sender; DGroup dGroup = DGroup.getByPlayer(player); if (dGroup == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_JOIN_GROUP)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP)); return; } GameWorld gameWorld = dGroup.getGameWorld(); if (gameWorld == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_GAME)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_GAME)); return; } Game game = gameWorld.getGame(); if (game == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_GAME)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_GAME)); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java index b6c84c5f..11f2928b 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/GroupCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent; import io.github.dre2n.dungeonsxl.event.dgroup.DGroupDisbandEvent; import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerKickEvent; @@ -41,7 +41,7 @@ public class GroupCommand extends BRCommand { setCommand("group"); setMinArgs(0); setMaxArgs(2); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_GROUP)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_GROUP)); setPermission("dxl.group"); setPlayerCommand(true); } @@ -118,11 +118,11 @@ public class GroupCommand extends BRCommand { dGroup = null; } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.GROUP_CREATED, sender.getName(), args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.GROUP_CREATED, sender.getName(), args[2])); } } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_LEAVE_GROUP)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_LEAVE_GROUP)); } } @@ -132,18 +132,18 @@ public class GroupCommand extends BRCommand { if (!event.isCancelled()) { dGroup.delete(); - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.GROUP_DISBANDED, sender.getName(), dGroup.getName())); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.GROUP_DISBANDED, sender.getName(), dGroup.getName())); dGroup = null; } } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_SUCH_GROUP)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_GROUP)); } } public void invitePlayer(DGroup dGroup) { if (dGroup == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_JOIN_GROUP)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP)); return; } @@ -153,13 +153,13 @@ public class GroupCommand extends BRCommand { dGroup.addInvitedPlayer(toInvite, false); } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_SUCH_PLAYER, args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_PLAYER, args[2])); } } public void uninvitePlayer(DGroup dGroup) { if (dGroup == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_JOIN_GROUP)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP)); return; } @@ -172,27 +172,27 @@ public class GroupCommand extends BRCommand { dGroup.removeInvitedPlayer(toUninvite, false); } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NOT_IN_GROUP, args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_IN_GROUP, args[2])); } } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_SUCH_PLAYER, args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_PLAYER, args[2])); } } public void joinGroup(DGroup dGroup) { if (dGroup == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_SUCH_GROUP, args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_GROUP, args[2])); return; } if (DGroup.getByPlayer(player) != null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_LEAVE_GROUP)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_LEAVE_GROUP)); return; } if (!dGroup.getInvitedPlayers().contains(player) && !player.hasPermission("dxl.bypass")) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NOT_INVITED, args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_INVITED, args[2])); return; } @@ -202,7 +202,7 @@ public class GroupCommand extends BRCommand { public void kickPlayer(DGroup dGroup) { if (dGroup == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_JOIN_GROUP)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP)); } Player toKick = plugin.getServer().getPlayer(args[2]); @@ -212,25 +212,25 @@ public class GroupCommand extends BRCommand { if (!event.isCancelled()) { if (dGroup.getPlayers().contains(toKick)) { dGroup.removePlayer(toKick); - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.GROUP_KICKED_PLAYER, sender.getName(), args[2], dGroup.getName())); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.GROUP_KICKED_PLAYER, sender.getName(), args[2], dGroup.getName())); } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NOT_IN_GROUP, args[2], dGroup.getName())); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_IN_GROUP, args[2], dGroup.getName())); } } } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_SUCH_PLAYER, args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_PLAYER, args[2])); } } public void showGroup(DGroup dGroup) { if (dGroup == null) { if (args.length == 3) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_SUCH_GROUP, args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_GROUP, args[2])); } else if (args.length == 2) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_JOIN_GROUP)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP)); } return; @@ -252,16 +252,16 @@ public class GroupCommand extends BRCommand { switch (page) { default: MessageUtil.sendCenteredMessage(sender, "&4&l[ &61-5 &4/ &67 &4| &61 &4&l]"); - MessageUtil.sendMessage(sender, "&bcreate" + "&7 - " + messageConfig.getMessage(Messages.HELP_CMD_GROUP_CREATE)); - MessageUtil.sendMessage(sender, "&bdisband" + "&7 - " + messageConfig.getMessage(Messages.HELP_CMD_GROUP_DISBAND)); - MessageUtil.sendMessage(sender, "&binvite" + "&7 - " + messageConfig.getMessage(Messages.HELP_CMD_GROUP_INVITE)); - MessageUtil.sendMessage(sender, "&buninvite" + "&7 - " + messageConfig.getMessage(Messages.HELP_CMD_GROUP_UNINVITE)); - MessageUtil.sendMessage(sender, "&bjoin" + "&7 - " + messageConfig.getMessage(Messages.HELP_CMD_GROUP_JOIN)); + MessageUtil.sendMessage(sender, "&bcreate" + "&7 - " + messageConfig.getMessage(DMessages.HELP_CMD_GROUP_CREATE)); + MessageUtil.sendMessage(sender, "&bdisband" + "&7 - " + messageConfig.getMessage(DMessages.HELP_CMD_GROUP_DISBAND)); + MessageUtil.sendMessage(sender, "&binvite" + "&7 - " + messageConfig.getMessage(DMessages.HELP_CMD_GROUP_INVITE)); + MessageUtil.sendMessage(sender, "&buninvite" + "&7 - " + messageConfig.getMessage(DMessages.HELP_CMD_GROUP_UNINVITE)); + MessageUtil.sendMessage(sender, "&bjoin" + "&7 - " + messageConfig.getMessage(DMessages.HELP_CMD_GROUP_JOIN)); break; case "2": MessageUtil.sendCenteredMessage(sender, "&4&l[ &66-10 &4/ &67 &4| &62 &4&l]"); - MessageUtil.sendMessage(sender, "&bkick" + "&7 - " + messageConfig.getMessage(Messages.HELP_CMD_GROUP_KICK)); - MessageUtil.sendMessage(sender, "&bshow" + "&7 - " + messageConfig.getMessage(Messages.HELP_CMD_GROUP_SHOW)); + MessageUtil.sendMessage(sender, "&bkick" + "&7 - " + messageConfig.getMessage(DMessages.HELP_CMD_GROUP_KICK)); + MessageUtil.sendMessage(sender, "&bshow" + "&7 - " + messageConfig.getMessage(DMessages.HELP_CMD_GROUP_SHOW)); break; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java index a92d3b2a..c93831af 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/HelpCommand.java @@ -17,11 +17,11 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.NumberUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import java.util.ArrayList; import java.util.Set; import org.bukkit.command.CommandSender; @@ -38,7 +38,7 @@ public class HelpCommand extends BRCommand { setCommand("help"); setMinArgs(0); setMaxArgs(1); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_HELP)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_HELP)); setPermission("dxl.help"); setPlayerCommand(true); setConsoleCommand(true); diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java index 9c1c5c77..ed2bca10 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/InviteCommand.java @@ -17,11 +17,11 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.UUIDUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.world.EditWorld; import org.bukkit.command.CommandSender; @@ -37,7 +37,7 @@ public class InviteCommand extends BRCommand { setMinArgs(2); setMaxArgs(2); setCommand("invite"); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_INVITE)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_INVITE)); setPermission("dxl.invite"); setPlayerCommand(true); setConsoleCommand(true); @@ -46,10 +46,10 @@ public class InviteCommand extends BRCommand { @Override public void onExecute(String[] args, CommandSender sender) { if (EditWorld.addInvitedPlayer(args[2], UUIDUtil.getUniqueIdFromName(args[1]))) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.CMD_INVITE_SUCCESS, args[1], args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.CMD_INVITE_SUCCESS, args[1], args[2])); } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_DUNGEON_NOT_EXIST, args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_DUNGEON_NOT_EXIST, args[2])); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java index 5a84db30..23e80b67 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/LeaveCommand.java @@ -17,15 +17,15 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerEscapeEvent; import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerLeaveDGroupEvent; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -41,7 +41,7 @@ public class LeaveCommand extends BRCommand { setCommand("leave"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_LEAVE)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_LEAVE)); setPermission("dxl.leave"); setPlayerCommand(true); } @@ -53,7 +53,7 @@ public class LeaveCommand extends BRCommand { if (GameWorld.getByWorld(player.getWorld()) != null) { if (GameWorld.getByWorld(player.getWorld()).isTutorial()) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NO_LEAVE_IN_TUTORIAL)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NO_LEAVE_IN_TUTORIAL)); return; } } @@ -69,17 +69,17 @@ public class LeaveCommand extends BRCommand { } dPlayer.leave(); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_LEAVE_SUCCESS)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_LEAVE_SUCCESS)); } else { DGroup dGroup = DGroup.getByPlayer(player); if (dGroup != null) { dGroup.removePlayer(player); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_LEAVE_SUCCESS)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_LEAVE_SUCCESS)); return; } - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NOT_IN_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java index 9484874c..4d3f7b89 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ListCommand.java @@ -17,12 +17,12 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.NumberUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.DungeonConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; import io.github.dre2n.dungeonsxl.dungeon.Dungeon; import io.github.dre2n.dungeonsxl.world.EditWorld; import io.github.dre2n.dungeonsxl.world.GameWorld; @@ -43,7 +43,7 @@ public class ListCommand extends BRCommand { setCommand("list"); setMinArgs(0); setMaxArgs(3); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_LIST)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_LIST)); setPermission("dxl.list"); setPlayerCommand(true); setConsoleCommand(true); diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java index 04f036a8..c77725a0 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/LivesCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DPlayer; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; @@ -38,7 +38,7 @@ public class LivesCommand extends BRCommand { setCommand("lives"); setMinArgs(0); setMaxArgs(1); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_LIVES)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_LIVES)); setPermission("dxl.lives"); setPlayerCommand(true); setConsoleCommand(true); @@ -57,16 +57,16 @@ public class LivesCommand extends BRCommand { player = (Player) sender; } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NO_CONSOLE_COMMAND, getCommand())); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_CONSOLE_COMMAND, getCommand())); return; } DPlayer dPlayer = DPlayer.getByPlayer(player); if (dPlayer != null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_LIVES, player.getName(), String.valueOf(dPlayer.getLives()))); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_LIVES, player.getName(), String.valueOf(dPlayer.getLives()))); } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NOT_IN_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java index 31767c29..3ea8f464 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/MainCommand.java @@ -19,11 +19,11 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; import io.github.dre2n.commons.compatibility.CompatibilityHandler; import io.github.dre2n.commons.compatibility.Internals; +import io.github.dre2n.commons.config.MessageConfig; import static io.github.dre2n.commons.util.messageutil.FatLetters.*; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import java.io.File; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; @@ -39,7 +39,7 @@ public class MainCommand extends BRCommand { public MainCommand() { setCommand("main"); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_MAIN)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_MAIN)); setPermission("dxl.main"); setPlayerCommand(true); setConsoleCommand(true); @@ -68,10 +68,10 @@ public class MainCommand extends BRCommand { MessageUtil.sendCenteredMessage(sender, "&4" + D[2] + "&f" + X[2] + L[2]); MessageUtil.sendCenteredMessage(sender, "&4" + D[3] + "&f" + X[3] + L[3]); MessageUtil.sendCenteredMessage(sender, "&4" + D[4] + "&f" + X[4] + L[4]); - MessageUtil.sendCenteredMessage(sender, "&b&l###### " + messageConfig.getMessage(Messages.CMD_MAIN_WELCOME) + "&7 v" + plugin.getDescription().getVersion() + " &b&l######"); - MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(Messages.CMD_MAIN_LOADED, String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players))); - MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(Messages.CMD_MAIN_COMPATIBILITY, String.valueOf(internals), vault, mythicMobs)); - MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(Messages.CMD_MAIN_HELP)); + MessageUtil.sendCenteredMessage(sender, "&b&l###### " + messageConfig.getMessage(DMessages.CMD_MAIN_WELCOME) + "&7 v" + plugin.getDescription().getVersion() + " &b&l######"); + MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(DMessages.CMD_MAIN_LOADED, String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players))); + MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(DMessages.CMD_MAIN_COMPATIBILITY, String.valueOf(internals), vault, mythicMobs)); + MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(DMessages.CMD_MAIN_HELP)); MessageUtil.sendCenteredMessage(sender, "&7\u00a92012-2016 Frank Baumann & contributors; lcsd. under GPLv3."); } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java index c810b409..a23a6826 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/MsgCommand.java @@ -17,11 +17,11 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.NumberUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.WorldConfig; import io.github.dre2n.dungeonsxl.world.EditWorld; import java.io.File; @@ -41,7 +41,7 @@ public class MsgCommand extends BRCommand { setMinArgs(-1); setMaxArgs(-1); setCommand("msg"); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_MSG)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_MSG)); setPermission("dxl.msg"); setPlayerCommand(true); } @@ -52,7 +52,7 @@ public class MsgCommand extends BRCommand { EditWorld editWorld = EditWorld.getByWorld(player.getWorld()); if (editWorld == null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NOT_IN_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON)); return; } @@ -73,7 +73,7 @@ public class MsgCommand extends BRCommand { MessageUtil.sendMessage(player, ChatColor.WHITE + msg); } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_MSG_ID_NOT_EXIST, "" + id)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_MSG_ID_NOT_EXIST, "" + id)); } } else { @@ -92,22 +92,22 @@ public class MsgCommand extends BRCommand { msg = splitMsg[1]; String old = confreader.getMsg(id, false); if (old == null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_MSG_ADDED, "" + id)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_MSG_ADDED, "" + id)); } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_MSG_UPDATED, "" + id)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_MSG_UPDATED, "" + id)); } confreader.setMsg(msg, id); confreader.save(); } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_MSG_FORMAT)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_MSG_FORMAT)); } } } catch (NumberFormatException e) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_MSG_NO_INT)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_MSG_NO_INT)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java index 7dfabfe9..306615c2 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/PlayCommand.java @@ -17,18 +17,18 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.DungeonConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; import io.github.dre2n.dungeonsxl.config.WorldConfig; import io.github.dre2n.dungeonsxl.dungeon.Dungeon; -import io.github.dre2n.dungeonsxl.world.EditWorld; import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; +import io.github.dre2n.dungeonsxl.world.EditWorld; +import io.github.dre2n.dungeonsxl.world.GameWorld; import java.io.File; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -45,7 +45,7 @@ public class PlayCommand extends BRCommand { setCommand("play"); setMinArgs(1); setMaxArgs(2); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_PLAY)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_PLAY)); setPermission("dxl.play"); setPlayerCommand(true); } @@ -56,7 +56,7 @@ public class PlayCommand extends BRCommand { DPlayer dPlayer = DPlayer.getByPlayer(player); if (dPlayer != null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_LEAVE_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON)); return; } @@ -88,7 +88,7 @@ public class PlayCommand extends BRCommand { } if (!multiFloor && !EditWorld.exists(identifier)) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_DUNGEON_NOT_EXIST, identifier)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_DUNGEON_NOT_EXIST, identifier)); return; } @@ -99,14 +99,14 @@ public class PlayCommand extends BRCommand { WorldConfig confReader = new WorldConfig(file); if (confReader != null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_COOLDOWN, "" + confReader.getTimeToNextPlay())); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_COOLDOWN, "" + confReader.getTimeToNextPlay())); } } return; } if (!GameWorld.checkRequirements(mapName, player)) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_REQUIREMENTS)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_REQUIREMENTS)); return; } @@ -114,7 +114,7 @@ public class PlayCommand extends BRCommand { if (dGroup != null) { if (!dGroup.getCaptain().equals(player) && !player.hasPermission("dxl.bypass")) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NOT_CAPTAIN)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_CAPTAIN)); } if (dGroup.getMapName() == null) { @@ -135,7 +135,7 @@ public class PlayCommand extends BRCommand { } } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_LEAVE_GROUP)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_GROUP)); return; } @@ -159,7 +159,7 @@ public class PlayCommand extends BRCommand { } if (dGroup.getGameWorld() == null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NOT_SAVED, DGroup.getByPlayer(player).getMapName())); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_SAVED, DGroup.getByPlayer(player).getMapName())); dGroup.delete(); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java index 35d7a155..5772d7a0 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/PortalCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.global.DPortal; import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DPlayer; @@ -33,43 +33,43 @@ import org.bukkit.inventory.ItemStack; * @author Frank Baumann, Daniel Saukel */ public class PortalCommand extends BRCommand { - + protected static DungeonsXL plugin = DungeonsXL.getInstance(); protected static MessageConfig messageConfig = plugin.getMessageConfig(); - + public PortalCommand() { setCommand("portal"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_PORTAL)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_PORTAL)); setPermission("dxl.portal"); setPlayerCommand(true); } - + @Override public void onExecute(String[] args, CommandSender sender) { Player player = (Player) sender; DGlobalPlayer dGlobalPlayer = plugin.getDPlayers().getByPlayer(player); - + if (dGlobalPlayer instanceof DPlayer) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_LEAVE_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON)); return; } - + DPortal dPortal = dGlobalPlayer.getPortal(); - + if (dPortal == null) { dPortal = new DPortal(plugin.getGlobalProtections().generateId(DPortal.class, player.getWorld()), player.getWorld(), false); dGlobalPlayer.setCreatingPortal(dPortal); dPortal.setWorld(player.getWorld()); player.getInventory().setItemInHand(new ItemStack(Material.WOOD_SWORD)); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.PLAYER_PORTAL_INTRODUCTION)); - + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PORTAL_INTRODUCTION)); + } else { dPortal.delete(); dGlobalPlayer.setCreatingPortal(null); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.PLAYER_PORTAL_ABORT)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PORTAL_ABORT)); } } - + } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java index 113f234e..a3e181b9 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/ReloadCommand.java @@ -19,10 +19,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; import io.github.dre2n.commons.compatibility.CompatibilityHandler; import io.github.dre2n.commons.compatibility.Internals; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import java.io.File; import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; @@ -40,7 +40,7 @@ public class ReloadCommand extends BRCommand { setCommand("reload"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_RELOAD)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_RELOAD)); setPermission("dxl.reload"); setPlayerCommand(true); setConsoleCommand(true); @@ -85,9 +85,9 @@ public class ReloadCommand extends BRCommand { plugin.loadDungeons(); MessageUtil.sendPluginTag(sender, plugin); - MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(Messages.CMD_RELOAD_DONE)); - MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(Messages.CMD_MAIN_LOADED, String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players))); - MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(Messages.CMD_MAIN_COMPATIBILITY, String.valueOf(internals), vault, mythicMobs)); + MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(DMessages.CMD_RELOAD_DONE)); + MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(DMessages.CMD_MAIN_LOADED, String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players))); + MessageUtil.sendCenteredMessage(sender, messageConfig.getMessage(DMessages.CMD_MAIN_COMPATIBILITY, String.valueOf(internals), vault, mythicMobs)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java index c766aab2..90dd53ca 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/SaveCommand.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.world.EditWorld; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -37,7 +37,7 @@ public class SaveCommand extends BRCommand { setCommand("save"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_SAVE)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_SAVE)); setPermission("dxl.save"); setPlayerCommand(true); } @@ -48,10 +48,10 @@ public class SaveCommand extends BRCommand { EditWorld editWorld = EditWorld.getByWorld(player.getWorld()); if (editWorld != null) { editWorld.save(); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.CMD_SAVE_SUCCESS)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_SAVE_SUCCESS)); } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_NOT_IN_DUNGEON)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java index 3827f4cb..718f87a4 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/TestCommand.java @@ -17,15 +17,15 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.game.Game; import io.github.dre2n.dungeonsxl.game.GameTypeDefault; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -41,7 +41,7 @@ public class TestCommand extends BRCommand { setCommand("test"); setMinArgs(0); setMaxArgs(0); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_TEST)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_TEST)); setPermission("dxl.test"); setPlayerCommand(true); } @@ -52,24 +52,24 @@ public class TestCommand extends BRCommand { DGroup dGroup = DGroup.getByPlayer(player); if (dGroup == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_JOIN_GROUP)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP)); return; } if (!dGroup.getCaptain().equals(player)) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NOT_CAPTAIN)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_CAPTAIN)); return; } GameWorld gameWorld = dGroup.getGameWorld(); if (gameWorld == null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_NOT_IN_DUNGEON)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON)); return; } Game game = gameWorld.getGame(); if (game != null) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_LEAVE_DUNGEON)); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON)); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java b/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java index e691916e..584f76cf 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/command/UninviteCommand.java @@ -17,11 +17,11 @@ package io.github.dre2n.dungeonsxl.command; import io.github.dre2n.commons.command.BRCommand; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.UUIDUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.world.EditWorld; import org.bukkit.command.CommandSender; @@ -37,7 +37,7 @@ public class UninviteCommand extends BRCommand { setCommand("uninvite"); setMinArgs(2); setMaxArgs(2); - setHelp(messageConfig.getMessage(Messages.HELP_CMD_UNINVITE)); + setHelp(messageConfig.getMessage(DMessages.HELP_CMD_UNINVITE)); setPermission("dxl.uninvite"); setPlayerCommand(true); setConsoleCommand(true); @@ -46,10 +46,10 @@ public class UninviteCommand extends BRCommand { @Override public void onExecute(String[] args, CommandSender sender) { if (EditWorld.removeInvitedPlayer(args[2], UUIDUtil.getUniqueIdFromName(args[1]), args[1])) { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.CMD_UNINVITE_SUCCESS, args[1], args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.CMD_UNINVITE_SUCCESS, args[1], args[2])); } else { - MessageUtil.sendMessage(sender, messageConfig.getMessage(Messages.ERROR_DUNGEON_NOT_EXIST, args[2])); + MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_DUNGEON_NOT_EXIST, args[2])); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java b/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java new file mode 100644 index 00000000..fcf72a9f --- /dev/null +++ b/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java @@ -0,0 +1,208 @@ +/* + * Copyright (C) 2012-2016 Frank Baumann + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package io.github.dre2n.dungeonsxl.config; + +import io.github.dre2n.commons.config.Messages; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; + +/** + * @author Daniel Saukel + */ +public enum DMessages implements Messages { + + CMD_BREAK_PROTECTED_MODE("Cmd_Break_ProtectedMode", "&6You may not break blocks protected by DungeonsXL anymore."), + CMD_BREAK_BREAK_MODE("Cmd_Break_BreakMode", "&6You may break a block protected by DungeonsXL."), + CMD_CHAT_DUNGEON_CHAT("Cmd_Chat_DungeonChat", "&6You have entered the Dungeon-chat"), + CMD_CHAT_NORMAL_CHAT("Cmd_Chat_NormalChat", "&6You are now in the public chat"), + CMD_CHATSPY_STOPPED("Cmd_Chatspy_Stopped", "&6You stopped spying the DXL-chat!"), + CMD_CHATSPY_START("Cmd_Chatspy_Start", "&You started spying the DXL-chat!"), + CMD_ENTER_SUCCESS("Cmd_Enter", "&6The group &4&v1 &6successfully entered the game of the group &4&v2&6."), + CMD_INVITE_SUCCESS("Cmd_Invite_Success", "&6Player &4&v1&6 was successfully invited to edit the Dungeon &4&v2&6!"), + CMD_LEAVE_SUCCESS("Cmd_Leave_Success", "&6You have successfully left your group!"), + CMD_LIVES("Cmd_Lives", "&4v1&6 has &4v2 &6lives left."), + CMD_MAIN_WELCOME("Cmd_Main_Welcome", "&7Welcome to &4Dungeons&fXL"), + CMD_MAIN_LOADED("Cmd_Main_Loaded", "&eMaps: &o[&v1] &eDungeons: &o[&v2] &eLoaded: &o[&v3] &ePlayers: &o[&v4]"), + CMD_MAIN_COMPATIBILITY("Cmd_Main_Compatibility", "&eInternals: &o[&v1] &eVault: &o[&v2] &eMythicMobs: &o[&v3]"), + CMD_MAIN_HELP("Cmd_Main_Help", "&7Type in &o/dxl help&r&7 for further information."), + CMD_MSG_ADDED("Cmd_Msg_Added", "&6New Messages (&4&v1&6) added!"), + CMD_MSG_UPDATED("Cmd_Msg_Updated", "&6Messages (&4&v1&6) updated!"), + CMD_RELOAD_DONE("Cmd_Reload_Done", "&7Successfully reloaded DungeonsXL."), + CMD_SAVE_SUCCESS("Cmd_Save_Success", "&6Dungeon saved!"), + CMD_UNINVITE_SUCCESS("Cmd_Uninvite_Success", "&4&v1&6 was successfully uninvited to edit the Dungeon &4&v1&6!"), + ERROR_BED("Error_Bed", "&4You cannot use a bed while in a Dungeon!"), + ERROR_CHEST_IS_OPENED("Error_ChestIsOpened", "&4This chest has already been opened."), + ERROR_CMD("Error_Cmd", "&4Commands are not allowed while in a dungeon!"), + ERROR_CMD_NOT_EXIST_1("Error_CmdNotExist1", "&4Command &6&v1&4 does not exist!"), + ERROR_CMD_NOT_EXIST_2("Error_CmdNotExist2", "&4Please enter &6/dxl help&4 for help!"), + ERROR_COOLDOWN("Error_Cooldown", "&4You can only enter this Dungeon every &6&v1&4 hours!"), + ERROR_DISPENSER("Error_Dispenser", "&4You cannot access this dispenser!"), + ERROR_DROP("Error_Drop", "&4You cannot drop safe items"), + ERROR_DUNGEON_NOT_EXIST("Error_DungeonNotExist", "&4Dungeon &6&v1&4 does not exist!"), + ERROR_ENDERCHEST("Error_Enderchest", "&4You cannot use an enderchest while in a Dungeon!"), + ERROR_IN_GROUP("Error_InGroup", "&4The player &6&v1&4 is already member of a group."), + ERROR_JOIN_GROUP("Error_JoinGroup", "&4You have to join a group first!"), + ERROR_LEAVE_DUNGEON("Error_LeaveDungeon", "&4You have to leave your current dungeon first!"), + ERROR_LEAVE_GAME("Error_LeaveGame", "&4You have to leave your current game first!"), + ERROR_LEAVE_GROUP("Error_LeaveGroup", "&4You have to leave your group first!"), + ERROR_LEFT_CLICK("Error_Leftklick", "&4You have to use Left-Click on this sign!"), + ERROR_MSG_ID_NOT_EXIST("Error_MsgIdNotExist", "&4Messages with Id &6&v1&4 does not exist!"), + ERROR_MSG_FORMAT("Error_MsgFormat", "&4The Messages has to be between \"!"), + ERROR_MSG_NO_INT("Error_MsgNoInt", "&4Argument has to include a number!"), + ERROR_NAME_TO_LONG("Error_NameToLong", "&4The name may not be longer than 15 characters!"), + ERROR_NO_CONSOLE_COMMAND("Error_NoConsoleCommand", "&6/dxl &v1&4 cannot be executed as console!"), + ERROR_NO_GAME("Error_NoGame", "&4You currently do not take part in a game."), + ERROR_NO_LEAVE_IN_TUTORIAL("Error_NoLeaveInTutorial", "&4You cannot use this command in the tutorial!"), + ERROR_NO_PERMISSIONS("Error_NoPermissions", "&4You have no permission to do this!"), + ERROR_NO_PLAYER_COMMAND("Error_NoPlayerCommand", "&6/dxl &v1&4 cannot be executed as player!"), + ERROR_NO_PROTECTED_BLOCK("Error_NoDXLBlock", "&4This is not a block protected by DungeonsXL!"), + ERROR_NO_SUCH_GROUP("Error_NoSuchGroup", "&4The group &6&v1&4 does not exist!"), + ERROR_NO_SUCH_PLAYER("Error_NoSuchPlayer", "&4The player &6&v1&4 does not exist!"), + ERROR_NOT_CAPTAIN("Error_NotCaptain", "&4You are not the captain of your group!"), + ERROR_NOT_IN_DUNGEON("Error_NotInDungeon", "&4You are not in a dungeon!"), + ERROR_NOT_IN_GAME("Error_NotInGame", "&4The group &6&v1&4 is not member of a game."), + ERROR_NOT_IN_GROUP("Error_NotInGroup", "&4The player &6&v1&4 is not member of the group &6&v2&v4."), + ERROR_NOT_INVITED("Error_NotInvited", "&4You are not invited to the group &6&v1&4."), + ERROR_NOT_SAVED("Error_NotSaved", "&4The map &6&v1&4 has not been saved to the &6DungeonsXL/maps/ &4folder yet!"), + ERROR_TUTORIAL_NOT_EXIST("Error_TutorialNotExist", "&4Tutorial dungeon does not exist!"), + ERROR_READY("Error_Ready", "&4Choose your class first!"), + ERROR_REQUIREMENTS("Error_Requirements", "&4You don't fulfill the requirements for this Dungeon!"), + ERROR_SIGN_WRONG_FORMAT("Error_SignWrongFormat", "&4The sign is not written correctly!"), + HELP_CMD_BREAK("Help_Cmd_Break", "/dxl break - Break a block protected by DungeonsXL"), + HELP_CMD_CHAT("Help_Cmd_Chat", "/dxl chat - Change the chat mode"), + HELP_CMD_CHATSPY("Help_Cmd_Chatspy", "/dxl chatspy - Dis/enables the spymode"), + HELP_CMD_CREATE("Help_Cmd_Create", "/dxl create - Creates a new dungeon"), + HELP_CMD_EDIT("Help_Cmd_Edit", "/dxl edit - Edit an existing dungeon"), + HELP_CMD_ESCAPE("Help_Cmd_Escape", "/dxl escape - Leaves the current dungeon, without saving!"), + HELP_CMD_GAME("Help_Cmd_Game", "/dxl game - Shows information about the current game session"), + HELP_CMD_GROUP("Help_Cmd_Group", "/dxl group - Shows group command help"), + HELP_CMD_GROUP_CREATE("Help_Cmd_GroupCreate", "/dxl group create [group] - Creates a new group"), + HELP_CMD_GROUP_DISBAND("Help_Cmd_GroupDisband", "/dxl group disband ([group]) - Disbands a group"), + HELP_CMD_GROUP_INVITE("Help_Cmd_GroupInvite", "/dxl group invite [player]- Invites someone to your group"), + HELP_CMD_GROUP_UNINVITE("Help_Cmd_GroupUninvite", "/dxl group uninvite [player] - Takes back an invitation to your group"), + HELP_CMD_GROUP_JOIN("Help_Cmd_GroupJoin", "/dxl group join [group]- Join a group"), + HELP_CMD_GROUP_KICK("Help_Cmd_GroupKick", "/dxl group kick [player] - Kicks a player"), + HELP_CMD_GROUP_SHOW("Help_Cmd_GroupShow", "/dxl group show [group] - Shows a group"), + HELP_CMD_HELP("Help_Cmd_Help", "/dxl help - Shows the help page"), + HELP_CMD_INVITE("Help_Cmd_Invite", "/dxl invite - Invite a player to edit a dungeon"), + HELP_CMD_ENTER("Help_Cmd_Enter", "/dxl enter ([joining group]) [target group] - Let the joining group enter the game of the target group"), + HELP_CMD_LEAVE("Help_Cmd_Leave", "/dxl leave - Leaves the current dungeon"), + HELP_CMD_LIST("Help_Cmd_List", "/dxl list ([dungeon|map|loaded]) ([dungeon]) - Lists all dungeons"), + HELP_CMD_LIVES("Help_Cmd_Lives", "/dxl lives - Shows the lives a player has left"), + HELP_CMD_MAIN("Help_Cmd_Main", "/dxl - General status information"), + HELP_CMD_MSG("Help_Cmd_Msg", "/dxl msg '[msg]' - Show or edit a message"), + HELP_CMD_PLAY("Help_Cmd_Play", "/dxl play ([dungeon|map]) [name] - Allows the player to play a dungeon without a portal"), + HELP_CMD_PORTAL("Help_Cmd_Portal", "/dxl portal - Creates a portal that leads into a dungeon"), + HELP_CMD_RELOAD("Help_Cmd_Reload", "/dxl reload - Reloads the plugin"), + HELP_CMD_SAVE("Help_Cmd_Save", "/dxl save - Saves the current dungeon"), + HELP_CMD_TEST("Help_Cmd_Test", "/dxl test - Starts the game in test mode"), + HELP_CMD_UNINVITE("Help_Cmd_Uninvite", "/dxl uninvite - Uninvite a player to edit a dungeon"), + GROUP_CREATED("Group_Created", "&4&v1&6 created the group &4&v2&6!"), + GROUP_DISBANDED("Group_Disbanded", "&4&v1&6 disbanded the group &4&v2&6."), + GROUP_INVITED_PLAYER("Group_InvitedPlayer", "&4&v1&6 invited the player &4&v2&6 to the group &4&v3&6."), + GROUP_JOINED_GAME("Group_JoinedGame", "&6Your group successfully joined the game."), + GROUP_UNINVITED_PLAYER("Group_UninvitedPlayer", "&4&v1&6 took back the invitation for &4&v2&6 to the group &4&v3&6."), + GROUP_KICKED_PLAYER("Group_KickedPlayer", "&4&v1&6 kicked the player &4&v2&6 from the group &4&v3&6."), + GROUP_PLAYER_JOINED("Group_PlayerJoined", "&6Player &4&v1&6 has joined the group!"), + GROUP_WAVE_FINISHED("Group_WaveFinished", "&6Your group finished wave no. &4&v1&6. The next one is going to start in &4&v2&6 seconds."), + LOG_ERROR_MOB_ENCHANTMENT("Log_Error_MobEnchantment", "&4Error at loading mob.yml: Enchantment &6&v1&4 doesn't exist!"), + LOG_ERROR_MOBTYPE("Log_Error_MobType", "&4Error at loading mob.yml: Mob &6&v1&4 doesn't exist!"), + LOG_ERROR_NO_CONSOLE_COMMAND("Log_Error_NoConsoleCommand", "&6/dxl &v1&4 can not be executed as Console!"), + LOG_GENERATE_NEW_WORLD("Log_GenerateNewWorld", "&6Generate new world..."), + LOG_NEW_DUNGEON("Log_NewDungeon", "&6New Dungeon"), + LOG_WORLD_GENERATION_FINISHED("Log_WorldGenerationFinished", "&6World generation finished!"), + PLAYER_BLOCK_INFO("Player_BlockInfo", "&6Block-ID: &2&v1"), + PLAYER_CHECKPOINT_REACHED("Player_CheckpointReached", "&6Checkpoint reached!"), + PLAYER_DEATH("Player_Death", "&6You died, lives left: &2&v1"), + PLAYER_DEATH_KICK("Player_DeathKick", "&2&v1&6 died and lost his last life."), + PLAYER_FINISHED_DUNGEON("Player_FinishedDungeon", "&6You successfully finished the Dungeon!"), + PLAYER_INVITED("Player_Invited", "&4&v1&6 invited you to the group &4&v2&6."), + PLAYER_UNINVITED("Player_Uninvited", "&4&v1&6 took back your invitation to the group &4&v2&6."), + PLAYER_JOIN_GROUP("Player_JoinGroup", "&6You successfully joined the group!"), + PLAYER_KICKED("Player_Kicked", "&4You have been kicked out of the group &6&v1&4."), + PLAYER_LEAVE_GROUP("Player_LeaveGroup", "&6You have successfully left your group!"), + PLAYER_LEFT_GROUP("Player_LeftGroup", "&6Player &4&v1&6 has left the Group!"), + PLAYER_LOOT_ADDED("Player_LootAdded", "&4&v1&6 have been added to your reward inventory!"), + PLAYER_NEW_CAPTAIN("Player_NewCaptain", "&6You are now the new captain of your group."), + PLAYER_OFFLINE("Player_Offline", "&Player &4&v1&6 went offline. In &4&v2&6 seconds he will autmatically be kicked from the Dungeon!"), + PLAYER_OFFLINE_NEVER("Player_OfflineNever", "&Player &4&v1&6 went offline. He will &4not&6 be kicked from the Dungeon automatically!"), + PLAYER_PORTAL_ABORT("Player_PortalAbort", "&6Portal creation cancelled!"), + PLAYER_PORTAL_INTRODUCTION("Player_PortalIntroduction", "&6Click the two edges of the Portal with the wooden sword!"), + PLAYER_PORTAL_CREATED("Player_PortalCreated", "&6Portal created!"), + PLAYER_PORTAL_PROGRESS("Player_PortalProgress", "&6First Block, now the second one!"), + PLAYER_PROTECTED_BLOCK_DELETED("Player_ProtectedBlockDeleted", "&6Protected block deleted!"), + PLAYER_READY("Player_Ready", "&6You are now ready for the Dungeon!"), + PLAYER_SIGN_CREATED("Player_SignCreated", "&6Sign created!"), + PLAYER_SIGN_COPIED("Player_SignCopied", "&6Copied!"), + PLAYER_TIME_LEFT("Player_TimeLeft", "&v1You have &6&v2 &v1seconds left to finish the dungeon!"), + PLAYER_TIME_KICK("Player_TimeKick", "&2&v1&6's time expired."), + PLAYER_TREASURES("Player_Treasures", "&1Treasures"), + PLAYER_WAIT_FOR_OTHER_PLAYERS("Player_WaitForOtherPlayers", "&6Waiting for teammates..."), + REQUIREMENT_FEE("Requirement_Fee", "&6You have been charged &4&v1 &6for entering the dungeon."), + REWARD_GENERAL("Reward_General", "&6You received &4&v1 &6for finishing the dungeon."); + + private String identifier; + private String message; + + DMessages(String identifier, String message) { + this.identifier = identifier; + this.message = message; + } + + @Override + public String getIdentifier() { + return identifier; + } + + @Override + public String getMessage() { + return message; + } + + @Override + public void setMessage(String message) { + this.message = message; + } + + /* Statics */ + /** + * @param identifer + * the identifer to set + */ + public static Messages getByIdentifier(String identifier) { + for (Messages message : values()) { + if (message.getIdentifier().equals(identifier)) { + return message; + } + } + + return null; + } + + /** + * @return a FileConfiguration containing all messages + */ + public static FileConfiguration toConfig() { + FileConfiguration config = new YamlConfiguration(); + for (Messages message : values()) { + config.set(message.getIdentifier(), message.getMessage()); + } + + return config; + } + +} diff --git a/src/main/java/io/github/dre2n/dungeonsxl/config/MessageConfig.java b/src/main/java/io/github/dre2n/dungeonsxl/config/MessageConfig.java deleted file mode 100644 index 9122cf52..00000000 --- a/src/main/java/io/github/dre2n/dungeonsxl/config/MessageConfig.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Copyright (C) 2012-2016 Frank Baumann - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package io.github.dre2n.dungeonsxl.config; - -import java.io.File; -import java.io.IOException; -import java.util.Set; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; - -/** - * @author Frank Baumann, Milan Albrecht, Daniel Saukel - */ -public class MessageConfig { - - public enum Messages { - - GROUP_CREATED("Group_Created", "&4&v1&6 created the group &4&v2&6!"), - GROUP_DISBANDED("Group_Disbanded", "&4&v1&6 disbanded the group &4&v2&6."), - GROUP_INVITED_PLAYER("Group_InvitedPlayer", "&4&v1&6 invited the player &4&v2&6 to the group &4&v3&6."), - GROUP_JOINED_GAME("Group_JoinedGame", "&6Your group successfully joined the game."), - GROUP_UNINVITED_PLAYER("Group_UninvitedPlayer", "&4&v1&6 took back the invitation for &4&v2&6 to the group &4&v3&6."), - GROUP_KICKED_PLAYER("Group_KickedPlayer", "&4&v1&6 kicked the player &4&v2&6 from the group &4&v3&6."), - GROUP_PLAYER_JOINED("Group_PlayerJoined", "&6Player &4&v1&6 has joined the group!"), - GROUP_WAVE_FINISHED("Group_WaveFinished", "&6Your group finished wave no. &4&v1&6. The next one is going to start in &4&v2&6 seconds."), - - LOG_ERROR_MOB_ENCHANTMENT("Log_Error_MobEnchantment", "&4Error at loading mob.yml: Enchantment &6&v1&4 doesn't exist!"), - LOG_ERROR_MOBTYPE("Log_Error_MobType", "&4Error at loading mob.yml: Mob &6&v1&4 doesn't exist!"), - LOG_ERROR_NO_CONSOLE_COMMAND("Log_Error_NoConsoleCommand", "&6/dxl &v1&4 can not be executed as Console!"), - LOG_GENERATE_NEW_WORLD("Log_GenerateNewWorld", "&6Generate new world..."), - LOG_NEW_DUNGEON("Log_NewDungeon", "&6New Dungeon"), - LOG_WORLD_GENERATION_FINISHED("Log_WorldGenerationFinished", "&6World generation finished!"), - - PLAYER_BLOCK_INFO("Player_BlockInfo", "&6Block-ID: &2&v1"), - PLAYER_CHECKPOINT_REACHED("Player_CheckpointReached", "&6Checkpoint reached!"), - PLAYER_DEATH("Player_Death", "&6You died, lives left: &2&v1"), - PLAYER_DEATH_KICK("Player_DeathKick", "&2&v1&6 died and lost his last life."), - PLAYER_FINISHED_DUNGEON("Player_FinishedDungeon", "&6You successfully finished the Dungeon!"), - PLAYER_INVITED("Player_Invited", "&4&v1&6 invited you to the group &4&v2&6."), - PLAYER_UNINVITED("Player_Uninvited", "&4&v1&6 took back your invitation to the group &4&v2&6."), - PLAYER_JOIN_GROUP("Player_JoinGroup", "&6You successfully joined the group!"), - PLAYER_KICKED("Player_Kicked", "&4You have been kicked out of the group &6&v1&4."), - PLAYER_LEAVE_GROUP("Player_LeaveGroup", "&6You have successfully left your group!"), - PLAYER_LEFT_GROUP("Player_LeftGroup", "&6Player &4&v1&6 has left the Group!"), - PLAYER_LOOT_ADDED("Player_LootAdded", "&4&v1&6 have been added to your reward inventory!"), - PLAYER_NEW_CAPTAIN("Player_NewCaptain", "&6You are now the new captain of your group."), - PLAYER_OFFLINE("Player_Offline", "&Player &4&v1&6 went offline. In &4&v2&6 seconds he will autmatically be kicked from the Dungeon!"), - PLAYER_OFFLINE_NEVER("Player_OfflineNever", "&Player &4&v1&6 went offline. He will &4not&6 be kicked from the Dungeon automatically!"), - PLAYER_PORTAL_ABORT("Player_PortalAbort", "&6Portal creation cancelled!"), - PLAYER_PORTAL_INTRODUCTION("Player_PortalIntroduction", "&6Click the two edges of the Portal with the wooden sword!"), - PLAYER_PORTAL_CREATED("Player_PortalCreated", "&6Portal created!"), - PLAYER_PORTAL_PROGRESS("Player_PortalProgress", "&6First Block, now the second one!"), - PLAYER_PROTECTED_BLOCK_DELETED("Player_ProtectedBlockDeleted", "&6Protected block deleted!"), - PLAYER_READY("Player_Ready", "&6You are now ready for the Dungeon!"), - PLAYER_SIGN_CREATED("Player_SignCreated", "&6Sign created!"), - PLAYER_SIGN_COPIED("Player_SignCopied", "&6Copied!"), - PLAYER_TIME_LEFT("Player_TimeLeft", "&v1You have &6&v2 &v1seconds left to finish the dungeon!"), - PLAYER_TIME_KICK("Player_TimeKick", "&2&v1&6's time expired."), - PLAYER_TREASURES("Player_Treasures", "&1Treasures"), - PLAYER_WAIT_FOR_OTHER_PLAYERS("Player_WaitForOtherPlayers", "&6Waiting for teammates..."), - - CMD_BREAK_PROTECTED_MODE("Cmd_Break_ProtectedMode", "&6You may not break blocks protected by DungeonsXL anymore."), - CMD_BREAK_BREAK_MODE("Cmd_Break_BreakMode", "&6You may break a block protected by DungeonsXL."), - CMD_CHAT_DUNGEON_CHAT("Cmd_Chat_DungeonChat", "&6You have entered the Dungeon-chat"), - CMD_CHAT_NORMAL_CHAT("Cmd_Chat_NormalChat", "&6You are now in the public chat"), - CMD_CHATSPY_STOPPED("Cmd_Chatspy_Stopped", "&6You stopped spying the DXL-chat!"), - CMD_CHATSPY_START("Cmd_Chatspy_Start", "&You started spying the DXL-chat!"), - CMD_ENTER_SUCCESS("Cmd_Enter", "&6The group &4&v1 &6successfully entered the game of the group &4&v2&6."), - CMD_INVITE_SUCCESS("Cmd_Invite_Success", "&6Player &4&v1&6 was successfully invited to edit the Dungeon &4&v2&6!"), - CMD_LEAVE_SUCCESS("Cmd_Leave_Success", "&6You have successfully left your group!"), - CMD_LIVES("Cmd_Lives", "&4v1&6 has &4v2 &6lives left."), - CMD_MAIN_WELCOME("Cmd_Main_Welcome", "&7Welcome to &4Dungeons&fXL"), - CMD_MAIN_LOADED("Cmd_Main_Loaded", "&eMaps: &o[&v1] &eDungeons: &o[&v2] &eLoaded: &o[&v3] &ePlayers: &o[&v4]"), - CMD_MAIN_COMPATIBILITY("Cmd_Main_Compatibility", "&eInternals: &o[&v1] &eVault: &o[&v2] &eMythicMobs: &o[&v3]"), - CMD_MAIN_HELP("Cmd_Main_Help", "&7Type in &o/dxl help&r&7 for further information."), - CMD_MSG_ADDED("Cmd_Msg_Added", "&6New Messages (&4&v1&6) added!"), - CMD_MSG_UPDATED("Cmd_Msg_Updated", "&6Messages (&4&v1&6) updated!"), - CMD_RELOAD_DONE("Cmd_Reload_Done", "&7Successfully reloaded DungeonsXL."), - CMD_SAVE_SUCCESS("Cmd_Save_Success", "&6Dungeon saved!"), - CMD_UNINVITE_SUCCESS("Cmd_Uninvite_Success", "&4&v1&6 was successfully uninvited to edit the Dungeon &4&v1&6!"), - - ERROR_BED("Error_Bed", "&4You cannot use a bed while in a Dungeon!"), - ERROR_CHEST_IS_OPENED("Error_ChestIsOpened", "&4This chest has already been opened."), - ERROR_CMD("Error_Cmd", "&4Commands are not allowed while in a dungeon!"), - ERROR_CMD_NOT_EXIST_1("Error_CmdNotExist1", "&4Command &6&v1&4 does not exist!"), - ERROR_CMD_NOT_EXIST_2("Error_CmdNotExist2", "&4Please enter &6/dxl help&4 for help!"), - ERROR_COOLDOWN("Error_Cooldown", "&4You can only enter this Dungeon every &6&v1&4 hours!"), - ERROR_DISPENSER("Error_Dispenser", "&4You cannot access this dispenser!"), - ERROR_DROP("Error_Drop", "&4You cannot drop safe items"), - ERROR_DUNGEON_NOT_EXIST("Error_DungeonNotExist", "&4Dungeon &6&v1&4 does not exist!"), - ERROR_ENDERCHEST("Error_Enderchest", "&4You cannot use an enderchest while in a Dungeon!"), - ERROR_IN_GROUP("Error_InGroup", "&4The player &6&v1&4 is already member of a group."), - ERROR_JOIN_GROUP("Error_JoinGroup", "&4You have to join a group first!"), - ERROR_LEAVE_DUNGEON("Error_LeaveDungeon", "&4You have to leave your current dungeon first!"), - ERROR_LEAVE_GAME("Error_LeaveGame", "&4You have to leave your current game first!"), - ERROR_LEAVE_GROUP("Error_LeaveGroup", "&4You have to leave your group first!"), - ERROR_LEFT_CLICK("Error_Leftklick", "&4You have to use Left-Click on this sign!"), - ERROR_MSG_ID_NOT_EXIST("Error_MsgIdNotExist", "&4Messages with Id &6&v1&4 does not exist!"), - ERROR_MSG_FORMAT("Error_MsgFormat", "&4The Messages has to be between \"!"), - ERROR_MSG_NO_INT("Error_MsgNoInt", "&4Argument has to include a number!"), - ERROR_NAME_TO_LONG("Error_NameToLong", "&4The name may not be longer than 15 characters!"), - ERROR_NO_CONSOLE_COMMAND("Error_NoConsoleCommand", "&6/dxl &v1&4 cannot be executed as console!"), - ERROR_NO_GAME("Error_NoGame", "&4You currently do not take part in a game."), - ERROR_NO_LEAVE_IN_TUTORIAL("Error_NoLeaveInTutorial", "&4You cannot use this command in the tutorial!"), - ERROR_NO_PERMISSIONS("Error_NoPermissions", "&4You have no permission to do this!"), - ERROR_NO_PLAYER_COMMAND("Error_NoPlayerCommand", "&6/dxl &v1&4 cannot be executed as player!"), - ERROR_NO_PROTECTED_BLOCK("Error_NoDXLBlock", "&4This is not a block protected by DungeonsXL!"), - ERROR_NO_SUCH_GROUP("Error_NoSuchGroup", "&4The group &6&v1&4 does not exist!"), - ERROR_NO_SUCH_PLAYER("Error_NoSuchPlayer", "&4The player &6&v1&4 does not exist!"), - ERROR_NOT_CAPTAIN("Error_NotCaptain", "&4You are not the captain of your group!"), - ERROR_NOT_IN_DUNGEON("Error_NotInDungeon", "&4You are not in a dungeon!"), - ERROR_NOT_IN_GAME("Error_NotInGame", "&4The group &6&v1&4 is not member of a game."), - ERROR_NOT_IN_GROUP("Error_NotInGroup", "&4The player &6&v1&4 is not member of the group &6&v2&v4."), - ERROR_NOT_INVITED("Error_NotInvited", "&4You are not invited to the group &6&v1&4."), - ERROR_NOT_SAVED("Error_NotSaved", "&4The map &6&v1&4 has not been saved to the &6DungeonsXL/maps/ &4folder yet!"), - ERROR_TUTORIAL_NOT_EXIST("Error_TutorialNotExist", "&4Tutorial dungeon does not exist!"), - ERROR_READY("Error_Ready", "&4Choose your class first!"), - ERROR_REQUIREMENTS("Error_Requirements", "&4You don't fulfill the requirements for this Dungeon!"), - ERROR_SIGN_WRONG_FORMAT("Error_SignWrongFormat", "&4The sign is not written correctly!"), - - HELP_CMD_BREAK("Help_Cmd_Break", "/dxl break - Break a block protected by DungeonsXL"), - HELP_CMD_CHAT("Help_Cmd_Chat", "/dxl chat - Change the chat mode"), - HELP_CMD_CHATSPY("Help_Cmd_Chatspy", "/dxl chatspy - Dis/enables the spymode"), - HELP_CMD_CREATE("Help_Cmd_Create", "/dxl create - Creates a new dungeon"), - HELP_CMD_EDIT("Help_Cmd_Edit", "/dxl edit - Edit an existing dungeon"), - HELP_CMD_ESCAPE("Help_Cmd_Escape", "/dxl escape - Leaves the current dungeon, without saving!"), - HELP_CMD_GAME("Help_Cmd_Game", "/dxl game - Shows information about the current game session"), - HELP_CMD_GROUP("Help_Cmd_Group", "/dxl group - Shows group command help"), - HELP_CMD_GROUP_CREATE("Help_Cmd_GroupCreate", "/dxl group create [group] - Creates a new group"), - HELP_CMD_GROUP_DISBAND("Help_Cmd_GroupDisband", "/dxl group disband ([group]) - Disbands a group"), - HELP_CMD_GROUP_INVITE("Help_Cmd_GroupInvite", "/dxl group invite [player]- Invites someone to your group"), - HELP_CMD_GROUP_UNINVITE("Help_Cmd_GroupUninvite", "/dxl group uninvite [player] - Takes back an invitation to your group"), - HELP_CMD_GROUP_JOIN("Help_Cmd_GroupJoin", "/dxl group join [group]- Join a group"), - HELP_CMD_GROUP_KICK("Help_Cmd_GroupKick", "/dxl group kick [player] - Kicks a player"), - HELP_CMD_GROUP_SHOW("Help_Cmd_GroupShow", "/dxl group show [group] - Shows a group"), - HELP_CMD_HELP("Help_Cmd_Help", "/dxl help - Shows the help page"), - HELP_CMD_INVITE("Help_Cmd_Invite", "/dxl invite - Invite a player to edit a dungeon"), - HELP_CMD_ENTER("Help_Cmd_Enter", "/dxl enter ([joining group]) [target group] - Let the joining group enter the game of the target group"), - HELP_CMD_LEAVE("Help_Cmd_Leave", "/dxl leave - Leaves the current dungeon"), - HELP_CMD_LIST("Help_Cmd_List", "/dxl list ([dungeon|map|loaded]) ([dungeon]) - Lists all dungeons"), - HELP_CMD_LIVES("Help_Cmd_Lives", "/dxl lives - Shows the lives a player has left"), - HELP_CMD_MAIN("Help_Cmd_Main", "/dxl - General status information"), - HELP_CMD_MSG("Help_Cmd_Msg", "/dxl msg '[msg]' - Show or edit a message"), - HELP_CMD_PLAY("Help_Cmd_Play", "/dxl play ([dungeon|map]) [name] - Allows the player to play a dungeon without a portal"), - HELP_CMD_PORTAL("Help_Cmd_Portal", "/dxl portal - Creates a portal that leads into a dungeon"), - HELP_CMD_RELOAD("Help_Cmd_Reload", "/dxl reload - Reloads the plugin"), - HELP_CMD_SAVE("Help_Cmd_Save", "/dxl save - Saves the current dungeon"), - HELP_CMD_TEST("Help_Cmd_Test", "/dxl test - Starts the game in test mode"), - HELP_CMD_UNINVITE("Help_Cmd_Uninvite", "/dxl uninvite - Uninvite a player to edit a dungeon"), - - REQUIREMENT_FEE("Requirement_Fee", "&6You have been charged &4&v1 &6for entering the dungeon."), - - REWARD_GENERAL("Reward_General", "&6You received &4&v1 &6for finishing the dungeon."); - - private String identifier; - private String message; - - Messages(String identifier, String message) { - this.identifier = identifier; - this.message = message; - } - - /** - * @return the identifier - */ - public String getIdentifier() { - return identifier; - } - - /** - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * @param message - * the message to set - */ - public void setMessage(String message) { - this.message = message; - } - - // Static - /** - * @param identifer - * the identifer to set - */ - public static Messages getByIdentifier(String identifier) { - for (Messages message : Messages.values()) { - if (message.getIdentifier().equals(identifier)) { - return message; - } - } - - return null; - } - - /** - * @return a FileConfiguration containing all messages - */ - public static FileConfiguration toConfig() { - FileConfiguration config = new YamlConfiguration(); - for (Messages message : Messages.values()) { - config.set(message.getIdentifier(), message.getMessage()); - } - - return config; - } - - } - - private File file; - private FileConfiguration config; - - public MessageConfig(File file) { - this.file = file; - - if (!file.exists()) { - try { - file.createNewFile(); - config = Messages.toConfig(); - config.save(file); - - } catch (IOException exception) { - exception.printStackTrace(); - } - - } else { - config = YamlConfiguration.loadConfiguration(file); - load(); - } - - } - - public void load() { - if (config != null) { - Set keySet = config.getKeys(false); - for (String key : keySet) { - Messages message = Messages.getByIdentifier(key); - if (message != null) { - message.setMessage(config.getString(key)); - } - } - } - } - - public boolean changed() { - FileConfiguration config = YamlConfiguration.loadConfiguration(file); - if (!Messages.toConfig().getValues(false).equals(config.getValues(false))) { - return true; - - } else { - return false; - } - } - - public void save() { - if (!changed()) { - return; - } - - String filePath = file.getPath(); - File oldMessages = new File(filePath.substring(0, filePath.length() - 4) + "_old.yml"); - - try { - Messages.toConfig().save(oldMessages); - - } catch (IOException exception) { - exception.printStackTrace(); - } - } - - public String getMessage(Messages message, String... args) { - String output = message.getMessage(); - - int i = 0; - for (String arg : args) { - i++; - - if (arg != null) { - output = output.replace("&v" + i, arg); - - } else { - output = output.replace("&v" + i, "null"); - } - } - - return output; - } - -} diff --git a/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DLootInventory.java b/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DLootInventory.java index 11c9ee31..d400f0cc 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DLootInventory.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/dungeon/DLootInventory.java @@ -17,7 +17,7 @@ package io.github.dre2n.dungeonsxl.dungeon; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; @@ -41,7 +41,7 @@ public class DLootInventory { public DLootInventory(Player player, ItemStack[] itemStacks) { plugin.getDLootInventories().add(this); - inventory = Bukkit.createInventory(player, 54, ChatColor.translateAlternateColorCodes('&', plugin.getMessageConfig().getMessage(Messages.PLAYER_TREASURES))); + inventory = Bukkit.createInventory(player, 54, ChatColor.translateAlternateColorCodes('&', plugin.getMessageConfig().getMessage(DMessages.PLAYER_TREASURES))); for (ItemStack itemStack : itemStacks) { if (itemStack != null) { inventory.addItem(itemStack); diff --git a/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishFloorEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishFloorEvent.java index 632c61c0..9e94b8a6 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishFloorEvent.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupFinishFloorEvent.java @@ -16,8 +16,8 @@ */ package io.github.dre2n.dungeonsxl.event.dgroup; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DGroup; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupStartFloorEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupStartFloorEvent.java index 737681fc..16387055 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupStartFloorEvent.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/event/dgroup/DGroupStartFloorEvent.java @@ -16,8 +16,8 @@ */ package io.github.dre2n.dungeonsxl.event.dgroup; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DGroup; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignRegistrationEvent.java b/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignRegistrationEvent.java index 42ec913f..e8fccf66 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignRegistrationEvent.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/event/dsign/DSignRegistrationEvent.java @@ -16,8 +16,8 @@ */ package io.github.dre2n.dungeonsxl.event.dsign; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.sign.DSign; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.block.Sign; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/game/Game.java b/src/main/java/io/github/dre2n/dungeonsxl/game/Game.java index a07af2c7..7b2030e5 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/game/Game.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/game/Game.java @@ -18,7 +18,7 @@ package io.github.dre2n.dungeonsxl.game; import io.github.dre2n.commons.util.playerutil.PlayerUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.dungeon.Dungeon; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.sign.DSign; @@ -270,7 +270,7 @@ public class Game { } int delay = world.getConfig().getTimeToNextWave(); - sendMessage(plugin.getMessageConfig().getMessage(MessageConfig.Messages.GROUP_WAVE_FINISHED, String.valueOf(waveCount), String.valueOf(delay))); + sendMessage(plugin.getMessageConfig().getMessage(DMessages.GROUP_WAVE_FINISHED, String.valueOf(waveCount), String.valueOf(delay))); new BukkitRunnable() { @Override diff --git a/src/main/java/io/github/dre2n/dungeonsxl/game/GameChest.java b/src/main/java/io/github/dre2n/dungeonsxl/game/GameChest.java index 451f9eb1..8006cf64 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/game/GameChest.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/game/GameChest.java @@ -16,16 +16,16 @@ */ package io.github.dre2n.dungeonsxl.game; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; import io.github.dre2n.dungeonsxl.reward.LevelReward; import io.github.dre2n.dungeonsxl.reward.MoneyReward; import io.github.dre2n.dungeonsxl.reward.Reward; import io.github.dre2n.dungeonsxl.reward.RewardTypeDefault; +import io.github.dre2n.dungeonsxl.world.GameWorld; import net.milkbowl.vault.item.ItemInfo; import net.milkbowl.vault.item.Items; import org.bukkit.Bukkit; @@ -208,12 +208,12 @@ public class GameChest { msg = msg.substring(0, msg.length() - 1); } - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_LOOT_ADDED, msg)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_LOOT_ADDED, msg)); if (moneyReward != 0) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_LOOT_ADDED, plugin.getEconomyProvider().format(moneyReward))); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_LOOT_ADDED, plugin.getEconomyProvider().format(moneyReward))); } if (levelReward != 0) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_LOOT_ADDED, levelReward + " levels")); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_LOOT_ADDED, levelReward + " levels")); } } } @@ -244,7 +244,7 @@ public class GameChest { } if (gameChest.used) { - MessageUtil.sendMessage(plugin.getServer().getPlayer(event.getPlayer().getUniqueId()), plugin.getMessageConfig().getMessage(Messages.ERROR_CHEST_IS_OPENED)); + MessageUtil.sendMessage(plugin.getServer().getPlayer(event.getPlayer().getUniqueId()), plugin.getMessageConfig().getMessage(DMessages.ERROR_CHEST_IS_OPENED)); event.setCancelled(true); continue; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/game/GamePlaceableBlock.java b/src/main/java/io/github/dre2n/dungeonsxl/game/GamePlaceableBlock.java index 1480ff8c..6f3bb96b 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/game/GamePlaceableBlock.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/game/GamePlaceableBlock.java @@ -16,8 +16,8 @@ */ package io.github.dre2n.dungeonsxl.game; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.commons.util.NumberUtil; +import io.github.dre2n.dungeonsxl.world.GameWorld; import java.util.HashSet; import java.util.Set; import org.bukkit.Material; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java b/src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java index 1b84b8d5..a0a0788b 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/global/DPortal.java @@ -19,11 +19,11 @@ package io.github.dre2n.dungeonsxl.global; import io.github.dre2n.commons.util.BlockUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.game.Game; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; +import io.github.dre2n.dungeonsxl.world.GameWorld; import java.util.Set; import org.bukkit.Location; import org.bukkit.Material; @@ -166,7 +166,7 @@ public class DPortal extends GlobalProtection { DGroup dGroup = DGroup.getByPlayer(player); if (dGroup == null) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_JOIN_GROUP)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_JOIN_GROUP)); return; } @@ -194,7 +194,7 @@ public class DPortal extends GlobalProtection { } if (target == null) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_DUNGEON_NOT_EXIST, DGroup.getByPlayer(player).getMapName())); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_DUNGEON_NOT_EXIST, DGroup.getByPlayer(player).getMapName())); return; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java index 5f94868c..4ba5ae06 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GameSign.java @@ -19,12 +19,12 @@ package io.github.dre2n.dungeonsxl.global; import io.github.dre2n.commons.util.BlockUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.WorldConfig; import io.github.dre2n.dungeonsxl.dungeon.Dungeon; import io.github.dre2n.dungeonsxl.game.Game; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DGroup; +import io.github.dre2n.dungeonsxl.world.GameWorld; import java.io.File; import java.util.HashSet; import java.util.Set; @@ -461,17 +461,17 @@ public class GameSign extends GlobalProtection { DGroup dGroup = DGroup.getByPlayer(player); if (dGroup == null) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_JOIN_GROUP)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_JOIN_GROUP)); return true; } if (!dGroup.getCaptain().equals(player)) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_NOT_CAPTAIN)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_NOT_CAPTAIN)); return true; } if (Game.getByDGroup(dGroup) != null) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_LEAVE_GAME)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_LEAVE_GAME)); return true; } @@ -480,7 +480,7 @@ public class GameSign extends GlobalProtection { if (file != null) { WorldConfig confReader = new WorldConfig(file); if (confReader != null) { - dGroup.sendMessage(plugin.getMessageConfig().getMessage(Messages.ERROR_COOLDOWN, String.valueOf(confReader.getTimeToNextPlay()))); + dGroup.sendMessage(plugin.getMessageConfig().getMessage(DMessages.ERROR_COOLDOWN, String.valueOf(confReader.getTimeToNextPlay()))); } } @@ -488,7 +488,7 @@ public class GameSign extends GlobalProtection { } if (!GameWorld.checkRequirements(gameSign.mapName, dGroup)) { - dGroup.sendMessage(plugin.getMessageConfig().getMessage(Messages.ERROR_REQUIREMENTS)); + dGroup.sendMessage(plugin.getMessageConfig().getMessage(DMessages.ERROR_REQUIREMENTS)); return true; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java b/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java index f933e932..687b2e53 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/global/GroupSign.java @@ -19,11 +19,11 @@ package io.github.dre2n.dungeonsxl.global; import io.github.dre2n.commons.util.BlockUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.WorldConfig; import io.github.dre2n.dungeonsxl.dungeon.Dungeon; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DGroup; +import io.github.dre2n.dungeonsxl.world.GameWorld; import java.io.File; import java.util.HashSet; import java.util.Set; @@ -458,7 +458,7 @@ public class GroupSign extends GlobalProtection { } if (DGroup.getByPlayer(player) != null) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_LEAVE_GROUP)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_LEAVE_GROUP)); return true; } @@ -467,7 +467,7 @@ public class GroupSign extends GlobalProtection { if (file != null) { WorldConfig confReader = new WorldConfig(file); if (confReader != null) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_COOLDOWN, String.valueOf(confReader.getTimeToNextPlay()))); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_COOLDOWN, String.valueOf(confReader.getTimeToNextPlay()))); } } @@ -475,7 +475,7 @@ public class GroupSign extends GlobalProtection { } if (!GameWorld.checkRequirements(groupSign.mapName, player)) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_REQUIREMENTS)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_REQUIREMENTS)); return true; } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java b/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java index f1a641ac..7aeb7433 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/global/LeaveSign.java @@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.global; import io.github.dre2n.commons.util.BlockUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; import java.util.HashSet; @@ -112,7 +112,7 @@ public class LeaveSign extends GlobalProtection { DGroup dgroup = DGroup.getByPlayer(player); if (dgroup != null) { dgroup.removePlayer(player); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_LEAVE_GROUP)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_LEAVE_GROUP)); return true; } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/listener/BlockListener.java b/src/main/java/io/github/dre2n/dungeonsxl/listener/BlockListener.java index 7f8cd64a..b2199716 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/listener/BlockListener.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/listener/BlockListener.java @@ -19,12 +19,10 @@ package io.github.dre2n.dungeonsxl.listener; import io.github.dre2n.commons.util.NumberUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; -import io.github.dre2n.dungeonsxl.world.EditWorld; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.game.GamePlaceableBlock; import io.github.dre2n.dungeonsxl.game.GameType; import io.github.dre2n.dungeonsxl.game.GameTypeDefault; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.global.DPortal; import io.github.dre2n.dungeonsxl.global.GameSign; import io.github.dre2n.dungeonsxl.global.GlobalProtection; @@ -34,6 +32,8 @@ import io.github.dre2n.dungeonsxl.player.DGlobalPlayer; import io.github.dre2n.dungeonsxl.player.DPlayers; import io.github.dre2n.dungeonsxl.sign.DSign; import io.github.dre2n.dungeonsxl.task.RedstoneEventTask; +import io.github.dre2n.dungeonsxl.world.EditWorld; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -78,8 +78,8 @@ public class BlockListener implements Listener { if (protection != null) { if (dGlobalPlayer.isInBreakMode()) { protection.delete(); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_PROTECTED_BLOCK_DELETED)); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.CMD_BREAK_PROTECTED_MODE)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_PROTECTED_BLOCK_DELETED)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.CMD_BREAK_PROTECTED_MODE)); dGlobalPlayer.setInBreakMode(false); } else { @@ -220,16 +220,16 @@ public class BlockListener implements Listener { } if (!player.hasPermission(dsign.getType().getBuildPermission())) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_NO_PERMISSIONS)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_NO_PERMISSIONS)); } if (dsign.check()) { editWorld.checkSign(block); editWorld.getSigns().add(block); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_SIGN_CREATED)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_SIGN_CREATED)); } else { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.ERROR_SIGN_WRONG_FORMAT)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.ERROR_SIGN_WRONG_FORMAT)); } } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java b/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java index e9963a4d..676dc98c 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java @@ -16,10 +16,10 @@ */ package io.github.dre2n.dungeonsxl.listener; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.WorldConfig; import io.github.dre2n.dungeonsxl.dungeon.DLootInventory; import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent; @@ -111,7 +111,7 @@ public class PlayerListener implements Listener { dPlayer.setLives(dPlayer.getLives() - dPlayerDeathEvent.getLostLives()); if (dPlayer.getLives() != -1) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.PLAYER_DEATH, String.valueOf(dPlayer.getLives()))); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_DEATH, String.valueOf(dPlayer.getLives()))); if (dConfig != null) { if (dConfig.getKeepInventoryOnDeath()) { @@ -129,7 +129,7 @@ public class PlayerListener implements Listener { DPlayerKickEvent dPlayerKickEvent = new DPlayerKickEvent(dPlayer, DPlayerKickEvent.Cause.DEATH); if (!dPlayerKickEvent.isCancelled()) { - MessageUtil.broadcastMessage(messageConfig.getMessage(Messages.PLAYER_DEATH_KICK, player.getName())); + MessageUtil.broadcastMessage(messageConfig.getMessage(DMessages.PLAYER_DEATH_KICK, player.getName())); dPlayer.leave(); if (gameWorld.getConfig().getKeepInventoryOnEscape()) { dPlayer.applyRespawnInventory(); @@ -154,13 +154,13 @@ public class PlayerListener implements Listener { if (event.getAction() != Action.LEFT_CLICK_BLOCK) { if (clickedBlock.getType() == Material.ENDER_CHEST) { if (!player.hasPermission("dxl.bypass")) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_ENDERCHEST)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_ENDERCHEST)); event.setCancelled(true); } } else if (clickedBlock.getType() == Material.BED_BLOCK) { if (!player.hasPermission("dxl.bypass")) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_BED)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_BED)); event.setCancelled(true); } } @@ -172,7 +172,7 @@ public class PlayerListener implements Listener { if (event.getAction() != Action.LEFT_CLICK_BLOCK) { if (clickedBlock.getType() == Material.DISPENSER) { if (!player.hasPermission("dxl.bypass")) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_DISPENSER)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_DISPENSER)); event.setCancelled(true); } } @@ -193,13 +193,13 @@ public class PlayerListener implements Listener { if (dPortal == dGlobalPlayer.getPortal()) { if (dPortal.getBlock1() == null) { dPortal.setBlock1(event.getClickedBlock()); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.PLAYER_PORTAL_PROGRESS)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PORTAL_PROGRESS)); } else if (dPortal.getBlock2() == null) { dPortal.setBlock2(event.getClickedBlock()); dPortal.setActive(true); dPortal.create(); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.PLAYER_PORTAL_CREATED)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PORTAL_CREATED)); } event.setCancelled(true); } @@ -285,7 +285,7 @@ public class PlayerListener implements Listener { if (event.getAction() == Action.LEFT_CLICK_BLOCK) { trigger.onTrigger(player); } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_LEFT_CLICK)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEFT_CLICK)); } } @@ -296,7 +296,7 @@ public class PlayerListener implements Listener { if (event.getAction() == Action.LEFT_CLICK_BLOCK) { dPlayer.setDClass(ChatColor.stripColor(classSign.getLine(1))); } else { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_LEFT_CLICK)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEFT_CLICK)); } return; } @@ -338,7 +338,7 @@ public class PlayerListener implements Listener { for (Material material : gameWorld.getConfig().getSecureObjects()) { if (material == event.getItemDrop().getItemStack().getType()) { event.setCancelled(true); - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_DROP)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_DROP)); return; } } @@ -460,11 +460,11 @@ public class PlayerListener implements Listener { dPlayer.leave(); } else if (timeUntilKickOfflinePlayer > 0) { - dGroup.sendMessage(messageConfig.getMessage(Messages.PLAYER_OFFLINE, dPlayer.getPlayer().getName(), "" + timeUntilKickOfflinePlayer), player); + dGroup.sendMessage(messageConfig.getMessage(DMessages.PLAYER_OFFLINE, dPlayer.getPlayer().getName(), "" + timeUntilKickOfflinePlayer), player); dPlayer.setOfflineTime(System.currentTimeMillis() + timeUntilKickOfflinePlayer * 1000); } else { - dGroup.sendMessage(messageConfig.getMessage(Messages.PLAYER_OFFLINE_NEVER, dPlayer.getPlayer().getName()), player); + dGroup.sendMessage(messageConfig.getMessage(DMessages.PLAYER_OFFLINE_NEVER, dPlayer.getPlayer().getName()), player); } } else if (dPlayer.isEditing()) { @@ -544,7 +544,7 @@ public class PlayerListener implements Listener { } if (dGroup.getGameWorld() == null) { - MessageUtil.sendMessage(player, messageConfig.getMessage(Messages.ERROR_TUTORIAL_NOT_EXIST)); + MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_TUTORIAL_NOT_EXIST)); continue; } @@ -596,7 +596,7 @@ public class PlayerListener implements Listener { } if (event.isCancelled()) { - MessageUtil.sendMessage(event.getPlayer(), messageConfig.getMessage(Messages.ERROR_CMD)); + MessageUtil.sendMessage(event.getPlayer(), messageConfig.getMessage(DMessages.ERROR_CMD)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java index 7e628631..8a22c3b5 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/mob/DMobType.java @@ -19,7 +19,7 @@ package io.github.dre2n.dungeonsxl.mob; import io.github.dre2n.commons.util.EnumUtil; import io.github.dre2n.commons.util.NumberUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.world.GameWorld; import java.util.Arrays; import java.util.HashMap; @@ -128,7 +128,7 @@ public class DMobType { EntityType type = EntityType.fromName(configFile.getString(mobName + ".Type")); if (type == null) { - plugin.getLogger().info(plugin.getMessageConfig().getMessage(Messages.LOG_ERROR_MOBTYPE, configFile.getString(mobName + ".Type"))); + plugin.getLogger().info(plugin.getMessageConfig().getMessage(DMessages.LOG_ERROR_MOBTYPE, configFile.getString(mobName + ".Type"))); continue; } @@ -210,7 +210,7 @@ public class DMobType { itemMeta.addEnchant(Enchantment.getByName(splittedEnchantment[0].toUpperCase()), 1, true); } } else { - plugin.getLogger().info(plugin.getMessageConfig().getMessage(Messages.LOG_ERROR_MOB_ENCHANTMENT, splittedEnchantment[0])); + plugin.getLogger().info(plugin.getMessageConfig().getMessage(DMessages.LOG_ERROR_MOB_ENCHANTMENT, splittedEnchantment[0])); } } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java index 1da04c96..4e523c88 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DGroup.java @@ -16,10 +16,10 @@ */ package io.github.dre2n.dungeonsxl.player; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.WorldConfig; import io.github.dre2n.dungeonsxl.dungeon.Dungeon; import io.github.dre2n.dungeonsxl.event.dgroup.DGroupDisbandEvent; @@ -147,8 +147,8 @@ public class DGroup { * the player to add */ public void addPlayer(Player player) { - sendMessage(plugin.getMessageConfig().getMessage(Messages.GROUP_PLAYER_JOINED, player.getName())); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_JOIN_GROUP)); + sendMessage(plugin.getMessageConfig().getMessage(DMessages.GROUP_PLAYER_JOINED, player.getName())); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_JOIN_GROUP)); players.add(player); } @@ -162,7 +162,7 @@ public class DGroup { GroupSign.updatePerGroup(this); // Send message - sendMessage(plugin.getMessageConfig().getMessage(Messages.PLAYER_LEFT_GROUP, player.getName())); + sendMessage(plugin.getMessageConfig().getMessage(DMessages.PLAYER_LEFT_GROUP, player.getName())); // Check group if (isEmpty()) { @@ -197,18 +197,18 @@ public class DGroup { if (DGroup.getByPlayer(player) != null) { if (!silent) { - MessageUtil.sendMessage(captain, plugin.getMessageConfig().getMessage(Messages.ERROR_IN_GROUP, player.getName())); + MessageUtil.sendMessage(captain, plugin.getMessageConfig().getMessage(DMessages.ERROR_IN_GROUP, player.getName())); } return; } if (!silent) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_INVITED, captain.getName(), name)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_INVITED, captain.getName(), name)); } // Send message if (!silent) { - sendMessage(plugin.getMessageConfig().getMessage(Messages.GROUP_INVITED_PLAYER, captain.getName(), player.getName(), name)); + sendMessage(plugin.getMessageConfig().getMessage(DMessages.GROUP_INVITED_PLAYER, captain.getName(), player.getName(), name)); } // Add player @@ -226,19 +226,19 @@ public class DGroup { if (DGroup.getByPlayer(player) != this) { if (!silent) { - MessageUtil.sendMessage(captain, plugin.getMessageConfig().getMessage(Messages.ERROR_NOT_IN_GROUP, player.getName(), name)); + MessageUtil.sendMessage(captain, plugin.getMessageConfig().getMessage(DMessages.ERROR_NOT_IN_GROUP, player.getName(), name)); } return; } if (!silent) { - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_UNINVITED, player.getName(), name)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_UNINVITED, player.getName(), name)); } // Send message if (!silent) { for (Player groupPlayer : getPlayers()) { - MessageUtil.sendMessage(groupPlayer, plugin.getMessageConfig().getMessage(Messages.GROUP_UNINVITED_PLAYER, captain.getName(), player.getName(), name)); + MessageUtil.sendMessage(groupPlayer, plugin.getMessageConfig().getMessage(DMessages.GROUP_UNINVITED_PLAYER, captain.getName(), player.getName(), name)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayer.java b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayer.java index debeafb3..7d501852 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayer.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/player/DPlayer.java @@ -18,13 +18,13 @@ package io.github.dre2n.dungeonsxl.player; import io.github.dre2n.commons.compatibility.CompatibilityHandler; import io.github.dre2n.commons.compatibility.Version; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.NumberUtil; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.commons.util.playerutil.PlayerUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.config.DungeonConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; import io.github.dre2n.dungeonsxl.config.WorldConfig; import io.github.dre2n.dungeonsxl.dungeon.DLootInventory; import io.github.dre2n.dungeonsxl.event.dgroup.DGroupFinishDungeonEvent; @@ -87,7 +87,7 @@ public class DPlayer extends DGlobalPlayer { private long offlineTime; private String[] linesCopy; - private Inventory treasureInv = plugin.getServer().createInventory(getPlayer(), 45, messageConfig.getMessage(Messages.PLAYER_TREASURES)); + private Inventory treasureInv = plugin.getServer().createInventory(getPlayer(), 45, messageConfig.getMessage(DMessages.PLAYER_TREASURES)); private int initialLives = -1; private int lives; @@ -579,7 +579,7 @@ public class DPlayer extends DGlobalPlayer { // Captain here! Player newCaptain = dGroup.getPlayers().get(0); dGroup.setCaptain(newCaptain); - MessageUtil.sendMessage(newCaptain, messageConfig.getMessage(Messages.PLAYER_NEW_CAPTAIN)); + MessageUtil.sendMessage(newCaptain, messageConfig.getMessage(DMessages.PLAYER_NEW_CAPTAIN)); // ...*flies away* } } @@ -648,7 +648,7 @@ public class DPlayer extends DGlobalPlayer { } public void finishFloor(String specifiedFloor) { - MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(Messages.PLAYER_FINISHED_DUNGEON)); + MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(DMessages.PLAYER_FINISHED_DUNGEON)); finished = true; DGroup dGroup = DGroup.getByPlayer(getPlayer()); @@ -663,7 +663,7 @@ public class DPlayer extends DGlobalPlayer { for (Player player : dGroup.getPlayers()) { DPlayer dPlayer = getByPlayer(player); if (!dPlayer.finished) { - MessageUtil.sendMessage(this.getPlayer(), messageConfig.getMessage(Messages.PLAYER_WAIT_FOR_OTHER_PLAYERS)); + MessageUtil.sendMessage(this.getPlayer(), messageConfig.getMessage(DMessages.PLAYER_WAIT_FOR_OTHER_PLAYERS)); return; } } @@ -728,7 +728,7 @@ public class DPlayer extends DGlobalPlayer { public void finish(boolean message) { if (message) { - MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(Messages.PLAYER_FINISHED_DUNGEON)); + MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(DMessages.PLAYER_FINISHED_DUNGEON)); } finished = true; @@ -748,7 +748,7 @@ public class DPlayer extends DGlobalPlayer { DPlayer dPlayer = getByPlayer(player); if (!dPlayer.finished) { if (message) { - MessageUtil.sendMessage(this.getPlayer(), messageConfig.getMessage(Messages.PLAYER_WAIT_FOR_OTHER_PLAYERS)); + MessageUtil.sendMessage(this.getPlayer(), messageConfig.getMessage(DMessages.PLAYER_WAIT_FOR_OTHER_PLAYERS)); } hasToWait = true; @@ -829,14 +829,14 @@ public class DPlayer extends DGlobalPlayer { } } else { linesCopy = lines; - MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(Messages.PLAYER_SIGN_COPIED)); + MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(DMessages.PLAYER_SIGN_COPIED)); } } else { String info = "" + block.getType(); if (block.getData() != 0) { info = info + "," + block.getData(); } - MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(Messages.PLAYER_BLOCK_INFO, info)); + MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(DMessages.PLAYER_BLOCK_INFO, info)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java index 53bd0911..7721529b 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeLevelRequirement.java @@ -17,7 +17,7 @@ package io.github.dre2n.dungeonsxl.requirement; import io.github.dre2n.commons.util.messageutil.MessageUtil; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import org.bukkit.entity.Player; /** @@ -52,7 +52,7 @@ public class FeeLevelRequirement extends Requirement { @Override public void demand(Player player) { player.setLevel(player.getLevel() - fee); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.REQUIREMENT_FEE, fee + " levels")); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.REQUIREMENT_FEE, fee + " levels")); } @Override diff --git a/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java b/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java index 6164e502..1098d485 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/requirement/FeeMoneyRequirement.java @@ -17,7 +17,7 @@ package io.github.dre2n.dungeonsxl.requirement; import io.github.dre2n.commons.util.messageutil.MessageUtil; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import org.bukkit.entity.Player; /** @@ -60,7 +60,7 @@ public class FeeMoneyRequirement extends Requirement { } plugin.getEconomyProvider().withdrawPlayer(player, fee); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.REQUIREMENT_FEE, plugin.getEconomyProvider().format(fee))); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.REQUIREMENT_FEE, plugin.getEconomyProvider().format(fee))); } @Override diff --git a/src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java index 23b97413..03402966 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/LevelReward.java @@ -17,7 +17,7 @@ package io.github.dre2n.dungeonsxl.reward; import io.github.dre2n.commons.util.messageutil.MessageUtil; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import org.bukkit.entity.Player; /** @@ -55,7 +55,7 @@ public class LevelReward extends Reward { @Override public void giveTo(Player player) { player.setLevel(player.getLevel() + levels); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.REWARD_GENERAL, levels + " levels")); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.REWARD_GENERAL, levels + " levels")); } @Override diff --git a/src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java b/src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java index 9d0dd72b..37d203d1 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/reward/MoneyReward.java @@ -17,7 +17,7 @@ package io.github.dre2n.dungeonsxl.reward; import io.github.dre2n.commons.util.messageutil.MessageUtil; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import org.bukkit.entity.Player; /** @@ -59,7 +59,7 @@ public class MoneyReward extends Reward { } plugin.getEconomyProvider().depositPlayer(player, money); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.REWARD_GENERAL, plugin.getEconomyProvider().format(money))); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.REWARD_GENERAL, plugin.getEconomyProvider().format(money))); } @Override diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java index 9c7e9c8c..95d08924 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/CheckpointSign.java @@ -17,9 +17,9 @@ package io.github.dre2n.dungeonsxl.sign; import io.github.dre2n.commons.util.messageutil.MessageUtil; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; -import io.github.dre2n.dungeonsxl.world.GameWorld; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.player.DPlayer; +import io.github.dre2n.dungeonsxl.world.GameWorld; import java.util.concurrent.CopyOnWriteArrayList; import org.bukkit.Material; import org.bukkit.block.Sign; @@ -60,7 +60,7 @@ public class CheckpointSign extends DSign { for (DPlayer dplayer : DPlayer.getByWorld(getGameWorld().getWorld())) { dplayer.setCheckpoint(getSign().getLocation()); - MessageUtil.sendMessage(dplayer.getPlayer(), plugin.getMessageConfig().getMessage(Messages.PLAYER_CHECKPOINT_REACHED)); + MessageUtil.sendMessage(dplayer.getPlayer(), plugin.getMessageConfig().getMessage(DMessages.PLAYER_CHECKPOINT_REACHED)); } remove(); @@ -77,7 +77,7 @@ public class CheckpointSign extends DSign { if (!done.contains(dplayer)) { done.add(dplayer); dplayer.setCheckpoint(getSign().getLocation()); - MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(Messages.PLAYER_CHECKPOINT_REACHED)); + MessageUtil.sendMessage(player, plugin.getMessageConfig().getMessage(DMessages.PLAYER_CHECKPOINT_REACHED)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/ClassesSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/ClassesSign.java index c7f1a42b..0507af57 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/ClassesSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/ClassesSign.java @@ -16,9 +16,9 @@ */ package io.github.dre2n.dungeonsxl.sign; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.global.GroupSign; import io.github.dre2n.dungeonsxl.player.DClass; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java index 639dbf03..1e7f7145 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/CommandSign.java @@ -20,8 +20,8 @@ import io.github.dre2n.commandsxl.CommandsXL; import io.github.dre2n.commandsxl.command.CCommand; import io.github.dre2n.commandsxl.command.CCommandExecutorTask; import io.github.dre2n.commons.util.NumberUtil; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/EndSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/EndSign.java index d38164ae..f5e1085c 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/EndSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/EndSign.java @@ -16,9 +16,9 @@ */ package io.github.dre2n.dungeonsxl.sign; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DPlayer; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Sign; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java index d874c75b..bcbf02cb 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/FloorSign.java @@ -16,9 +16,9 @@ */ package io.github.dre2n.dungeonsxl.sign; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DPlayer; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Sign; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java index 224e2b03..aa43246d 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/InteractSign.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.sign; import io.github.dre2n.commons.util.NumberUtil; -import io.github.dre2n.dungeonsxl.world.EditWorld; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.task.SignUpdateTask; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; +import io.github.dre2n.dungeonsxl.world.EditWorld; +import io.github.dre2n.dungeonsxl.world.GameWorld; import java.util.HashSet; import java.util.Set; import org.bukkit.ChatColor; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java index d4fef2eb..34487065 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/LeaveSign.java @@ -17,9 +17,9 @@ package io.github.dre2n.dungeonsxl.sign; import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerEscapeEvent; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DPlayer; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Sign; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/ReadySign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/ReadySign.java index d9781cbb..47ce7114 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/ReadySign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/ReadySign.java @@ -17,14 +17,14 @@ package io.github.dre2n.dungeonsxl.sign; import io.github.dre2n.commons.util.messageutil.MessageUtil; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.game.Game; import io.github.dre2n.dungeonsxl.game.GameType; import io.github.dre2n.dungeonsxl.game.GameTypeDefault; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; import io.github.dre2n.dungeonsxl.trigger.InteractTrigger; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Sign; @@ -117,10 +117,10 @@ public class ReadySign extends DSign { if (getGameWorld().getSignClass().isEmpty() || dPlayer.getDClass() != null) { GameType forced = getGameWorld().getConfig().getForcedGameType(); dPlayer.ready(forced == null ? gameType : forced); - MessageUtil.sendMessage(dPlayer.getPlayer(), plugin.getMessageConfig().getMessage(Messages.PLAYER_READY)); + MessageUtil.sendMessage(dPlayer.getPlayer(), plugin.getMessageConfig().getMessage(DMessages.PLAYER_READY)); } else { - MessageUtil.sendMessage(dPlayer.getPlayer(), plugin.getMessageConfig().getMessage(Messages.ERROR_READY)); + MessageUtil.sendMessage(dPlayer.getPlayer(), plugin.getMessageConfig().getMessage(DMessages.ERROR_READY)); } } diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java index 20646918..721b03c9 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/RedstoneSign.java @@ -17,8 +17,8 @@ package io.github.dre2n.dungeonsxl.sign; import io.github.dre2n.commons.util.NumberUtil; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.task.DelayedPowerTask; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Sign; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java b/src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java index 53c0066d..1a9d8ca4 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/sign/TriggerSign.java @@ -17,10 +17,10 @@ package io.github.dre2n.dungeonsxl.sign; import io.github.dre2n.commons.util.NumberUtil; -import io.github.dre2n.dungeonsxl.world.EditWorld; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.task.SignUpdateTask; import io.github.dre2n.dungeonsxl.trigger.SignTrigger; +import io.github.dre2n.dungeonsxl.world.EditWorld; +import io.github.dre2n.dungeonsxl.world.GameWorld; import java.util.HashSet; import java.util.Set; import org.bukkit.Material; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/task/DelayedPowerTask.java b/src/main/java/io/github/dre2n/dungeonsxl/task/DelayedPowerTask.java index e5b037af..9520c78b 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/task/DelayedPowerTask.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/task/DelayedPowerTask.java @@ -16,8 +16,8 @@ */ package io.github.dre2n.dungeonsxl.task; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.sign.RedstoneSign; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.scheduler.BukkitRunnable; /** diff --git a/src/main/java/io/github/dre2n/dungeonsxl/task/LazyUpdateTask.java b/src/main/java/io/github/dre2n/dungeonsxl/task/LazyUpdateTask.java index 50187a37..cc3b2e49 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/task/LazyUpdateTask.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/task/LazyUpdateTask.java @@ -17,8 +17,8 @@ package io.github.dre2n.dungeonsxl.task; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.player.DPlayer; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.scheduler.BukkitRunnable; /** diff --git a/src/main/java/io/github/dre2n/dungeonsxl/task/RedstoneEventTask.java b/src/main/java/io/github/dre2n/dungeonsxl/task/RedstoneEventTask.java index 4bb06d3a..4e138e48 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/task/RedstoneEventTask.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/task/RedstoneEventTask.java @@ -17,8 +17,8 @@ package io.github.dre2n.dungeonsxl.task; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.world.GameWorld; import io.github.dre2n.dungeonsxl.trigger.RedstoneTrigger; +import io.github.dre2n.dungeonsxl.world.GameWorld; import org.bukkit.block.Block; import org.bukkit.scheduler.BukkitRunnable; diff --git a/src/main/java/io/github/dre2n/dungeonsxl/task/TimeIsRunningTask.java b/src/main/java/io/github/dre2n/dungeonsxl/task/TimeIsRunningTask.java index 5307a089..90b23819 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/task/TimeIsRunningTask.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/task/TimeIsRunningTask.java @@ -16,10 +16,10 @@ */ package io.github.dre2n.dungeonsxl.task; +import io.github.dre2n.commons.config.MessageConfig; import io.github.dre2n.commons.util.messageutil.MessageUtil; import io.github.dre2n.dungeonsxl.DungeonsXL; -import io.github.dre2n.dungeonsxl.config.MessageConfig; -import io.github.dre2n.dungeonsxl.config.MessageConfig.Messages; +import io.github.dre2n.dungeonsxl.config.DMessages; import io.github.dre2n.dungeonsxl.event.dplayer.DPlayerKickEvent; import io.github.dre2n.dungeonsxl.player.DGroup; import io.github.dre2n.dungeonsxl.player.DPlayer; @@ -58,7 +58,7 @@ public class TimeIsRunningTask extends BukkitRunnable { } finally { for (Player player : dGroup.getPlayers()) { - MessageUtil.sendActionBarMessage(player, messageConfig.getMessage(Messages.PLAYER_TIME_LEFT, color, String.valueOf(timeLeft))); + MessageUtil.sendActionBarMessage(player, messageConfig.getMessage(DMessages.PLAYER_TIME_LEFT, color, String.valueOf(timeLeft))); DPlayer dPlayer = DPlayer.getByPlayer(player); if (timeLeft > 0) { @@ -68,7 +68,7 @@ public class TimeIsRunningTask extends BukkitRunnable { DPlayerKickEvent dPlayerKickEvent = new DPlayerKickEvent(dPlayer, DPlayerKickEvent.Cause.TIME_EXPIRED); if (!dPlayerKickEvent.isCancelled()) { - MessageUtil.broadcastMessage(messageConfig.getMessage(Messages.PLAYER_TIME_KICK, player.getName())); + MessageUtil.broadcastMessage(messageConfig.getMessage(DMessages.PLAYER_TIME_KICK, player.getName())); dPlayer.leave(); if (dGroup.getGameWorld().getConfig().getKeepInventoryOnEscape()) { dPlayer.applyRespawnInventory(); diff --git a/src/main/java/io/github/dre2n/dungeonsxl/task/WorldUnloadTask.java b/src/main/java/io/github/dre2n/dungeonsxl/task/WorldUnloadTask.java index 0f43db52..bd8f598c 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/task/WorldUnloadTask.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/task/WorldUnloadTask.java @@ -17,9 +17,9 @@ package io.github.dre2n.dungeonsxl.task; import io.github.dre2n.dungeonsxl.DungeonsXL; +import io.github.dre2n.dungeonsxl.player.DPlayer; import io.github.dre2n.dungeonsxl.world.EditWorld; import io.github.dre2n.dungeonsxl.world.GameWorld; -import io.github.dre2n.dungeonsxl.player.DPlayer; import org.bukkit.scheduler.BukkitRunnable; /**