Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)
Paste
Pasted as Bash by registered user mel_instagibson ( 9 years ago )
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onSelection(PlayerInteractEvent event) {
if (event.getPlayer() == null)
return;
// disabling event on world
if (plugin.isDisabledWorldListener(event.getPlayer().getWorld()))
return;
if (event.getAction() != Action.LEFT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
Player player = event.getPlayer();
@SuppressWarnings("deprecation")
int heldItemId = player.getItemInHand().getTypeId();
if (heldItemId != plugin.getConfigManager().getSelectionTooldID())
return;
if (plugin.getWepid() == plugin.getConfigManager().getSelectionTooldID())
return;
if (player.getGameMode() == GameMode.CREATIVE)
event.setCancelled(true);
boolean resadmin = plugin.isResAdminOn(player);
ResidencePlayer rPlayer = plugin.getPlayerManager().getResidencePlayer(player);
PermissionGroup group = rPlayer.getGroup();
if (player.hasPermission("residence.select") || player.hasPermission("residence.create") && !player.isPermissionSet("residence.select") || group
.canCreateResidences() && !player.isPermissionSet("residence.create") && !player.isPermissionSet("residence.select") || resadmin) {
Block block = event.getClickedBlock();
if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
Location loc = block.getLocation();
plugin.getSelectionManager().placeLoc1(player, loc, true);
plugin.msg(player, lm.Select_PrimaryPoint, plugin.msg(lm.General_CoordsTop, loc.getBlockX(), loc.getBlockY(),
loc.getBlockZ()));
event.setCancelled(true);
} else if (event.getAction() == Action.RIGHT_CLICK_BLOCK && plugin.getNms().isMainHand(event)) {
Location loc = block.getLocation();
plugin.getSelectionManager().placeLoc2(player, loc, true);
plugin.msg(player, lm.Select_SecondaryPoint, plugin.msg(lm.General_CoordsBottom, loc.getBlockX(), loc
.getBlockY(), loc.getBlockZ()));
event.setCancelled(true);
}
if (plugin.getSelectionManager().hasPlacedBoth(player.getName()))
plugin.getSelectionManager().showSelectionInfoInActionBar(player);
}
return;
}
Revise this Paste
Parent: 85617
Children: 85619