Compare commits

...

3 Commits

Author SHA1 Message Date
Traks a5b97507bb
Merge a9f68eb351 into c57d784df7 2024-04-23 02:10:53 +00:00
renovate[bot] c57d784df7 Update dependency xyz.jpenilla.run-paper to v2.2.4 2024-04-23 02:10:41 +00:00
Traks a9f68eb351 Prevent headless pistons deleting walls 2022-07-01 01:15:15 +02:00
2 changed files with 15 additions and 1 deletions

View File

@ -989,6 +989,13 @@ public class BlockEventListener implements Listener {
return;
}
}
if (block.getType() == Material.MOVING_PISTON
&& event.getBlocks().isEmpty()
&& location.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ()).isPlotArea()) {
// Headless sticky pistons can delete the block in front of them
// when retracting. Prevent this.
event.setCancelled(true);
}
return;
}
Plot plot = area.getOwnedPlot(location);
@ -1012,6 +1019,13 @@ public class BlockEventListener implements Listener {
return;
}
}
if (block.getType() == Material.MOVING_PISTON
&& event.getBlocks().isEmpty()
&& !plot.equals(area.getOwnedPlot(location.add(relative.getBlockX(), relative.getBlockY(), relative.getBlockZ())))) {
// Headless sticky pistons can delete the block in front of them
// when retracting. Prevent this.
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)

View File

@ -37,7 +37,7 @@ shadow = "8.1.1"
grgit = "4.1.1"
spotless = "6.25.0"
nexus = "2.0.0"
runPaper = "2.2.3"
runPaper = "2.2.4"
[libraries]
# Platform expectations