diff --git a/paper-server/nms-patches/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.patch b/paper-server/nms-patches/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.patch index a62c0d3712..125efd65f2 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.patch @@ -27,7 +27,7 @@ BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable(); for (int i = -2; i <= 2; ++i) { -@@ -29,16 +42,27 @@ +@@ -29,16 +42,33 @@ BlockPosition.MutableBlockPosition blockposition_mutableblockposition1 = blockposition_mutableblockposition.set(blockposition).move(j, k, i); Block block = k == -1 ? Blocks.OBSIDIAN : Blocks.AIR; @@ -47,8 +47,14 @@ } } + // CraftBukkit start ++ if (entity == null) { ++ // SPIGOT-7746: Entity will only be null during world generation, which is async, so just generate without event ++ blockList.updateList(); ++ return; ++ } ++ + org.bukkit.World bworld = worldaccess.getLevel().getWorld(); -+ PortalCreateEvent portalEvent = new PortalCreateEvent((List) (List) blockList.getList(), bworld, (entity == null) ? null : entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM); ++ PortalCreateEvent portalEvent = new PortalCreateEvent((List) (List) blockList.getList(), bworld, entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM); + + worldaccess.getLevel().getCraftServer().getPluginManager().callEvent(portalEvent); + if (!portalEvent.isCancelled()) {