3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-23 23:00:08 +01:00

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.
Dieser Commit ist enthalten in:
t00thpick1 2013-12-13 19:32:17 -05:00 committet von Nate Mortensen
Ursprung bdbd1808f7
Commit 1460f250cf

Datei anzeigen

@ -127,8 +127,15 @@ public abstract class EntityLiving extends Entity {
block = this.world.getType(i, j - 1, k);
}
} else if (!this.world.isStatic && 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);
}