-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Only OP can two point selection region.
private void select(Player player, Block block, PlayerInteractEvent event) {
if (Residence.getInstance().getCompatabilityManager().isUsingExternalSelectionTool()) {
return;
}
if (!Utilities.isAdminMode(player) && !player.hasPermission("residence.select")) {
return;
}
if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
Location loc = block.getLocation();
Residence.getInstance().getSelectionManager().placeLoc1(player, loc);
player.sendMessage(LocaleLoader.getString("Commands.Select.PrimaryPoint", loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
} else if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
Location loc = block.getLocation();
Residence.getInstance().getSelectionManager().placeLoc2(player, loc);
player.sendMessage(LocaleLoader.getString("Commands.Select.SecondaryPoint", loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
}
event.setCancelled(true);
}
Only need to change this line of code can be fine.
if (!Utilities.isAdminMode(player) && !player.hasPermission("residence.command.select")) {
return;
}
If my English is very poor, I am sorry, above content from Google translation.