From f4680c40516eb6de398e20142b0ade600e951fa9 Mon Sep 17 00:00:00 2001 From: zhenghanlee <75558451+zhenghanlee@users.noreply.github.com> Date: Fri, 18 Jun 2021 05:11:46 +0800 Subject: [PATCH] Change method signature of allowBreak method in main class (#1406) --- .../me/ryanhamshire/GriefPrevention/GriefPrevention.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java index c5187d0..83b7b07 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -3440,7 +3440,11 @@ public class GriefPrevention extends JavaPlugin 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; @@ -3475,7 +3479,7 @@ public class GriefPrevention extends JavaPlugin 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);