SPIGOT-654: Use the server player list instead of the world for boss spawn/death sounds

This commit is contained in:
Thinkofdeath 2015-03-07 15:02:53 +00:00
parent 4e47c1c393
commit 1e56438ac0
2 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/EntityEnderDragon.java 2015-02-26 22:40:22.515608140 +0000
+++ src/main/java/net/minecraft/server/EntityEnderDragon.java 2015-02-26 22:40:22.515608140 +0000
--- /home/matt/mc-dev-private//net/minecraft/server/EntityEnderDragon.java 2015-03-07 15:02:37.630567220 +0000
+++ src/main/java/net/minecraft/server/EntityEnderDragon.java 2015-03-07 15:02:37.630567220 +0000
@@ -5,6 +5,17 @@
import java.util.Iterator;
import java.util.List;
@ -165,7 +165,7 @@
+ // CraftBukkit start - Use relative location for far away sounds
+ // this.world.a(1018, new BlockPosition(this), 0);
+ int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;
+ for (EntityPlayer player : (List<EntityPlayer>) (List) this.world.players) {
+ for (EntityPlayer player : (List<EntityPlayer>) MinecraftServer.getServer().getPlayerList().players) {
+ double deltaX = this.locX - player.locX;
+ double deltaZ = this.locZ - player.locZ;
+ double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;

View File

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/EntityWither.java 2015-02-26 22:40:22.727608138 +0000
+++ src/main/java/net/minecraft/server/EntityWither.java 2015-02-26 22:40:22.727608138 +0000
--- /home/matt/mc-dev-private//net/minecraft/server/EntityWither.java 2015-03-07 15:02:37.910567217 +0000
+++ src/main/java/net/minecraft/server/EntityWither.java 2015-03-07 15:02:37.910567217 +0000
@@ -5,6 +5,12 @@
import java.util.Iterator;
import java.util.List;
@ -32,7 +32,7 @@
+ // CraftBukkit start - Use relative location for far away sounds
+ // this.world.a(1013, new BlockPosition(this), 0);
+ int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;
+ for (EntityPlayer player : (List<EntityPlayer>) (List) this.world.players) {
+ for (EntityPlayer player : (List<EntityPlayer>) MinecraftServer.getServer().getPlayerList().players) {
+ double deltaX = this.locX - player.locX;
+ double deltaZ = this.locZ - player.locZ;
+ double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;