Skip to content

Commit

Permalink
Change method signature of allowBreak method in main class (#1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
solarrabbit99 committed Jun 17, 2021
1 parent 6e62779 commit f4680c4
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -3440,7 +3440,11 @@ public String allowBreak(Player player, Block block, Location location)
return this.allowBreak(player, block, location, null);
}

public String allowBreak(Player player, Block block, Location location, BlockBreakEvent breakEvent)
public String allowBreak(Player player, Block block, Location location, BlockBreakEvent breakEvent) {
return this.allowBreak(player, block.getType(), location, breakEvent);
}

public String allowBreak(Player player, Material material, Location location, BlockBreakEvent breakEvent)
{
if (!GriefPrevention.instance.claimsEnabledForWorld(location.getWorld())) return null;

Expand Down Expand Up @@ -3475,7 +3479,7 @@ public String allowBreak(Player player, Block block, Location location, BlockBre
playerData.lastClaim = claim;

//if not in the wilderness, then apply claim rules (permissions, etc)
String cancel = claim.allowBreak(player, block.getType());
String cancel = claim.allowBreak(player, material);
if (cancel != null && breakEvent != null)
{
PreventBlockBreakEvent preventionEvent = new PreventBlockBreakEvent(breakEvent);
Expand Down

0 comments on commit f4680c4

Please sign in to comment.