mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
SPIGOT-7937: Cannot spawn minecart during world generation with minecart_improvements enabled
By: md_5 <git@md-5.net>
This commit is contained in:
parent
c162fedc16
commit
d580602ebb
1 changed files with 7 additions and 1 deletions
|
@ -491,7 +491,13 @@ public final class CraftEntityTypes {
|
|||
}
|
||||
|
||||
private static <R extends EntityMinecartAbstract> Function<SpawnData, R> createMinecart(EntityTypes<R> 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 <R extends net.minecraft.world.entity.Entity> Function<SpawnData, R> createAndMove(EntityTypes<R> entityTypes) {
|
||||
|
|
Loading…
Reference in a new issue