summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-01-31 10:14:29 +1100
committermd_5 <git@md-5.net>2015-01-31 10:14:29 +1100
commit5c49acdcc99e7199c030df034d1a71b648283515 (patch)
treeb05d7d23f4363e5f9270a019c9f668d8ee34897b
parentbae259e302efd06b359237fc4310909f5c056665 (diff)
downloadcraftbukkit-5c49acdcc99e7199c030df034d1a71b648283515.tar
craftbukkit-5c49acdcc99e7199c030df034d1a71b648283515.tar.gz
craftbukkit-5c49acdcc99e7199c030df034d1a71b648283515.tar.lz
craftbukkit-5c49acdcc99e7199c030df034d1a71b648283515.tar.xz
craftbukkit-5c49acdcc99e7199c030df034d1a71b648283515.zip
SPIGOT-458: Events / game rules shouldn't affect fall damage onto soil.
-rw-r--r--nms-patches/BlockSoil.patch18
1 files changed, 15 insertions, 3 deletions
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
+ }
+ }
+