diff options
author | t00thpick1 <t00thpick1dirko@gmail.com> | 2013-12-13 19:32:17 -0500 |
---|---|---|
committer | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2013-12-13 20:05:19 -0700 |
commit | 1460f250cf98881f4b376f48ac3da03b2c786949 (patch) | |
tree | 1f026b8f47cd1dc31e39d2de0cc980a17b5adef4 /src | |
parent | bdbd1808f73d97da39426465860efea7fc08c9e4 (diff) | |
download | craftbukkit-1460f250cf98881f4b376f48ac3da03b2c786949.tar craftbukkit-1460f250cf98881f4b376f48ac3da03b2c786949.tar.gz craftbukkit-1460f250cf98881f4b376f48ac3da03b2c786949.tar.lz craftbukkit-1460f250cf98881f4b376f48ac3da03b2c786949.tar.xz craftbukkit-1460f250cf98881f4b376f48ac3da03b2c786949.zip |
Alter fall particles to respect visibility API. Fixes BUKKIT-5158
Bukkits Visibility API should prevent players from seeing fall particles
of players that they cannot see. This commit alters the handling to
provide an EntityPlayer argument that is later used to determine if they
are visible.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityLiving.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index 75b1ec10..7211da83 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -127,7 +127,14 @@ public abstract class EntityLiving extends Entity { block = this.world.getType(i, j - 1, k); } } else if (!this.world.isStatic && this.fallDistance > 3.0F) { - this.world.triggerEffect(2006, i, j, k, MathHelper.f(this.fallDistance - 3.0F)); + // CraftBukkit start - supply player as argument in particles for visibility API to work + if (this instanceof EntityPlayer) { + this.world.a((EntityHuman) this, 2006, i, j, k, MathHelper.f(this.fallDistance - 3.0F)); + ((EntityPlayer) this).playerConnection.sendPacket(new PacketPlayOutWorldEvent(2006, i, j, k, MathHelper.f(this.fallDistance - 3.0F), false)); + } else { + this.world.triggerEffect(2006, i, j, k, MathHelper.f(this.fallDistance - 3.0F)); + } + // CraftBukkit end } block.a(this.world, i, j, k, this, this.fallDistance); |