bukkit: Fix sticky pistons pulling blocks at edge.

Fixes #106
This commit is contained in:
bloodshot 2020-02-10 09:26:59 -05:00
parent 73d1e514f4
commit a6e51f7c85
1 changed files with 6 additions and 1 deletions

View File

@ -148,7 +148,12 @@ public class BlockEventHandler implements Listener {
Location location = BlockUtil.getInstance().getBlockRelative(event.getBlock().getLocation(), event.getDirection());
targetClaim = this.storage.getClaimAt(location, targetClaim);
if (targetClaim.isWilderness()) {
return;
// Sticky pistons will attach to next block so we need to check it
location = BlockUtil.getInstance().getBlockRelative(location, event.getDirection());
targetClaim = this.storage.getClaimAt(location, targetClaim);
if (targetClaim.isWilderness()) {
return;
}
}
if (handleBlockBreak(event, location, targetClaim, event.getBlock(), location.getBlock(), user, false)) {