Skip to content

Commit 4a7552e

Browse files
Pieter12345wizjany
authored andcommitted
Prevent pushing pistons across region borders
Pistons are classified as not pushable regardless of their state, causing WorldGuard to not protect against them moving. This commit fixes that.
1 parent c6c0fc9 commit 4a7552e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/listener/EventAbstractionListener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ public void onBlockPistonExtend(BlockPistonExtendEvent event) {
357357
for (int i = 0; i < blocks.size(); i++) {
358358
Block existing = blocks.get(i);
359359
if (existing.getPistonMoveReaction() == PistonMoveReaction.MOVE
360-
|| existing.getPistonMoveReaction() == PistonMoveReaction.PUSH_ONLY) {
360+
|| existing.getPistonMoveReaction() == PistonMoveReaction.PUSH_ONLY
361+
|| existing.getType() == Material.PISTON || existing.getType() == Material.STICKY_PISTON) {
361362
blocks.set(i, existing.getRelative(dir));
362363
}
363364
}

0 commit comments

Comments
 (0)