mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Prevent blocks destroyed by pistons from moving on Geyser-Spigot (#2627)
This commit is contained in:
parent
09e3793fb2
commit
adbadbbba4
3 changed files with 29 additions and 26 deletions
|
@ -110,8 +110,12 @@ public class GeyserPistonListener implements Listener {
|
|||
List<Block> blocks = isExtend ? ((BlockPistonExtendEvent) event).getBlocks() : ((BlockPistonRetractEvent) event).getBlocks();
|
||||
for (Block block : blocks) {
|
||||
Location attachedLocation = block.getLocation();
|
||||
attachedBlocks.put(getVector(attachedLocation), worldManager.getBlockNetworkId(player, block,
|
||||
attachedLocation.getBlockX(), attachedLocation.getBlockY(), attachedLocation.getBlockZ()));
|
||||
int blockId = worldManager.getBlockNetworkId(player, block,
|
||||
attachedLocation.getBlockX(), attachedLocation.getBlockY(), attachedLocation.getBlockZ());
|
||||
// Ignore blocks that will be destroyed
|
||||
if (BlockStateValues.canPistonMoveBlock(blockId, isExtend)) {
|
||||
attachedBlocks.put(getVector(attachedLocation), blockId);
|
||||
}
|
||||
}
|
||||
blocksFilled = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue