mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Due to the unstable and volatile nature of pistons in the current versions of mc, we cannot reliably guarentee that we can track the position of blocks being moved by pistons, and therefore will no longer track piston moved blocks in the blockstore with 100% accuracy, and will instead just not refresh the potentially empty new blocks. This will not have any effect on regular usage of the plugin aside from 100% preventing any mcMMO related piston dupe bugs. Fixes #2565, #2582
This commit is contained in:
parent
4fe41fe416
commit
b4e21a7817
@ -75,12 +75,14 @@ public class BlockListener implements Listener {
|
||||
|
||||
for (Block b : blocks) {
|
||||
if (BlockUtils.shouldBeWatched(b.getState()) && mcMMO.getPlaceStore().isTrue(b)) {
|
||||
b.getRelative(direction).setMetadata(mcMMO.blockMetadataKey, mcMMO.metadataValue);
|
||||
Block nextBlock = b.getRelative(direction);
|
||||
mcMMO.getPlaceStore().setTrue(nextBlock);
|
||||
//b.getRelative(direction).setMetadata(mcMMO.blockMetadataKey, mcMMO.metadataValue);
|
||||
}
|
||||
}
|
||||
|
||||
// Needed because blocks sometimes don't move when two pistons push towards each other
|
||||
new PistonTrackerTask(blocks, direction, futureEmptyBlock).runTaskLater(plugin, 2);
|
||||
//new PistonTrackerTask(blocks, direction, futureEmptyBlock).runTaskLater(plugin, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,20 +105,23 @@ public class BlockListener implements Listener {
|
||||
// Get opposite direction so we get correct block
|
||||
BlockFace direction = event.getDirection().getOppositeFace();
|
||||
Block movedBlock = event.getBlock().getRelative(direction);
|
||||
mcMMO.getPlaceStore().setTrue(movedBlock);
|
||||
|
||||
// If we're pulling a slime block, it might have something attached to it!
|
||||
if (movedBlock.getRelative(direction).getState().getType() == Material.SLIME_BLOCK) {
|
||||
for (Block block : event.getBlocks()) {
|
||||
movedBlock = block.getRelative(direction);
|
||||
mcMMO.getPlaceStore().setTrue(movedBlock);
|
||||
// // Treat the slime blocks as if it is the sticky piston itself, because pulling
|
||||
// // a slime block with a sticky piston is effectively the same as moving a sticky piston.
|
||||
new StickyPistonTrackerTask(direction, event.getBlock(), block).runTaskLater(plugin, 2);
|
||||
// new StickyPistonTrackerTask(direction, event.getBlock(), block).runTaskLater(plugin, 2);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Needed only because under some circumstances Minecraft doesn't move the block
|
||||
new StickyPistonTrackerTask(direction, event.getBlock(), movedBlock).runTaskLater(plugin, 2);
|
||||
//new StickyPistonTrackerTask(direction, event.getBlock(), movedBlock).runTaskLater(plugin, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user