From 5c49acdcc99e7199c030df034d1a71b648283515 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 31 Jan 2015 10:14:29 +1100 Subject: SPIGOT-458: Events / game rules shouldn't affect fall damage onto soil. --- nms-patches/BlockSoil.patch | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'nms-patches') diff --git a/nms-patches/BlockSoil.patch b/nms-patches/BlockSoil.patch index 3d1c4ae6..2de016b1 100644 --- a/nms-patches/BlockSoil.patch +++ b/nms-patches/BlockSoil.patch @@ -1,5 +1,5 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/BlockSoil.java 2014-11-28 17:43:42.965707438 +0000 -+++ src/main/java/net/minecraft/server/BlockSoil.java 2014-11-28 17:38:20.000000000 +0000 +--- ../work/decompile-8eb82bde/net/minecraft/server/BlockSoil.java 2015-01-31 10:14:10.936280376 +1100 ++++ src/main/java/net/minecraft/server/BlockSoil.java 2015-01-31 10:14:10.936280376 +1100 @@ -3,6 +3,11 @@ import java.util.Iterator; import java.util.Random; @@ -25,7 +25,14 @@ world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData()); } } else if (i < 7) { -@@ -49,6 +60,24 @@ +@@ -43,16 +54,35 @@ + } + + public void a(World world, BlockPosition blockposition, Entity entity, float f) { ++ super.a(world, blockposition, entity, f); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage. + if (entity instanceof EntityLiving) { + if (!world.isStatic && world.random.nextFloat() < f - 0.5F) { + if (!(entity instanceof EntityHuman) && !world.getGameRules().getBoolean("mobGriefing")) { return; } @@ -50,3 +57,8 @@ world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData()); } +- super.a(world, blockposition, entity, f); ++ // super.a(world, blockposition, entity, f); // CraftBukkit - moved up + } + } + -- cgit v1.2.3