summaryrefslogtreecommitdiffstats
path: root/nms-patches/BlockRedstoneLamp.patch
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-11-26 08:32:16 +1100
committermd_5 <git@md-5.net>2014-11-28 17:16:30 +1100
commit24557bc2b37deb6a0edf497d547471832457b1dd (patch)
treec560572889a3b0b34964a0cddb35dc87fda3c914 /nms-patches/BlockRedstoneLamp.patch
parenta4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff)
downloadcraftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'nms-patches/BlockRedstoneLamp.patch')
-rw-r--r--nms-patches/BlockRedstoneLamp.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/nms-patches/BlockRedstoneLamp.patch b/nms-patches/BlockRedstoneLamp.patch
new file mode 100644
index 00000000..66c81280
--- /dev/null
+++ b/nms-patches/BlockRedstoneLamp.patch
@@ -0,0 +1,47 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/BlockRedstoneLamp.java 2014-11-27 08:59:46.565422446 +1100
++++ src/main/java/net/minecraft/server/BlockRedstoneLamp.java 2014-11-27 08:42:10.140850934 +1100
+@@ -2,6 +2,8 @@
+
+ import java.util.Random;
+
++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
++
+ public class BlockRedstoneLamp extends Block {
+
+ private final boolean a;
+@@ -20,6 +22,11 @@
+ if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
+ world.setTypeAndData(blockposition, Blocks.REDSTONE_LAMP.getBlockData(), 2);
+ } else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
++ // CraftBukkit start
++ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) {
++ return;
++ }
++ // CraftBukkit end
+ world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
+ }
+
+@@ -31,6 +38,11 @@
+ if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
+ world.a(blockposition, (Block) this, 4);
+ } else if (!this.a && world.isBlockIndirectlyPowered(blockposition)) {
++ // CraftBukkit start
++ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 0, 15).getNewCurrent() != 15) {
++ return;
++ }
++ // CraftBukkit end
+ world.setTypeAndData(blockposition, Blocks.LIT_REDSTONE_LAMP.getBlockData(), 2);
+ }
+
+@@ -40,6 +52,11 @@
+ public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
+ if (!world.isStatic) {
+ if (this.a && !world.isBlockIndirectlyPowered(blockposition)) {
++ // CraftBukkit start
++ if (CraftEventFactory.callRedstoneChange(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), 15, 0).getNewCurrent() != 0) {
++ return;
++ }
++ // CraftBukkit end
+ world.setTypeAndData(blockposition, Blocks.REDSTONE_LAMP.getBlockData(), 2);
+ }
+