Fire events for tripwire and hooks.

This commit is contained in:
Travis Watkins
2012-08-05 22:52:25 -05:00
parent 982efb8c24
commit e1a4273957
2 changed files with 51 additions and 0 deletions

View File

@@ -2,6 +2,8 @@ package net.minecraft.server;
import java.util.Random;
import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
public class BlockTripwireHook extends Block {
public BlockTripwireHook(int i) {
@@ -153,6 +155,17 @@ public class BlockTripwireHook extends Block {
this.a(world, l2, j, k3, flag3, flag4, flag1, flag2);
}
// CraftBukkit start
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, 1, 0);
world.getServer().getPluginManager().callEvent(eventRedstone);
if (eventRedstone.getNewCurrent() > 0) {
return;
}
// CraftBukkit end
this.a(world, i, j, k, flag3, flag4, flag1, flag2);
if (l > 0) {
world.setData(i, j, k, i1);