protected void handleDirectWireInput(WorldVector pt, Block sourceBlock, int oldLevel, int newLevel) {
Block block = sourceBlock.getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ());
if(BukkitUtil.equals(sourceBlock.getLocation(), block.getLocation())) //The same block, don't run.
return;
final SourcedBlockRedstoneEvent event = new SourcedBlockRedstoneEvent(sourceBlock, block, oldLevel, newLevel);
CraftBookPlugin.inst().getServer().getPluginManager().callEvent(event);
CraftBookPlugin.server().getScheduler().runTask(CraftBookPlugin.inst(), new Runnable() {
@Override
public void run () {
try {
CartMechanismBlocks cmb = CartMechanismBlocks.find(event.getBlock());
CartBlockRedstoneEvent ev = new CartBlockRedstoneEvent(event.getBlock(), event.getSource(), event.getOldCurrent(), event.getNewCurrent(), cmb, CartBlockMechanism.getCart(cmb.rail));
CraftBookPlugin.inst().getServer().getPluginManager().callEvent(ev);
} catch (InvalidMechanismException ignored) {
}
}
});