SPIGOT-458: Events / game rules shouldn't affect fall damage onto soil.

This commit is contained in:
md_5 2015-01-31 10:14:29 +11:00
parent bae259e302
commit 5c49acdcc9

View File

@ -1,5 +1,5 @@
--- ../work/decompile-8eb82bde//net/minecraft/server/BlockSoil.java 2014-11-28 17:43:42.965707438 +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 2014-11-28 17:38:20.000000000 +0000 +++ src/main/java/net/minecraft/server/BlockSoil.java 2015-01-31 10:14:10.936280376 +1100
@@ -3,6 +3,11 @@ @@ -3,6 +3,11 @@
import java.util.Iterator; import java.util.Iterator;
import java.util.Random; import java.util.Random;
@ -25,7 +25,14 @@
world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData()); world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
} }
} else if (i < 7) { } 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; return;
} }
@ -50,3 +57,8 @@
world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData()); world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
} }
- super.a(world, blockposition, entity, f);
+ // super.a(world, blockposition, entity, f); // CraftBukkit - moved up
}
}