mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-04 17:59:31 +01:00
Update to BRCommons 0.5.1
This commit is contained in:
parent
601e0cb33e
commit
bcd931c2fe
2
pom.xml
2
pom.xml
@ -67,7 +67,7 @@
|
||||
<dependency>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
<artifactId>commons</artifactId>
|
||||
<version>0.5</version>
|
||||
<version>0.5.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.dre2n</groupId>
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -32,13 +31,12 @@ import org.bukkit.entity.Player;
|
||||
public class BreakCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public BreakCommand() {
|
||||
setCommand("break");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(0);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_BREAK));
|
||||
setHelp(DMessages.HELP_CMD_BREAK.getMessage());
|
||||
setPermission(DPermissions.BREAK.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -50,11 +48,11 @@ public class BreakCommand extends BRCommand {
|
||||
|
||||
if (dGlobalPlayer.isInBreakMode()) {
|
||||
dGlobalPlayer.setInBreakMode(false);
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.CMD_BREAK_PROTECTED_MODE));
|
||||
MessageUtil.sendMessage(sender, DMessages.CMD_BREAK_PROTECTED_MODE.getMessage());
|
||||
|
||||
} else {
|
||||
dGlobalPlayer.setInBreakMode(true);
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.CMD_BREAK_BREAK_MODE));
|
||||
MessageUtil.sendMessage(sender, DMessages.CMD_BREAK_BREAK_MODE.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -32,13 +31,12 @@ import org.bukkit.entity.Player;
|
||||
public class ChatCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public ChatCommand() {
|
||||
setCommand("chat");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(0);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_CHAT));
|
||||
setHelp(DMessages.HELP_CMD_CHAT.getMessage());
|
||||
setPermission(DPermissions.CHAT.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -49,17 +47,17 @@ public class ChatCommand extends BRCommand {
|
||||
DPlayer dPlayer = DPlayer.getByPlayer(player);
|
||||
|
||||
if (dPlayer == null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_JOIN_GROUP.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (dPlayer.isInDungeonChat()) {
|
||||
dPlayer.setInDungeonChat(false);
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_CHAT_NORMAL_CHAT));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_CHAT_NORMAL_CHAT.getMessage());
|
||||
|
||||
} else {
|
||||
dPlayer.setInDungeonChat(true);
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_CHAT_DUNGEON_CHAT));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_CHAT_DUNGEON_CHAT.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -32,13 +31,12 @@ import org.bukkit.entity.Player;
|
||||
public class ChatSpyCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public ChatSpyCommand() {
|
||||
setCommand("chatspy");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(0);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_CHATSPY));
|
||||
setHelp(DMessages.HELP_CMD_CHATSPY.getMessage());
|
||||
setPermission(DPermissions.CHAT_SPY.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -50,11 +48,11 @@ public class ChatSpyCommand extends BRCommand {
|
||||
|
||||
if (dGlobalPlayer.isInChatSpyMode()) {
|
||||
dGlobalPlayer.setInChatSpyMode(false);
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_CHATSPY_STOPPED));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_CHATSPY_STOPPED.getMessage());
|
||||
|
||||
} else {
|
||||
dGlobalPlayer.setInChatSpyMode(true);
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_CHATSPY_START));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_CHATSPY_START.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -34,13 +33,12 @@ import org.bukkit.entity.Player;
|
||||
public class CreateCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public CreateCommand() {
|
||||
setMinArgs(1);
|
||||
setMaxArgs(1);
|
||||
setCommand("create");
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_CREATE));
|
||||
setHelp(DMessages.HELP_CMD_CREATE.getMessage());
|
||||
setPermission(DPermissions.CREATE.getNode());
|
||||
setPlayerCommand(true);
|
||||
setConsoleCommand(true);
|
||||
@ -53,8 +51,8 @@ public class CreateCommand extends BRCommand {
|
||||
if (sender instanceof ConsoleCommandSender) {
|
||||
if (name.length() <= 15) {
|
||||
// Msg create
|
||||
MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_NEW_DUNGEON));
|
||||
MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_GENERATE_NEW_WORLD));
|
||||
MessageUtil.log(plugin, DMessages.LOG_NEW_DUNGEON.getMessage());
|
||||
MessageUtil.log(plugin, DMessages.LOG_GENERATE_NEW_WORLD.getMessage());
|
||||
|
||||
// Create World
|
||||
EditWorld editWorld = new EditWorld();
|
||||
@ -64,24 +62,24 @@ public class CreateCommand extends BRCommand {
|
||||
editWorld.delete();
|
||||
|
||||
// MSG Done
|
||||
MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_WORLD_GENERATION_FINISHED));
|
||||
MessageUtil.log(plugin, DMessages.LOG_WORLD_GENERATION_FINISHED.getMessage());
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NAME_TO_LONG));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NAME_TO_LONG.getMessage());
|
||||
}
|
||||
|
||||
} else if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
|
||||
if (DPlayer.getByPlayer(player) != null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (name.length() <= 15) {
|
||||
// Msg create
|
||||
MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_NEW_DUNGEON));
|
||||
MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_GENERATE_NEW_WORLD));
|
||||
MessageUtil.log(plugin, DMessages.LOG_NEW_DUNGEON.getMessage());
|
||||
MessageUtil.log(plugin, DMessages.LOG_GENERATE_NEW_WORLD.getMessage());
|
||||
|
||||
// Create World
|
||||
EditWorld editWorld = new EditWorld();
|
||||
@ -89,13 +87,13 @@ public class CreateCommand extends BRCommand {
|
||||
editWorld.setMapName(name);
|
||||
|
||||
// MSG Done
|
||||
MessageUtil.log(plugin, messageConfig.getMessage(DMessages.LOG_WORLD_GENERATION_FINISHED));
|
||||
MessageUtil.log(plugin, DMessages.LOG_WORLD_GENERATION_FINISHED.getMessage());
|
||||
|
||||
// Tp Player
|
||||
new DPlayer(player, editWorld.getWorld(), true);
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NAME_TO_LONG));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NAME_TO_LONG.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -34,7 +33,6 @@ import org.bukkit.entity.Player;
|
||||
public class DeletePortalCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public DeletePortalCommand() {
|
||||
setCommand("deleteportal");
|
||||
@ -52,10 +50,10 @@ public class DeletePortalCommand extends BRCommand {
|
||||
|
||||
if (dPortal != null) {
|
||||
dPortal.delete();
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PROTECTED_BLOCK_DELETED));
|
||||
MessageUtil.sendMessage(player, DMessages.PLAYER_PROTECTED_BLOCK_DELETED.getMessage());
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NO_PROTECTED_BLOCK));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NO_PROTECTED_BLOCK.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,9 @@
|
||||
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.player.DGlobalPlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.player.DPlayer;
|
||||
@ -35,13 +33,12 @@ import org.bukkit.entity.Player;
|
||||
public class EditCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public EditCommand() {
|
||||
setCommand("edit");
|
||||
setMinArgs(1);
|
||||
setMaxArgs(1);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_EDIT));
|
||||
setHelp(DMessages.HELP_CMD_EDIT.getMessage());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
|
||||
@ -55,22 +52,22 @@ public class EditCommand extends BRCommand {
|
||||
DPlayer dPlayer = DPlayer.getByPlayer(player);
|
||||
|
||||
if (!(EditWorld.isInvitedPlayer(mapName, player.getUniqueId(), player.getName()) || DPermissions.hasPermission(player, DPermissions.EDIT))) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NO_PERMISSIONS));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NO_PERMISSIONS.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (dPlayer != null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (dGroup != null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_GROUP));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_GROUP.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (editWorld == null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_DUNGEON_NOT_EXIST, mapName));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(mapName));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -17,12 +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.DMessages;
|
||||
import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.player.DPlayer;
|
||||
@ -35,13 +33,12 @@ import org.bukkit.entity.Player;
|
||||
public class EnterCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public EnterCommand() {
|
||||
setMinArgs(1);
|
||||
setMaxArgs(2);
|
||||
setCommand("enter");
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_ENTER));
|
||||
setHelp(DMessages.HELP_CMD_ENTER.getMessage());
|
||||
setPermission(DPermissions.ENTER.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -55,18 +52,18 @@ public class EnterCommand extends BRCommand {
|
||||
DGroup target = DGroup.getByName(targetName);
|
||||
|
||||
if (target == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_GROUP, targetName));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_GROUP.getMessage(targetName));
|
||||
return;
|
||||
}
|
||||
|
||||
Game game = Game.getByDGroup(target);
|
||||
if (game == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_IN_GAME, targetName));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_IN_GAME.getMessage(targetName));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Game.getByDGroup(joining) != null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_LEAVE_GAME));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_GAME.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -75,13 +72,13 @@ public class EnterCommand extends BRCommand {
|
||||
}
|
||||
|
||||
if (joining.getCaptain() != captain && !DPermissions.hasPermission(sender, DPermissions.BYPASS)) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_CAPTAIN));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_CAPTAIN.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
joining.setGameWorld(game.getWorld());
|
||||
game.addDGroup(joining);
|
||||
joining.sendMessage(messageConfig.getMessage(DMessages.CMD_ENTER_SUCCESS, joining.getName(), targetName));
|
||||
joining.sendMessage(DMessages.CMD_ENTER_SUCCESS.getMessage(joining.getName(), targetName));
|
||||
|
||||
for (Player player : joining.getPlayers()) {
|
||||
new DPlayer(player, game.getWorld()).ready();
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -34,13 +33,12 @@ import org.bukkit.entity.Player;
|
||||
public class EscapeCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public EscapeCommand() {
|
||||
setCommand("escape");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(0);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_ESCAPE));
|
||||
setHelp(DMessages.HELP_CMD_ESCAPE.getMessage());
|
||||
setPermission(DPermissions.ESCAPE.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -52,7 +50,7 @@ public class EscapeCommand extends BRCommand {
|
||||
if (dPlayer != null) {
|
||||
|
||||
if (!dPlayer.isEditing()) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -71,10 +69,10 @@ public class EscapeCommand extends BRCommand {
|
||||
DGroup dGroup = DGroup.getByPlayer(player);
|
||||
if (dGroup != null) {
|
||||
dGroup.removePlayer(player);
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_LEAVE_SUCCESS));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_LEAVE_SUCCESS.getMessage());
|
||||
return;
|
||||
}
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -34,13 +33,12 @@ import org.bukkit.entity.Player;
|
||||
public class GameCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public GameCommand() {
|
||||
setCommand("game");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(0);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_GAME));
|
||||
setHelp(DMessages.HELP_CMD_GAME.getMessage());
|
||||
setPermission(DPermissions.GAME.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -50,19 +48,19 @@ public class GameCommand extends BRCommand {
|
||||
Player player = (Player) sender;
|
||||
DGroup dGroup = DGroup.getByPlayer(player);
|
||||
if (dGroup == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
GameWorld gameWorld = dGroup.getGameWorld();
|
||||
if (gameWorld == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_GAME));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_GAME.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
Game game = gameWorld.getGame();
|
||||
if (game == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_GAME));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_GAME.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -17,14 +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.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;
|
||||
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.player.DPlayer;
|
||||
@ -37,13 +35,12 @@ import org.bukkit.entity.Player;
|
||||
public class GroupCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public GroupCommand() {
|
||||
setCommand("group");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(2);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_GROUP));
|
||||
setHelp(DMessages.HELP_CMD_GROUP.getMessage());
|
||||
setPermission(DPermissions.GROUP.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -120,11 +117,11 @@ public class GroupCommand extends BRCommand {
|
||||
dGroup = null;
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.GROUP_CREATED, sender.getName(), args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.GROUP_CREATED.getMessage(sender.getName(), args[2]));
|
||||
}
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_LEAVE_GROUP));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_GROUP.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,18 +131,18 @@ public class GroupCommand extends BRCommand {
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
dGroup.delete();
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.GROUP_DISBANDED, sender.getName(), dGroup.getName()));
|
||||
MessageUtil.sendMessage(sender, DMessages.GROUP_DISBANDED.getMessage(sender.getName(), dGroup.getName()));
|
||||
dGroup = null;
|
||||
}
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_GROUP));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_GROUP.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void invitePlayer(DGroup dGroup) {
|
||||
if (dGroup == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -155,13 +152,13 @@ public class GroupCommand extends BRCommand {
|
||||
dGroup.addInvitedPlayer(toInvite, false);
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_PLAYER, args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
|
||||
}
|
||||
}
|
||||
|
||||
public void uninvitePlayer(DGroup dGroup) {
|
||||
if (dGroup == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -174,27 +171,27 @@ public class GroupCommand extends BRCommand {
|
||||
dGroup.removeInvitedPlayer(toUninvite, false);
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_IN_GROUP, args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_IN_GROUP.getMessage(args[2]));
|
||||
}
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_PLAYER, args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
|
||||
}
|
||||
}
|
||||
|
||||
public void joinGroup(DGroup dGroup) {
|
||||
if (dGroup == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_GROUP, args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_GROUP.getMessage(args[2]));
|
||||
return;
|
||||
}
|
||||
|
||||
if (DGroup.getByPlayer(player) != null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_LEAVE_GROUP));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_GROUP.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dGroup.getInvitedPlayers().contains(player) && !DPermissions.hasPermission(player, DPermissions.BYPASS)) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_INVITED, args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_INVITED.getMessage(args[2]));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -204,7 +201,7 @@ public class GroupCommand extends BRCommand {
|
||||
|
||||
public void kickPlayer(DGroup dGroup) {
|
||||
if (dGroup == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
|
||||
}
|
||||
|
||||
Player toKick = plugin.getServer().getPlayer(args[2]);
|
||||
@ -214,25 +211,25 @@ public class GroupCommand extends BRCommand {
|
||||
if (!event.isCancelled()) {
|
||||
if (dGroup.getPlayers().contains(toKick)) {
|
||||
dGroup.removePlayer(toKick);
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.GROUP_KICKED_PLAYER, sender.getName(), args[2], dGroup.getName()));
|
||||
MessageUtil.sendMessage(sender, DMessages.GROUP_KICKED_PLAYER.getMessage(sender.getName(), args[2], dGroup.getName()));
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_IN_GROUP, args[2], dGroup.getName()));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_IN_GROUP.getMessage(args[2], dGroup.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_PLAYER, args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_PLAYER.getMessage(args[2]));
|
||||
}
|
||||
}
|
||||
|
||||
public void showGroup(DGroup dGroup) {
|
||||
if (dGroup == null) {
|
||||
if (args.length == 3) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_SUCH_GROUP, args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_GROUP.getMessage(args[2]));
|
||||
|
||||
} else if (args.length == 2) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
|
||||
}
|
||||
|
||||
return;
|
||||
@ -254,16 +251,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(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));
|
||||
MessageUtil.sendMessage(sender, "&bcreate" + "&7 - " + DMessages.HELP_CMD_GROUP_CREATE.getMessage());
|
||||
MessageUtil.sendMessage(sender, "&bdisband" + "&7 - " + DMessages.HELP_CMD_GROUP_DISBAND.getMessage());
|
||||
MessageUtil.sendMessage(sender, "&binvite" + "&7 - " + DMessages.HELP_CMD_GROUP_INVITE.getMessage());
|
||||
MessageUtil.sendMessage(sender, "&buninvite" + "&7 - " + DMessages.HELP_CMD_GROUP_UNINVITE.getMessage());
|
||||
MessageUtil.sendMessage(sender, "&bjoin" + "&7 - " + DMessages.HELP_CMD_GROUP_JOIN.getMessage());
|
||||
break;
|
||||
case "2":
|
||||
MessageUtil.sendCenteredMessage(sender, "&4&l[ &66-10 &4/ &67 &4| &62 &4&l]");
|
||||
MessageUtil.sendMessage(sender, "&bkick" + "&7 - " + messageConfig.getMessage(DMessages.HELP_CMD_GROUP_KICK));
|
||||
MessageUtil.sendMessage(sender, "&bshow" + "&7 - " + messageConfig.getMessage(DMessages.HELP_CMD_GROUP_SHOW));
|
||||
MessageUtil.sendMessage(sender, "&bkick" + "&7 - " + DMessages.HELP_CMD_GROUP_KICK.getMessage());
|
||||
MessageUtil.sendMessage(sender, "&bshow" + "&7 - " + DMessages.HELP_CMD_GROUP_SHOW.getMessage());
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -33,13 +32,12 @@ import org.bukkit.command.CommandSender;
|
||||
public class HelpCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public HelpCommand() {
|
||||
setCommand("help");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(1);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_HELP));
|
||||
setHelp(DMessages.HELP_CMD_HELP.getMessage());
|
||||
setPermission(DPermissions.HELP.getNode());
|
||||
setPlayerCommand(true);
|
||||
setConsoleCommand(true);
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -32,13 +31,12 @@ import org.bukkit.command.CommandSender;
|
||||
public class InviteCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public InviteCommand() {
|
||||
setMinArgs(2);
|
||||
setMaxArgs(2);
|
||||
setCommand("invite");
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_INVITE));
|
||||
setHelp(DMessages.HELP_CMD_INVITE.getMessage());
|
||||
setPermission(DPermissions.INVITE.getNode());
|
||||
setPlayerCommand(true);
|
||||
setConsoleCommand(true);
|
||||
@ -47,10 +45,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(DMessages.CMD_INVITE_SUCCESS, args[1], args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.CMD_INVITE_SUCCESS.getMessage(args[1], args[2]));
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_DUNGEON_NOT_EXIST, args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(args[2]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -36,13 +35,12 @@ import org.bukkit.entity.Player;
|
||||
public class LeaveCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public LeaveCommand() {
|
||||
setCommand("leave");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(0);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_LEAVE));
|
||||
setHelp(DMessages.HELP_CMD_LEAVE.getMessage());
|
||||
setPermission(DPermissions.LEAVE.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -54,7 +52,7 @@ public class LeaveCommand extends BRCommand {
|
||||
|
||||
if (GameWorld.getByWorld(player.getWorld()) != null) {
|
||||
if (GameWorld.getByWorld(player.getWorld()).isTutorial()) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NO_LEAVE_IN_TUTORIAL));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NO_LEAVE_IN_TUTORIAL.getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -70,17 +68,17 @@ public class LeaveCommand extends BRCommand {
|
||||
}
|
||||
|
||||
dPlayer.leave();
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_LEAVE_SUCCESS));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_LEAVE_SUCCESS.getMessage());
|
||||
|
||||
} else {
|
||||
DGroup dGroup = DGroup.getByPlayer(player);
|
||||
if (dGroup != null) {
|
||||
dGroup.removePlayer(player);
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_LEAVE_SUCCESS));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_LEAVE_SUCCESS.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -38,13 +37,12 @@ import org.bukkit.entity.Player;
|
||||
public class ListCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public ListCommand() {
|
||||
setCommand("list");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(3);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_LIST));
|
||||
setHelp(DMessages.HELP_CMD_LIST.getMessage());
|
||||
setPermission(DPermissions.LIST.getNode());
|
||||
setPlayerCommand(true);
|
||||
setConsoleCommand(true);
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -33,13 +32,12 @@ import org.bukkit.entity.Player;
|
||||
public class LivesCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public LivesCommand() {
|
||||
setCommand("lives");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(1);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_LIVES));
|
||||
setHelp(DMessages.HELP_CMD_LIVES.getMessage());
|
||||
setPermission(DPermissions.LIVES.getNode());
|
||||
setPlayerCommand(true);
|
||||
setConsoleCommand(true);
|
||||
@ -58,16 +56,16 @@ public class LivesCommand extends BRCommand {
|
||||
player = (Player) sender;
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NO_CONSOLE_COMMAND, getCommand()));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_CONSOLE_COMMAND.getMessage(getCommand()));
|
||||
return;
|
||||
}
|
||||
|
||||
DPlayer dPlayer = DPlayer.getByPlayer(player);
|
||||
if (dPlayer != null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_LIVES, player.getName(), String.valueOf(dPlayer.getLives())));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_LIVES.getMessage(player.getName(), String.valueOf(dPlayer.getLives())));
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ 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;
|
||||
@ -36,11 +35,10 @@ import org.bukkit.plugin.PluginManager;
|
||||
public class MainCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public MainCommand() {
|
||||
setCommand("main");
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_MAIN));
|
||||
setHelp(DMessages.HELP_CMD_MAIN.getMessage());
|
||||
setPermission(DPermissions.MAIN.getNode());
|
||||
setPlayerCommand(true);
|
||||
setConsoleCommand(true);
|
||||
@ -69,10 +67,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(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, "&b&l###### " + DMessages.CMD_MAIN_WELCOME.getMessage() + "&7 v" + plugin.getDescription().getVersion() + " &b&l######");
|
||||
MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_LOADED.getMessage(String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players)));
|
||||
MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_COMPATIBILITY.getMessage(String.valueOf(internals), vault, mythicMobs));
|
||||
MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_HELP.getMessage());
|
||||
MessageUtil.sendCenteredMessage(sender, "&7\u00a92012-2016 Frank Baumann & contributors; lcsd. under GPLv3.");
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -36,13 +35,12 @@ import org.bukkit.entity.Player;
|
||||
public class MsgCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public MsgCommand() {
|
||||
setMinArgs(-1);
|
||||
setMaxArgs(-1);
|
||||
setCommand("msg");
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_MSG));
|
||||
setHelp(DMessages.HELP_CMD_MSG.getMessage());
|
||||
setPermission(DPermissions.MESSAGE.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -53,7 +51,7 @@ public class MsgCommand extends BRCommand {
|
||||
EditWorld editWorld = EditWorld.getByWorld(player.getWorld());
|
||||
|
||||
if (editWorld == null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -74,7 +72,7 @@ public class MsgCommand extends BRCommand {
|
||||
MessageUtil.sendMessage(player, ChatColor.WHITE + msg);
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_MSG_ID_NOT_EXIST, "" + id));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_MSG_ID_NOT_EXIST.getMessage(String.valueOf(id)));
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -93,22 +91,22 @@ public class MsgCommand extends BRCommand {
|
||||
msg = splitMsg[1];
|
||||
String old = confreader.getMsg(id, false);
|
||||
if (old == null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_MSG_ADDED, "" + id));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_MSG_ADDED.getMessage(String.valueOf(id)));
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_MSG_UPDATED, "" + id));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_MSG_UPDATED.getMessage(String.valueOf(id)));
|
||||
}
|
||||
|
||||
confreader.setMsg(msg, id);
|
||||
confreader.save();
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_MSG_FORMAT));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_MSG_FORMAT.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_MSG_NO_INT));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_MSG_NO_INT.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -25,7 +24,6 @@ import io.github.dre2n.dungeonsxl.config.DungeonConfig;
|
||||
import io.github.dre2n.dungeonsxl.config.WorldConfig;
|
||||
import io.github.dre2n.dungeonsxl.dungeon.Dungeon;
|
||||
import io.github.dre2n.dungeonsxl.event.dgroup.DGroupCreateEvent;
|
||||
import io.github.dre2n.dungeonsxl.player.DGlobalPlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import io.github.dre2n.dungeonsxl.player.DPlayer;
|
||||
@ -41,13 +39,12 @@ import org.bukkit.entity.Player;
|
||||
public class PlayCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public PlayCommand() {
|
||||
setCommand("play");
|
||||
setMinArgs(1);
|
||||
setMaxArgs(2);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_PLAY));
|
||||
setHelp(DMessages.HELP_CMD_PLAY.getMessage());
|
||||
setPermission(DPermissions.PLAY.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -58,7 +55,7 @@ public class PlayCommand extends BRCommand {
|
||||
DPlayer dPlayer = DPlayer.getByPlayer(player);
|
||||
|
||||
if (dPlayer != null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -90,7 +87,7 @@ public class PlayCommand extends BRCommand {
|
||||
}
|
||||
|
||||
if (!multiFloor && !EditWorld.exists(identifier)) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_DUNGEON_NOT_EXIST, identifier));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(identifier));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -101,14 +98,14 @@ public class PlayCommand extends BRCommand {
|
||||
WorldConfig confReader = new WorldConfig(file);
|
||||
|
||||
if (confReader != null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_COOLDOWN, "" + confReader.getTimeToNextPlay()));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_COOLDOWN.getMessage(String.valueOf(confReader.getTimeToNextPlay())));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GameWorld.checkRequirements(mapName, player)) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_REQUIREMENTS));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_REQUIREMENTS.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -116,7 +113,7 @@ public class PlayCommand extends BRCommand {
|
||||
|
||||
if (dGroup != null) {
|
||||
if (!dGroup.getCaptain().equals(player) && !DPermissions.hasPermission(player, DPermissions.BYPASS)) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_CAPTAIN));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NOT_CAPTAIN.getMessage());
|
||||
}
|
||||
|
||||
if (dGroup.getMapName() == null) {
|
||||
@ -137,7 +134,7 @@ public class PlayCommand extends BRCommand {
|
||||
}
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_GROUP));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_GROUP.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -161,7 +158,7 @@ public class PlayCommand extends BRCommand {
|
||||
}
|
||||
|
||||
if (dGroup.getGameWorld() == null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_SAVED, DGroup.getByPlayer(player).getMapName()));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NOT_SAVED.getMessage(DGroup.getByPlayer(player).getMapName()));
|
||||
dGroup.delete();
|
||||
return;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -36,13 +35,12 @@ import org.bukkit.inventory.ItemStack;
|
||||
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(DMessages.HELP_CMD_PORTAL));
|
||||
setHelp(DMessages.HELP_CMD_PORTAL.getMessage());
|
||||
setPermission(DPermissions.PORTAL.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -53,7 +51,7 @@ public class PortalCommand extends BRCommand {
|
||||
DGlobalPlayer dGlobalPlayer = plugin.getDPlayers().getByPlayer(player);
|
||||
|
||||
if (dGlobalPlayer instanceof DPlayer) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -64,12 +62,12 @@ public class PortalCommand extends BRCommand {
|
||||
dGlobalPlayer.setCreatingPortal(dPortal);
|
||||
dPortal.setWorld(player.getWorld());
|
||||
player.getInventory().setItemInHand(new ItemStack(Material.WOOD_SWORD));
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PORTAL_INTRODUCTION));
|
||||
MessageUtil.sendMessage(player, DMessages.PLAYER_PORTAL_INTRODUCTION.getMessage());
|
||||
|
||||
} else {
|
||||
dPortal.delete();
|
||||
dGlobalPlayer.setCreatingPortal(null);
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PORTAL_ABORT));
|
||||
MessageUtil.sendMessage(player, DMessages.PLAYER_PORTAL_ABORT.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ 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.DMessages;
|
||||
@ -35,13 +34,12 @@ import org.bukkit.plugin.PluginManager;
|
||||
public class ReloadCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public ReloadCommand() {
|
||||
setCommand("reload");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(0);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_RELOAD));
|
||||
setHelp(DMessages.HELP_CMD_RELOAD.getMessage());
|
||||
setPermission(DPermissions.RELOAD.getNode());
|
||||
setPlayerCommand(true);
|
||||
setConsoleCommand(true);
|
||||
@ -86,9 +84,9 @@ public class ReloadCommand extends BRCommand {
|
||||
plugin.loadDungeons();
|
||||
|
||||
MessageUtil.sendPluginTag(sender, plugin);
|
||||
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));
|
||||
MessageUtil.sendCenteredMessage(sender, DMessages.CMD_RELOAD_DONE.getMessage());
|
||||
MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_LOADED.getMessage(String.valueOf(maps), String.valueOf(dungeons), String.valueOf(loaded), String.valueOf(players)));
|
||||
MessageUtil.sendCenteredMessage(sender, DMessages.CMD_MAIN_COMPATIBILITY.getMessage(String.valueOf(internals), vault, mythicMobs));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -32,13 +31,12 @@ import org.bukkit.entity.Player;
|
||||
public class SaveCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public SaveCommand() {
|
||||
setCommand("save");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(0);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_SAVE));
|
||||
setHelp(DMessages.HELP_CMD_SAVE.getMessage());
|
||||
setPermission(DPermissions.SAVE.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -49,10 +47,10 @@ public class SaveCommand extends BRCommand {
|
||||
EditWorld editWorld = EditWorld.getByWorld(player.getWorld());
|
||||
if (editWorld != null) {
|
||||
editWorld.save();
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.CMD_SAVE_SUCCESS));
|
||||
MessageUtil.sendMessage(player, DMessages.CMD_SAVE_SUCCESS.getMessage());
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -36,13 +35,12 @@ import org.bukkit.entity.Player;
|
||||
public class TestCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public TestCommand() {
|
||||
setCommand("test");
|
||||
setMinArgs(0);
|
||||
setMaxArgs(0);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_TEST));
|
||||
setHelp(DMessages.HELP_CMD_TEST.getMessage());
|
||||
setPermission(DPermissions.TEST.getNode());
|
||||
setPlayerCommand(true);
|
||||
}
|
||||
@ -53,24 +51,24 @@ public class TestCommand extends BRCommand {
|
||||
|
||||
DGroup dGroup = DGroup.getByPlayer(player);
|
||||
if (dGroup == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_JOIN_GROUP));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_JOIN_GROUP.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dGroup.getCaptain().equals(player)) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_CAPTAIN));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_CAPTAIN.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
GameWorld gameWorld = dGroup.getGameWorld();
|
||||
if (gameWorld == null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_NOT_IN_DUNGEON));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NOT_IN_DUNGEON.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
Game game = gameWorld.getGame();
|
||||
if (game != null) {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_LEAVE_DUNGEON));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_LEAVE_DUNGEON.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
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;
|
||||
@ -32,13 +31,12 @@ import org.bukkit.command.CommandSender;
|
||||
public class UninviteCommand extends BRCommand {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
public UninviteCommand() {
|
||||
setCommand("uninvite");
|
||||
setMinArgs(2);
|
||||
setMaxArgs(2);
|
||||
setHelp(messageConfig.getMessage(DMessages.HELP_CMD_UNINVITE));
|
||||
setHelp(DMessages.HELP_CMD_UNINVITE.getMessage());
|
||||
setPermission(DPermissions.UNINVITE.getNode());
|
||||
setPlayerCommand(true);
|
||||
setConsoleCommand(true);
|
||||
@ -47,10 +45,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(DMessages.CMD_UNINVITE_SUCCESS, args[1], args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.CMD_UNINVITE_SUCCESS.getMessage(args[1], args[2]));
|
||||
|
||||
} else {
|
||||
MessageUtil.sendMessage(sender, messageConfig.getMessage(DMessages.ERROR_DUNGEON_NOT_EXIST, args[2]));
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_DUNGEON_NOT_EXIST.getMessage(args[2]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
package io.github.dre2n.dungeonsxl.config;
|
||||
|
||||
import io.github.dre2n.commons.config.Messages;
|
||||
import io.github.dre2n.dungeonsxl.DungeonsXL;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@ -173,6 +174,11 @@ public enum DMessages implements Messages {
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage(String... args) {
|
||||
return DungeonsXL.getInstance().getMessageConfig().getMessage(this, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
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.DMessages;
|
||||
@ -78,7 +77,7 @@ import org.bukkit.inventory.meta.BookMeta;
|
||||
public class PlayerListener implements Listener {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
protected static DPlayers dPlayers = plugin.getDPlayers();
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
@ -114,7 +113,7 @@ public class PlayerListener implements Listener {
|
||||
dPlayer.setLives(dPlayer.getLives() - dPlayerDeathEvent.getLostLives());
|
||||
|
||||
if (dPlayer.getLives() != -1) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_DEATH, String.valueOf(dPlayer.getLives())));
|
||||
MessageUtil.sendMessage(player, DMessages.PLAYER_DEATH.getMessage(String.valueOf(dPlayer.getLives())));
|
||||
|
||||
if (dConfig != null) {
|
||||
if (dConfig.getKeepInventoryOnDeath()) {
|
||||
@ -132,7 +131,7 @@ public class PlayerListener implements Listener {
|
||||
DPlayerKickEvent dPlayerKickEvent = new DPlayerKickEvent(dPlayer, DPlayerKickEvent.Cause.DEATH);
|
||||
|
||||
if (!dPlayerKickEvent.isCancelled()) {
|
||||
MessageUtil.broadcastMessage(messageConfig.getMessage(DMessages.PLAYER_DEATH_KICK, player.getName()));
|
||||
MessageUtil.broadcastMessage(DMessages.PLAYER_DEATH_KICK.getMessage(player.getName()));
|
||||
dPlayer.leave();
|
||||
if (gameWorld.getConfig().getKeepInventoryOnEscape()) {
|
||||
dPlayer.applyRespawnInventory();
|
||||
@ -157,13 +156,13 @@ public class PlayerListener implements Listener {
|
||||
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
||||
if (clickedBlock.getType() == Material.ENDER_CHEST) {
|
||||
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_ENDERCHEST));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_ENDERCHEST.getMessage());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
} else if (clickedBlock.getType() == Material.BED_BLOCK) {
|
||||
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_BED));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_BED.getMessage());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@ -175,7 +174,7 @@ public class PlayerListener implements Listener {
|
||||
if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
|
||||
if (clickedBlock.getType() == Material.DISPENSER) {
|
||||
if (!DPermissions.hasPermission(player, DPermissions.BYPASS)) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_DISPENSER));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_DISPENSER.getMessage());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@ -196,13 +195,13 @@ public class PlayerListener implements Listener {
|
||||
if (dPortal == dGlobalPlayer.getPortal()) {
|
||||
if (dPortal.getBlock1() == null) {
|
||||
dPortal.setBlock1(event.getClickedBlock());
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PORTAL_PROGRESS));
|
||||
MessageUtil.sendMessage(player, DMessages.PLAYER_PORTAL_PROGRESS.getMessage());
|
||||
|
||||
} else if (dPortal.getBlock2() == null) {
|
||||
dPortal.setBlock2(event.getClickedBlock());
|
||||
dPortal.setActive(true);
|
||||
dPortal.create();
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.PLAYER_PORTAL_CREATED));
|
||||
MessageUtil.sendMessage(player, DMessages.PLAYER_PORTAL_CREATED.getMessage());
|
||||
}
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -288,7 +287,7 @@ public class PlayerListener implements Listener {
|
||||
if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
trigger.onTrigger(player);
|
||||
} else {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_LEFT_CLICK));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_LEFT_CLICK.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,7 +298,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(DMessages.ERROR_LEFT_CLICK));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_LEFT_CLICK.getMessage());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -344,7 +343,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(DMessages.ERROR_DROP));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_DROP.getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -466,11 +465,11 @@ public class PlayerListener implements Listener {
|
||||
dPlayer.leave();
|
||||
|
||||
} else if (timeUntilKickOfflinePlayer > 0) {
|
||||
dGroup.sendMessage(messageConfig.getMessage(DMessages.PLAYER_OFFLINE, dPlayer.getPlayer().getName(), "" + timeUntilKickOfflinePlayer), player);
|
||||
dGroup.sendMessage(DMessages.PLAYER_OFFLINE.getMessage(dPlayer.getPlayer().getName(), String.valueOf(timeUntilKickOfflinePlayer)), player);
|
||||
dPlayer.setOfflineTime(System.currentTimeMillis() + timeUntilKickOfflinePlayer * 1000);
|
||||
|
||||
} else {
|
||||
dGroup.sendMessage(messageConfig.getMessage(DMessages.PLAYER_OFFLINE_NEVER, dPlayer.getPlayer().getName()), player);
|
||||
dGroup.sendMessage(DMessages.PLAYER_OFFLINE_NEVER.getMessage(dPlayer.getPlayer().getName()), player);
|
||||
}
|
||||
|
||||
} else if (dPlayer.isEditing()) {
|
||||
@ -550,7 +549,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if (dGroup.getGameWorld() == null) {
|
||||
MessageUtil.sendMessage(player, messageConfig.getMessage(DMessages.ERROR_TUTORIAL_NOT_EXIST));
|
||||
MessageUtil.sendMessage(player, DMessages.ERROR_TUTORIAL_NOT_EXIST.getMessage());
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -602,7 +601,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
MessageUtil.sendMessage(event.getPlayer(), messageConfig.getMessage(DMessages.ERROR_CMD));
|
||||
MessageUtil.sendMessage(event.getPlayer(), DMessages.ERROR_CMD.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
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.DMessages;
|
||||
@ -49,7 +48,6 @@ import org.bukkit.scheduler.BukkitTask;
|
||||
public class DGroup {
|
||||
|
||||
protected static DungeonsXL plugin = DungeonsXL.getInstance();
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
private String name;
|
||||
private Player captain;
|
||||
|
@ -18,7 +18,6 @@ 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;
|
||||
@ -67,8 +66,6 @@ import org.bukkit.potion.PotionEffect;
|
||||
*/
|
||||
public class DPlayer extends DGlobalPlayer {
|
||||
|
||||
protected static MessageConfig messageConfig = plugin.getMessageConfig();
|
||||
|
||||
// Variables
|
||||
private World world;
|
||||
|
||||
@ -86,7 +83,7 @@ public class DPlayer extends DGlobalPlayer {
|
||||
private long offlineTime;
|
||||
private String[] linesCopy;
|
||||
|
||||
private Inventory treasureInv = plugin.getServer().createInventory(getPlayer(), 45, messageConfig.getMessage(DMessages.PLAYER_TREASURES));
|
||||
private Inventory treasureInv = plugin.getServer().createInventory(getPlayer(), 45, DMessages.PLAYER_TREASURES.getMessage());
|
||||
|
||||
private int initialLives = -1;
|
||||
private int lives;
|
||||
@ -580,7 +577,7 @@ public class DPlayer extends DGlobalPlayer {
|
||||
// Captain here!
|
||||
Player newCaptain = dGroup.getPlayers().get(0);
|
||||
dGroup.setCaptain(newCaptain);
|
||||
MessageUtil.sendMessage(newCaptain, messageConfig.getMessage(DMessages.PLAYER_NEW_CAPTAIN));
|
||||
MessageUtil.sendMessage(newCaptain, DMessages.PLAYER_NEW_CAPTAIN.getMessage());
|
||||
// ...*flies away*
|
||||
}
|
||||
}
|
||||
@ -649,7 +646,7 @@ public class DPlayer extends DGlobalPlayer {
|
||||
}
|
||||
|
||||
public void finishFloor(String specifiedFloor) {
|
||||
MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(DMessages.PLAYER_FINISHED_DUNGEON));
|
||||
MessageUtil.sendMessage(getPlayer(), DMessages.PLAYER_FINISHED_DUNGEON.getMessage());
|
||||
finished = true;
|
||||
|
||||
DGroup dGroup = DGroup.getByPlayer(getPlayer());
|
||||
@ -664,7 +661,7 @@ public class DPlayer extends DGlobalPlayer {
|
||||
for (Player player : dGroup.getPlayers()) {
|
||||
DPlayer dPlayer = getByPlayer(player);
|
||||
if (!dPlayer.finished) {
|
||||
MessageUtil.sendMessage(this.getPlayer(), messageConfig.getMessage(DMessages.PLAYER_WAIT_FOR_OTHER_PLAYERS));
|
||||
MessageUtil.sendMessage(this.getPlayer(), DMessages.PLAYER_WAIT_FOR_OTHER_PLAYERS.getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -729,7 +726,7 @@ public class DPlayer extends DGlobalPlayer {
|
||||
|
||||
public void finish(boolean message) {
|
||||
if (message) {
|
||||
MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(DMessages.PLAYER_FINISHED_DUNGEON));
|
||||
MessageUtil.sendMessage(getPlayer(), DMessages.PLAYER_FINISHED_DUNGEON.getMessage());
|
||||
}
|
||||
finished = true;
|
||||
|
||||
@ -749,7 +746,7 @@ public class DPlayer extends DGlobalPlayer {
|
||||
DPlayer dPlayer = getByPlayer(player);
|
||||
if (!dPlayer.finished) {
|
||||
if (message) {
|
||||
MessageUtil.sendMessage(this.getPlayer(), messageConfig.getMessage(DMessages.PLAYER_WAIT_FOR_OTHER_PLAYERS));
|
||||
MessageUtil.sendMessage(this.getPlayer(), DMessages.PLAYER_WAIT_FOR_OTHER_PLAYERS.getMessage());
|
||||
}
|
||||
hasToWait = true;
|
||||
|
||||
@ -830,14 +827,14 @@ public class DPlayer extends DGlobalPlayer {
|
||||
}
|
||||
} else {
|
||||
linesCopy = lines;
|
||||
MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(DMessages.PLAYER_SIGN_COPIED));
|
||||
MessageUtil.sendMessage(getPlayer(), DMessages.PLAYER_SIGN_COPIED.getMessage());
|
||||
}
|
||||
} else {
|
||||
String info = "" + block.getType();
|
||||
if (block.getData() != 0) {
|
||||
info = info + "," + block.getData();
|
||||
}
|
||||
MessageUtil.sendMessage(getPlayer(), messageConfig.getMessage(DMessages.PLAYER_BLOCK_INFO, info));
|
||||
MessageUtil.sendMessage(getPlayer(), DMessages.PLAYER_BLOCK_INFO.getMessage(info));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class TimeIsRunningTask extends BukkitRunnable {
|
||||
|
||||
} finally {
|
||||
for (Player player : dGroup.getPlayers()) {
|
||||
MessageUtil.sendActionBarMessage(player, messageConfig.getMessage(DMessages.PLAYER_TIME_LEFT, color, String.valueOf(timeLeft)));
|
||||
MessageUtil.sendActionBarMessage(player, DMessages.PLAYER_TIME_LEFT.getMessage(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(DMessages.PLAYER_TIME_KICK, player.getName()));
|
||||
MessageUtil.broadcastMessage(DMessages.PLAYER_TIME_KICK.getMessage(player.getName()));
|
||||
dPlayer.leave();
|
||||
if (dGroup.getGameWorld().getConfig().getKeepInventoryOnEscape()) {
|
||||
dPlayer.applyRespawnInventory();
|
||||
@ -80,4 +80,5 @@ public class TimeIsRunningTask extends BukkitRunnable {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user