2012-07-02 23:54:05 +02:00
|
|
|
package com.gmail.nossr50.runnables;
|
|
|
|
|
|
|
|
import org.bukkit.Material;
|
|
|
|
import org.bukkit.block.Block;
|
|
|
|
import org.bukkit.event.block.BlockPistonRetractEvent;
|
|
|
|
|
|
|
|
import com.gmail.nossr50.mcMMO;
|
|
|
|
|
|
|
|
public class StickyPistonTracker implements Runnable {
|
|
|
|
BlockPistonRetractEvent event;
|
|
|
|
|
|
|
|
public StickyPistonTracker(BlockPistonRetractEvent event) {
|
|
|
|
this.event = event;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
Block originalBlock = event.getRetractLocation().getBlock();
|
|
|
|
|
2012-12-24 22:17:19 +01:00
|
|
|
if (originalBlock.getType() == Material.AIR && mcMMO.placeStore.isTrue(originalBlock)) {
|
2012-07-02 23:54:05 +02:00
|
|
|
Block newBlock = originalBlock.getRelative(event.getDirection().getOppositeFace());
|
|
|
|
|
2012-12-24 22:17:19 +01:00
|
|
|
mcMMO.placeStore.setFalse(originalBlock);
|
|
|
|
mcMMO.placeStore.setTrue(newBlock);
|
2012-07-02 23:54:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|