We can do this without needing a runnable.

This commit is contained in:
GJ
2014-03-03 11:40:36 -05:00
parent 30f7521a3a
commit 9c925d3327
2 changed files with 12 additions and 35 deletions

View File

@ -1,31 +0,0 @@
package com.gmail.nossr50.runnables;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.mcMMO;
public class StickyPistonTrackerTask extends BukkitRunnable {
private BlockFace direction;
private Block block;
public StickyPistonTrackerTask(BlockFace direction, Block block) {
this.direction = direction;
this.block = block;
}
@Override
public void run() {
Block newBlock = block.getRelative(direction);
Block originalBlock = newBlock.getRelative(direction);
if (originalBlock.getType() != Material.AIR || !mcMMO.getPlaceStore().isTrue(originalBlock)) {
return;
}
mcMMO.getPlaceStore().setFalse(originalBlock);
mcMMO.getPlaceStore().setTrue(newBlock);
}
}