From e4ef12f7b7dd740bca8730962073fce2d43dccd4 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Wed, 14 Sep 2016 01:45:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=89=E5=8C=BA=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E9=99=90=E5=88=B6=E4=B8=96=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- .../Residence/commandsub/CommandSelect.java | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/main/java/pw/yumc/Residence/commandsub/CommandSelect.java b/src/main/java/pw/yumc/Residence/commandsub/CommandSelect.java index 49f9921..7f6e4d3 100644 --- a/src/main/java/pw/yumc/Residence/commandsub/CommandSelect.java +++ b/src/main/java/pw/yumc/Residence/commandsub/CommandSelect.java @@ -36,11 +36,14 @@ public class CommandSelect extends BaseCommand { public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException { final Player player = (Player) sender; final boolean resadmin = (command != null); + if (plugin.getDeny().getStringList("world").contains(player.getWorld().getName()) && !resadmin && !player.isOp()) { + player.sendMessage("§c当前世界不允许圈地!"); + return; + } final ResidenceManager rmanager = plugin.getResidenceManager(); final Language language = plugin.getLanguage(); final PermissionGroup group = plugin.getPermissionManager().getGroup(player); final SelectionManager smanager = plugin.getSelectionManager(); - if (!group.selectCommandAccess() && !resadmin) { player.sendMessage(ChatColor.RED + language.getPhrase("SelectDiabled")); return; @@ -86,13 +89,31 @@ public class CommandSelect extends BaseCommand { case "coords": final Location playerLoc1 = smanager.getPlayerLoc1(player.getName()); if (playerLoc1 != null) { - player.sendMessage(ChatColor.GREEN + language.getPhrase("Primary.Selection") + ":" + ChatColor.AQUA + " (" + playerLoc1.getBlockX() + ", " + playerLoc1.getBlockY() + ", " - + playerLoc1.getBlockZ() + ")"); + player.sendMessage(ChatColor.GREEN + + language.getPhrase("Primary.Selection") + + ":" + + ChatColor.AQUA + + " (" + + playerLoc1.getBlockX() + + ", " + + playerLoc1.getBlockY() + + ", " + + playerLoc1.getBlockZ() + + ")"); } final Location playerLoc2 = smanager.getPlayerLoc2(player.getName()); if (playerLoc2 != null) { - player.sendMessage(ChatColor.GREEN + language.getPhrase("Secondary.Selection") + ":" + ChatColor.AQUA + " (" + playerLoc2.getBlockX() + ", " + playerLoc2.getBlockY() + ", " - + playerLoc2.getBlockZ() + ")"); + player.sendMessage(ChatColor.GREEN + + language.getPhrase("Secondary.Selection") + + ":" + + ChatColor.AQUA + + " (" + + playerLoc2.getBlockX() + + ", " + + playerLoc2.getBlockY() + + ", " + + playerLoc2.getBlockZ() + + ")"); } return; case "chunk":