diff options
Diffstat (limited to 'patches/server/0838-Check-player-world-in-endPortalSoundRadius.patch')
-rw-r--r-- | patches/server/0838-Check-player-world-in-endPortalSoundRadius.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0838-Check-player-world-in-endPortalSoundRadius.patch b/patches/server/0838-Check-player-world-in-endPortalSoundRadius.patch new file mode 100644 index 0000000000..a632d3d594 --- /dev/null +++ b/patches/server/0838-Check-player-world-in-endPortalSoundRadius.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: lexikiq <[email protected]> +Date: Sat, 17 Jul 2021 20:37:02 -0400 +Subject: [PATCH] Check player world in endPortalSoundRadius + +Fixes Spigot's endPortalSoundRadius not checking player worlds + +diff --git a/src/main/java/net/minecraft/world/item/EnderEyeItem.java b/src/main/java/net/minecraft/world/item/EnderEyeItem.java +index beb3713937470d7c5d8cadce3f3a823ca48d3726..d9c20eca27382e89ddb13f1c8e84348242ca6ceb 100644 +--- a/src/main/java/net/minecraft/world/item/EnderEyeItem.java ++++ b/src/main/java/net/minecraft/world/item/EnderEyeItem.java +@@ -66,7 +66,7 @@ public class EnderEyeItem extends Item { + double deltaX = soundPos.getX() - player.getX(); + double deltaZ = soundPos.getZ() - player.getZ(); + double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; +- if (world.spigotConfig.endPortalSoundRadius > 0 && distanceSquared > world.spigotConfig.endPortalSoundRadius * world.spigotConfig.endPortalSoundRadius) continue; // Spigot ++ if (world.spigotConfig.endPortalSoundRadius > 0 && (distanceSquared > world.spigotConfig.endPortalSoundRadius * world.spigotConfig.endPortalSoundRadius || player.getLevel() != world)) continue; // Spigot // Paper - ensure recipient is in same world as portal + if (distanceSquared > viewDistance * viewDistance) { + double deltaLength = Math.sqrt(distanceSquared); + double relativeX = player.getX() + (deltaX / deltaLength) * viewDistance; |