Change interact rules

This commit is contained in:
sekwah 2018-02-22 02:56:51 +00:00 committed by Sekwah
parent f8638a2ff6
commit b55952942a

View File

@ -82,18 +82,20 @@ public class CoreListeners {
}
/**
*
* @param player
* @param player
* @param blockLoc
* @param leftClick true = left click, false = right click
* @return if player is allowed to interact with block
*/
public void playerInteractWithBlock(PlayerContainer player, String materialName, String itemName,
PortalLocation blockLoc, boolean leftClick) {
public boolean playerInteractWithBlock(PlayerContainer player, String materialName, String itemName,
PortalLocation blockLoc, boolean leftClick) {
if((player.isOp() || player.hasPermission("advancedportals.createportal")) &&
materialName.equalsIgnoreCase(this.portalsCore.getConfig().getSelectorMaterial())
&& (!this.portalsCore.getConfig().getUseOnlySpecialAxe() || itemName.equals("\u00A7ePortal Region Selector"))) {
AdvancedPortalsCore.getPortalManager().playerSelectorActivate(player, blockLoc, leftClick);
return false;
}
return true;
}
}