testserver/patches/server/0101-Only-send-Dragon-Withe...

34 lines
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 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/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index dd1d606543da93e6068b8fa4239d369a4b648523..e6a6b0a298e69ce975eac413723f068aaef72ec0 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -654,7 +654,7 @@ public class EnderDragon extends Mob implements Enemy {
// CraftBukkit start - Use relative location for far away sounds
// this.world.b(1028, this.getChunkCoordinates(), 0);
int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16;
- for (net.minecraft.server.level.ServerPlayer player : this.level.getServer().getPlayerList().players) {
+ for (net.minecraft.server.level.ServerPlayer player : (List<net.minecraft.server.level.ServerPlayer>) ((ServerLevel)level).players()) {
double deltaX = this.getX() - player.getX();
double deltaZ = this.getZ() - player.getZ();
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
index 78bffaddbc9e478fb53639396e9c4970e9961b21..1fc862a3b5d40a45cf91703051bcfb06ec1b177a 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -272,7 +272,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
// CraftBukkit start - Use relative location for far away sounds
// this.world.globalLevelEvent(1023, new BlockPosition(this), 0);
int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16;
- for (ServerPlayer player : (List<ServerPlayer>) MinecraftServer.getServer().getPlayerList().players) {
+ for (ServerPlayer player : (List<ServerPlayer>)this.level.players()) { // Paper
double deltaX = this.getX() - player.getX();
double deltaZ = this.getZ() - player.getZ();
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;