mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
We need to use event.getBlock() here
Fix my boo boo from previous commit
This commit is contained in:
parent
ebdf11300b
commit
9a359bf42c
@ -97,7 +97,7 @@ public class BlockListener implements Listener {
|
||||
Block movedBlock = event.getRetractLocation().getBlock();
|
||||
|
||||
// Needed only because under some circumstances Minecraft doesn't move the block
|
||||
new StickyPistonTrackerTask(event.getDirection(), movedBlock).runTaskLater(plugin, 2);
|
||||
new StickyPistonTrackerTask(event.getDirection(), event.getBlock(), movedBlock).runTaskLater(plugin, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -10,10 +10,12 @@ import com.gmail.nossr50.util.BlockUtils;
|
||||
|
||||
public class StickyPistonTrackerTask extends BukkitRunnable {
|
||||
private BlockFace direction;
|
||||
private Block block;
|
||||
private Block movedBlock;
|
||||
|
||||
public StickyPistonTrackerTask(BlockFace direction, Block movedBlock) {
|
||||
public StickyPistonTrackerTask(BlockFace direction, Block block, Block movedBlock) {
|
||||
this.direction = direction;
|
||||
this.block = block;
|
||||
this.movedBlock = movedBlock;
|
||||
}
|
||||
|
||||
@ -24,6 +26,6 @@ public class StickyPistonTrackerTask extends BukkitRunnable {
|
||||
}
|
||||
|
||||
mcMMO.getPlaceStore().setFalse(movedBlock);
|
||||
mcMMO.getPlaceStore().setTrue(movedBlock.getRelative(direction));
|
||||
mcMMO.getPlaceStore().setTrue(block.getRelative(direction));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user