From 6df46412cfcb5fbf8ef5359694ce72190074790c Mon Sep 17 00:00:00 2001 From: PureGero Date: Fri, 4 Feb 2022 18:30:13 +1000 Subject: [PATCH] Use destination world when preloading spawn chunk (#7441) --- ...63-Fix-items-vanishing-through-end-portal.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/patches/server/0363-Fix-items-vanishing-through-end-portal.patch b/patches/server/0363-Fix-items-vanishing-through-end-portal.patch index a4ea190dc..0cdf5dd22 100644 --- a/patches/server/0363-Fix-items-vanishing-through-end-portal.patch +++ b/patches/server/0363-Fix-items-vanishing-through-end-portal.patch @@ -13,16 +13,16 @@ Quickly loading the exact world spawn chunk before searching the heightmap resolves the issue without having to load all spawn chunks. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 62f19eafbb650dfbfac31c320e4883149d327e43..a9705e54b88339e2746348aee9ab1acdae5182b2 100644 +index 62f19eafbb650dfbfac31c320e4883149d327e43..ae0ae298ff7ae129959ff6e4024eb7060c0786e4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3026,6 +3026,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i - BlockPos blockposition1; - +@@ -3028,6 +3028,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i if (flag1) { -+ // Paper start - Ensure spawn chunk is always loaded before calculating Y coordinate -+ this.level.getChunkAt(((ServerLevel) this.level).getSharedSpawnPos()); -+ // Paper end blockposition1 = ServerLevel.END_SPAWN_POINT; } else { ++ // Paper start - Ensure spawn chunk is always loaded before calculating Y coordinate ++ destination.getChunkAt(destination.getSharedSpawnPos()); ++ // Paper end blockposition1 = destination.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, destination.getSharedSpawnPos()); + } + // CraftBukkit start