diff options
author | mbax <matt@phozop.net> | 2012-12-18 00:20:23 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-18 19:02:20 -0600 |
commit | 924a46469d08f25766f1de954d6afcb37e585e76 (patch) | |
tree | a70a17a8cf8caef7c89598f32bcd981e7ec17f01 | |
parent | d9708d032e5f0b147c8b4cc6e0971e388743ca63 (diff) | |
download | craftbukkit-924a46469d08f25766f1de954d6afcb37e585e76.tar craftbukkit-924a46469d08f25766f1de954d6afcb37e585e76.tar.gz craftbukkit-924a46469d08f25766f1de954d6afcb37e585e76.tar.lz craftbukkit-924a46469d08f25766f1de954d6afcb37e585e76.tar.xz craftbukkit-924a46469d08f25766f1de954d6afcb37e585e76.zip |
[Bleeding] Check visibility API for sounds. Fixes BUKKIT-3114
With 1.4, entity sound tracking changed for the better.
Our previous method additions can now be removed.
All that's left is checking if the source can be seen
by the recipient of the sound packet. Thanks, Mojang!
-rw-r--r-- | src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java | 14 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/WorldManager.java | 6 |
2 files changed, 2 insertions, 18 deletions
diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java b/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java index 367cada1..b3d8c2c5 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManagerAbstract.java @@ -700,25 +700,15 @@ public abstract class ServerConfigurationManagerAbstract { } public void sendPacketNearby(double d0, double d1, double d2, double d3, int i, Packet packet) { - this.sendPacketNearby(d0, d1, d2, d3, i, packet, null); // CraftBukkit + this.sendPacketNearby((EntityHuman) null, d0, d1, d2, d3, i, packet); } - // CraftBukkit start - Add support for entity who caused the packet public void sendPacketNearby(EntityHuman entityhuman, double d0, double d1, double d2, double d3, int i, Packet packet) { - this.sendPacketNearby(entityhuman, d0, d1, d2, d3, i, packet, null); - } - - public void sendPacketNearby(double d0, double d1, double d2, double d3, int i, Packet packet, Entity sourceentity) { - this.sendPacketNearby(null, d0, d1, d2, d3, i, packet, sourceentity); - } - // CraftBukkit end - - public void sendPacketNearby(EntityHuman entityhuman, double d0, double d1, double d2, double d3, int i, Packet packet, Entity sourceentity) { // CraftBukkit - added sourceentity for (int j = 0; j < this.players.size(); ++j) { EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); // CraftBukkit start - Test if player receiving packet can see the source of the packet - if (sourceentity != null && sourceentity instanceof EntityPlayer && !entityplayer.getBukkitEntity().canSee(((EntityPlayer)sourceentity).getBukkitEntity())) { + if (entityhuman != null && entityhuman instanceof EntityPlayer && !entityplayer.getBukkitEntity().canSee(((EntityPlayer) entityhuman).getBukkitEntity())) { continue; } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/WorldManager.java b/src/main/java/net/minecraft/server/WorldManager.java index 252da3fc..34104a1e 100644 --- a/src/main/java/net/minecraft/server/WorldManager.java +++ b/src/main/java/net/minecraft/server/WorldManager.java @@ -22,12 +22,6 @@ public class WorldManager implements IWorldAccess { this.world.getTracker().untrackEntity(entity); } - // CraftBukkit start - Add source entity for a sound. - public void a(String s, double d0, double d1, double d2, float f, float f1, Entity sourceentity) { - this.server.getServerConfigurationManager().sendPacketNearby(d0, d1, d2, f > 1.0F ? (double) (16.0F * f) : 16.0D, this.world.dimension, new Packet62NamedSoundEffect(s, d0, d1, d2, f, f1), sourceentity); - } - // CraftBukkit end - public void a(String s, double d0, double d1, double d2, float f, float f1) { // CraftBukkit - this.world.dimension this.server.getServerConfigurationManager().sendPacketNearby(d0, d1, d2, f > 1.0F ? (double) (16.0F * f) : 16.0D, this.world.dimension, new Packet62NamedSoundEffect(s, d0, d1, d2, f, f1)); |