Fixing a new duping bug. And this time it was NOT our fault!

This commit is contained in:
Glitchfinder 2013-01-20 18:06:30 -08:00
parent 77ffc9c3c2
commit c1e82b566e
2 changed files with 10 additions and 7 deletions

View File

@ -87,7 +87,7 @@ public class BlockListener implements Listener {
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
if (event.isSticky()) {
//Needed only because under some circumstances Minecraft doesn't move the block
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new StickyPistonTracker(event), 0);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new StickyPistonTracker(event), 2);
}
}

View File

@ -15,13 +15,16 @@ public class StickyPistonTracker implements Runnable {
@Override
public void run() {
Block originalBlock = event.getRetractLocation().getBlock();
Block newBlock = event.getBlock().getRelative(event.getDirection());
Block originalBlock = newBlock.getRelative(event.getDirection());
if (originalBlock.getType() == Material.AIR && mcMMO.placeStore.isTrue(originalBlock)) {
Block newBlock = originalBlock.getRelative(event.getDirection().getOppositeFace());
if (originalBlock.getType() != Material.AIR)
return;
mcMMO.placeStore.setFalse(originalBlock);
mcMMO.placeStore.setTrue(newBlock);
}
if (!mcMMO.placeStore.isTrue(originalBlock))
return;
mcMMO.placeStore.setFalse(originalBlock);
mcMMO.placeStore.setTrue(newBlock);
}
}