Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ index c2363cfa5e93942fe837efd9f39478698f6d1a98..2dfd412344a0e57f25a08d9c65656a13
scopedCollector.forChild(entity.problemPath()), entity.registryAccess()
);
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
index 3cf2378a2ccf117fab9fc6fc60fcb0ecdf638d45..abccad13c2bb3a33e98ad8eb6d7f08c0ef021811 100644
index c6494dc43c817075fd1eed7ada0ff9c0bb06ad94..e20d50be8e81a1c41bb30bb0f5fe427c2a14ef68 100644
--- a/net/minecraft/world/entity/EntityType.java
+++ b/net/minecraft/world/entity/EntityType.java
@@ -1615,7 +1615,18 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@@ -1622,7 +1622,18 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
}

public static Stream<Entity> loadEntitiesRecursive(ValueInput.ValueInputList input, Level level, EntitySpawnReason spawnReason) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
private static final Logger LOGGER = LogUtils.getLogger();
private final Holder.Reference<EntityType<?>> builtInRegistryHolder = BuiltInRegistries.ENTITY_TYPE.createIntrusiveHolder(this);
public static final Codec<EntityType<?>> CODEC = BuiltInRegistries.ENTITY_TYPE.byNameCodec();
@@ -1290,6 +_,22 @@
@@ -1290,14 +_,37 @@
boolean shouldOffsetY,
boolean shouldOffsetYMore
) {
Expand All @@ -30,8 +30,16 @@
+ // CraftBukkit end
Consumer<T> consumer;
if (spawnedFrom != null) {
consumer = createDefaultStackConfig(level, spawnedFrom, owner);
@@ -1297,7 +_,7 @@
- consumer = createDefaultStackConfig(level, spawnedFrom, owner);
+ // Paper start - override spawnReason with createSpawnReason if not Paper.SpawnReason it's used to avoid bad fallback reason behavior
+ TypedEntityData<EntityType<?>> typedEntityData = spawnedFrom.get(DataComponents.ENTITY_DATA);
+ if (typedEntityData != null && !typedEntityData.copyTagWithEntityId().contains("Paper.SpawnReason")) {
+ consumer = appendCustomEntityStackConfig(appendComponentsConfig(entity -> entity.spawnReason = createSpawnReason, spawnedFrom), level, spawnedFrom, owner);
+ } else {
+ consumer = createDefaultStackConfig(level, spawnedFrom, owner);
+ }
+ // Paper end
} else {
consumer = entity -> {};
}

Expand Down
Loading