From fa83b1b80c0955c083150931a47a7c6d5998319e Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 12 Jun 2016 10:13:51 +1000 Subject: [PATCH] SPIGOT-2388: Damage must be nulled out in some circumstances --- nms-patches/BlockCactus.patch | 4 +++- nms-patches/BlockMagma.patch | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nms-patches/BlockCactus.patch b/nms-patches/BlockCactus.patch index 7c9fc0e4b4..951d5a9bbd 100644 --- a/nms-patches/BlockCactus.patch +++ b/nms-patches/BlockCactus.patch @@ -21,11 +21,13 @@ world.setTypeAndData(blockposition, iblockdata1, 4); iblockdata1.doPhysics(world, blockposition1, this); } else { -@@ -87,6 +90,7 @@ +@@ -87,7 +90,9 @@ } public void a(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) { + CraftEventFactory.blockDamage = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); // CraftBukkit entity.damageEntity(DamageSource.CACTUS, 1.0F); ++ CraftEventFactory.blockDamage = null; // CraftBukkit } + public IBlockData fromLegacyData(int i) { diff --git a/nms-patches/BlockMagma.patch b/nms-patches/BlockMagma.patch index 701c36cfb9..6c73106bf4 100644 --- a/nms-patches/BlockMagma.patch +++ b/nms-patches/BlockMagma.patch @@ -1,10 +1,12 @@ --- a/net/minecraft/server/BlockMagma.java +++ b/net/minecraft/server/BlockMagma.java -@@ -17,6 +17,7 @@ +@@ -17,7 +17,9 @@ public void stepOn(World world, BlockPosition blockposition, Entity entity) { if (!entity.isFireProof() && entity instanceof EntityLiving && !EnchantmentManager.j((EntityLiving) entity)) { + org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); // CraftBukkit entity.damageEntity(DamageSource.HOT_FLOOR, 1.0F); ++ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit } + super.stepOn(world, blockposition, entity);