aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches/0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch')
-rw-r--r--Spigot-Server-Patches/0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/Spigot-Server-Patches/0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch
new file mode 100644
index 0000000000..b832224954
--- /dev/null
+++ b/Spigot-Server-Patches/0140-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch
@@ -0,0 +1,48 @@
+From 552bbf4ff08db7dc30722e581a6bb019e8ef12cc Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Tue, 31 May 2016 22:53:50 -0400
+Subject: [PATCH] Only send Dragon/Wither Death sounds to same world
+
+Also fix view distance lookup
+
+diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
+index e24be3ccd..e93819fc1 100644
+--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
++++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
+@@ -573,8 +573,12 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo
+ if (this.bG == 1) {
+ // CraftBukkit start - Use relative location for far away sounds
+ // this.world.a(1028, new BlockPosition(this), 0);
+- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;
+- for (EntityPlayer player : (List<EntityPlayer>) MinecraftServer.getServer().getPlayerList().players) {
++ // Paper start
++ //int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
++ for (EntityHuman human : world.players) {
++ EntityPlayer player = (EntityPlayer) human;
++ int viewDistance = player.getViewDistance();
++ // Paper end
+ double deltaX = this.locX - player.locX;
+ double deltaZ = this.locZ - player.locZ;
+ double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
+diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java
+index 9af34ba60..031507574 100644
+--- a/src/main/java/net/minecraft/server/EntityWither.java
++++ b/src/main/java/net/minecraft/server/EntityWither.java
+@@ -211,8 +211,12 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
+
+ // CraftBukkit start - Use relative location for far away sounds
+ // this.world.a(1023, new BlockPosition(this), 0);
+- int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16;
+- for (EntityPlayer player : (List<EntityPlayer>) MinecraftServer.getServer().getPlayerList().players) {
++ // Paper start
++ //int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
++ for (EntityHuman human : world.players) {
++ EntityPlayer player = (EntityPlayer) human;
++ int viewDistance = player.getViewDistance();
++ // Paper end
+ double deltaX = this.locX - player.locX;
+ double deltaZ = this.locZ - player.locZ;
+ double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
+--
+2.12.2
+