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

View File

@ -148,7 +148,12 @@ public void onBlockPistonExtend(BlockPistonExtendEvent event) {
Location location = BlockUtil.getInstance().getBlockRelative(event.getBlock().getLocation(), event.getDirection()); Location location = BlockUtil.getInstance().getBlockRelative(event.getBlock().getLocation(), event.getDirection());
targetClaim = this.storage.getClaimAt(location, targetClaim); targetClaim = this.storage.getClaimAt(location, targetClaim);
if (targetClaim.isWilderness()) { 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)) { if (handleBlockBreak(event, location, targetClaim, event.getBlock(), location.getBlock(), user, false)) {