From d580602ebb4fac5f0552702cdb0382cfc8b37c4c Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 2 Nov 2024 17:40:23 +1100 Subject: [PATCH] SPIGOT-7937: Cannot spawn minecart during world generation with minecart_improvements enabled By: md_5 --- .../org/bukkit/craftbukkit/entity/CraftEntityTypes.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java index 1105204f77..5d35cfb774 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java @@ -491,7 +491,13 @@ public final class CraftEntityTypes { } private static Function createMinecart(EntityTypes entityTypes) { - return spawnData -> EntityMinecartAbstract.createMinecart(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), entityTypes, EntitySpawnReason.TRIGGERED, ItemStack.EMPTY, null); + return spawnData -> { + if (spawnData.normalWorld()) { + return EntityMinecartAbstract.createMinecart(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), entityTypes, EntitySpawnReason.TRIGGERED, ItemStack.EMPTY, null); + } else { + return combine(fromEntityType(entityTypes), (spawnData2, entity) -> entity.setInitialPos(spawnData.x(), spawnData.y(), spawnData.z())).apply(spawnData); + } + }; } private static Function createAndMove(EntityTypes entityTypes) {