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.
This commit is contained in:
Pieter12345 2019-12-25 04:22:29 +01:00 committed by wizjany
parent c6c0fc9d74
commit 4a7552e6be

View File

@ -357,7 +357,8 @@ public void onBlockPistonExtend(BlockPistonExtendEvent event) {
for (int i = 0; i < blocks.size(); i++) {
Block existing = blocks.get(i);
if (existing.getPistonMoveReaction() == PistonMoveReaction.MOVE
|| existing.getPistonMoveReaction() == PistonMoveReaction.PUSH_ONLY) {
|| existing.getPistonMoveReaction() == PistonMoveReaction.PUSH_ONLY
|| existing.getType() == Material.PISTON || existing.getType() == Material.STICKY_PISTON) {
blocks.set(i, existing.getRelative(dir));
}
}