diff options
-rw-r--r-- | nms-patches/EntityLiving.patch | 2 | ||||
-rw-r--r-- | nms-patches/WorldServer.patch | 14 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 13 |
3 files changed, 22 insertions, 7 deletions
diff --git a/nms-patches/EntityLiving.patch b/nms-patches/EntityLiving.patch index 54d1e474..60392131 100644 --- a/nms-patches/EntityLiving.patch +++ b/nms-patches/EntityLiving.patch @@ -64,7 +64,7 @@ - ((WorldServer) this.world).a(new ParticleParamBlock(Particles.d, iblockdata), this.locX, this.locY, this.locZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D); + // CraftBukkit start - visiblity api + if (this instanceof EntityPlayer) { -+ ((WorldServer) this.world).sendParticles((EntityPlayer) this, new ParticleParamBlock(Particles.d, iblockdata), this.locX, this.locY, this.locZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D); ++ ((WorldServer) this.world).sendParticles((EntityPlayer) this, new ParticleParamBlock(Particles.d, iblockdata), this.locX, this.locY, this.locZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, false); + } else { + ((WorldServer) this.world).a(new ParticleParamBlock(Particles.d, iblockdata), this.locX, this.locY, this.locZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D); + } diff --git a/nms-patches/WorldServer.patch b/nms-patches/WorldServer.patch index 7411f7ae..79fa8696 100644 --- a/nms-patches/WorldServer.patch +++ b/nms-patches/WorldServer.patch @@ -555,22 +555,26 @@ } -@@ -909,11 +1157,18 @@ +@@ -909,13 +1157,20 @@ } public <T extends ParticleParam> int a(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) { +- PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, false, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i); + // CraftBukkit - visibility api support -+ return sendParticles(null, t0, d0, d1, d2, i, d3, d4, d5, d6); ++ return sendParticles(null, t0, d0, d1, d2, i, d3, d4, d5, d6, false); + } + -+ public <T extends ParticleParam> int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) { ++ public <T extends ParticleParam> int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { ++ PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, force, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i); + // CraftBukkit end - PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, false, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i); int j = 0; for (int k = 0; k < this.players.size(); ++k) { EntityPlayer entityplayer = (EntityPlayer) this.players.get(k); + if (sender != null && !entityplayer.getBukkitEntity().canSee(sender.getBukkitEntity())) continue; // CraftBukkit - if (this.a(entityplayer, false, d0, d1, d2, packetplayoutworldparticles)) { +- if (this.a(entityplayer, false, d0, d1, d2, packetplayoutworldparticles)) { ++ if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit ++j; + } + } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 303481a0..90451598 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1566,6 +1566,16 @@ public class CraftWorld implements World { @Override public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { + spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, false); + } + + @Override + public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data, force); + } + + @Override + public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { if (data != null && !particle.getDataType().isInstance(data)) { throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass()); } @@ -1575,7 +1585,8 @@ public class CraftWorld implements World { x, y, z, // Position count, // Count offsetX, offsetY, offsetZ, // Random offset - extra // Speed? + extra, // Speed? + force ); } |