Skip to content

Only OP can select #35

@jiongjionger

Description

@jiongjionger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions