Skip to content
Merged
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
1 change: 1 addition & 0 deletions build-data/paper.at
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ public net.minecraft.world.level.storage.DimensionDataStorage cache
public net.minecraft.world.level.storage.LevelStorageSource baseDir
public net.minecraft.world.level.storage.LevelStorageSource$LevelStorageAccess levelDirectory
public net.minecraft.world.level.storage.PrimaryLevelData settings
public net.minecraft.world.level.storage.TagValueInput input
public net.minecraft.world.scores.Objective displayName
public net.minecraft.world.scores.criteria.ObjectiveCriteria CRITERIA_CACHE
public-f net.minecraft.server.MinecraftServer potionBrewing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
--- a/net/minecraft/world/entity/EntityType.java
+++ b/net/minecraft/world/entity/EntityType.java
@@ -185,6 +_,7 @@
import org.slf4j.Logger;

public class EntityType<T extends Entity> implements FeatureElement, EntityTypeTest<Entity, T> {
+ private static final boolean DEBUG_ENTITIES_WITH_INVALID_IDS = Boolean.getBoolean("paper.debugEntitiesWithInvalidIds"); // Paper - Add logging for debugging entity tags with invalid ids
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();
@@ -1265,6 +_,22 @@
boolean shouldOffsetY,
boolean shouldOffsetYMore
Expand Down Expand Up @@ -108,7 +116,7 @@
entityData.loadInto(entity);
}
}
@@ -1429,9 +_,20 @@
@@ -1429,10 +_,28 @@
}

public static Optional<Entity> create(ValueInput input, Level level, EntitySpawnReason spawnReason) {
Expand All @@ -121,15 +129,24 @@
return Util.ifElse(
by(input).map(entityType -> entityType.create(level, spawnReason)),
- entity -> entity.load(input),
- () -> LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]"))
+ // Paper start - Don't fire sync event during generation
+ entity -> {
+ if (generation) entity.generation = true; // Paper - Don't fire sync event during generation
+ entity.load(input);
+ },
+ // Paper end - Don't fire sync event during generation
() -> LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]"))
+ // Paper start - Add logging for debugging entity tags with invalid ids
+ () -> {
+ LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]"));
+ if ((DEBUG_ENTITIES_WITH_INVALID_IDS || level.getCraftServer().getServer().isDebugging()) && input instanceof TagValueInput tagInput) {
+ LOGGER.warn("Skipped entity tag: {}", tagInput.input);
+ }
+ }
+ // Paper end - Add logging for debugging entity tags with invalid ids
);
}

@@ -1588,8 +_,23 @@
return this.builtInRegistryHolder;
}
Expand Down
Loading