mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 08:39:49 +01:00
Merge pull request #544 from Glitchfinder/master
Fixing a new duping bug. And this time it was NOT our fault!
This commit is contained in:
commit
16bc359f99
@ -87,7 +87,7 @@ public class BlockListener implements Listener {
|
|||||||
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
|
public void onBlockPistonRetract(BlockPistonRetractEvent event) {
|
||||||
if (event.isSticky()) {
|
if (event.isSticky()) {
|
||||||
//Needed only because under some circumstances Minecraft doesn't move the block
|
//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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,13 +15,16 @@ public class StickyPistonTracker implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
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)) {
|
if (originalBlock.getType() != Material.AIR)
|
||||||
Block newBlock = originalBlock.getRelative(event.getDirection().getOppositeFace());
|
return;
|
||||||
|
|
||||||
mcMMO.placeStore.setFalse(originalBlock);
|
if (!mcMMO.placeStore.isTrue(originalBlock))
|
||||||
mcMMO.placeStore.setTrue(newBlock);
|
return;
|
||||||
}
|
|
||||||
|
mcMMO.placeStore.setFalse(originalBlock);
|
||||||
|
mcMMO.placeStore.setTrue(newBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user