1
0
mirror of https://e.coding.net/circlecloud/Residence.git synced 2024-10-31 22:38:48 +00:00

fix: 选区命令限制世界

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-09-14 01:45:22 +08:00
parent 303f5c6dee
commit e4ef12f7b7

View File

@ -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":