blob: 6f1ce3e11a1b8df1e67f2f20cf89e547061e8f91 [file] [log] [blame] [raw]
package net.glowstone.scheduler;
import net.glowstone.block.GlowBlock;
import net.glowstone.block.ItemTable;
import net.glowstone.block.blocktype.BlockType;
import org.bukkit.Material;
public class PulseTask implements Runnable {
private final GlowBlock block;
private final Material originalMaterial;
public PulseTask(GlowBlock block) {
this.block = block;
this.originalMaterial = block.getType();
}
@Override
public void run() {
if (block.getType() != originalMaterial) {
return;
}
ItemTable table = ItemTable.instance();
BlockType type = table.getBlock(block.getType());
if (type != null) {
type.receivePulse(block);
}
}
}