diff options
author | feildmaster <admin@feildmaster.com> | 2012-04-02 09:01:48 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-04-02 14:11:02 -0500 |
commit | a963880bd8f3a690b91dbe4e314191ac31e22e69 (patch) | |
tree | e9a12a1acf3ad4867fac3ace5d1218603fa11dfa /src/main/java/net/minecraft/server | |
parent | ed8cf5196e520ecf559db3512cec4269f18dae94 (diff) | |
download | craftbukkit-a963880bd8f3a690b91dbe4e314191ac31e22e69.tar craftbukkit-a963880bd8f3a690b91dbe4e314191ac31e22e69.tar.gz craftbukkit-a963880bd8f3a690b91dbe4e314191ac31e22e69.tar.lz craftbukkit-a963880bd8f3a690b91dbe4e314191ac31e22e69.tar.xz craftbukkit-a963880bd8f3a690b91dbe4e314191ac31e22e69.zip |
Add BlockRedstoneEvent to Redstone Lamps, Addresses BUKKIT-1431
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockRedstoneLamp.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java index 8ca090f3..6fde3076 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java @@ -2,6 +2,11 @@ package net.minecraft.server; import java.util.Random; +// CraftBukkit start +import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.event.block.BlockRedstoneEvent; +// CraftBukkit end + public class BlockRedstoneLamp extends Block { private final boolean a; @@ -20,6 +25,11 @@ public class BlockRedstoneLamp extends Block { if (this.a && !world.isBlockIndirectlyPowered(i, j, k)) { world.c(i, j, k, this.id, 4); } else if (!this.a && world.isBlockIndirectlyPowered(i, j, k)) { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(world, i, j, k, 0, 15).getNewCurrent() != 15) { + return; + } + // CraftBukkit end world.setTypeId(i, j, k, Block.REDSTONE_LAMP_ON.id); } } @@ -30,6 +40,11 @@ public class BlockRedstoneLamp extends Block { if (this.a && !world.isBlockIndirectlyPowered(i, j, k)) { world.c(i, j, k, this.id, 4); } else if (!this.a && world.isBlockIndirectlyPowered(i, j, k)) { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(world, i, j, k, 0, 15).getNewCurrent() != 15) { + return; + } + // CraftBukkit end world.setTypeId(i, j, k, Block.REDSTONE_LAMP_ON.id); } } @@ -37,6 +52,11 @@ public class BlockRedstoneLamp extends Block { public void a(World world, int i, int j, int k, Random random) { if (!world.isStatic && this.a && !world.isBlockIndirectlyPowered(i, j, k)) { + // CraftBukkit start + if (CraftEventFactory.callRedstoneChange(world, i, j, k, 15, 0).getNewCurrent() != 0) { + return; + } + // CraftBukkit end world.setTypeId(i, j, k, Block.REDSTONE_LAMP_OFF.id); } } |