mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
2f782a6652
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes:17543ecf
SPIGOT-5035: Error Using Virtual Merchant GUI0fc6922b
SPIGOT-5028: Villager#setVillagerExperience() doesn't workbdbdbe44
SPIGOT-5024: Fox error - Unknown target reason
47 lines
3.1 KiB
Diff
47 lines
3.1 KiB
Diff
From e70e23f1b4097a6bfcae1475bc5d88baa7f53f52 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
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 015918e3b3..6ac0546029 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
|
@@ -563,8 +563,11 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster {
|
|
if (this.bL == 1) {
|
|
// CraftBukkit start - Use relative location for far away sounds
|
|
// this.world.b(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 (EntityPlayer player : ((WorldServer)world).getPlayers()) {
|
|
+ final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
|
+ // 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 de6c70e3e7..e3feb39ad0 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWither.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWither.java
|
|
@@ -207,8 +207,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity {
|
|
|
|
// CraftBukkit start - Use relative location for far away sounds
|
|
// this.world.b(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 (EntityPlayer player : ((WorldServer)world).getPlayers()) {
|
|
+ final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
|
|
+ // Paper end
|
|
double deltaX = this.locX - player.locX;
|
|
double deltaZ = this.locZ - player.locZ;
|
|
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
|
|
--
|
|
2.21.0
|
|
|