Don't save capabilities if level is null as we don't have enough context

This commit is contained in:
LexManos committed 2026-01-03 11:41:49 -08:00
1 parent 8b8d3fdef7
commit 8368a1d20a
1 file changed
+1 -1
@@ -43,7 +43,7 @@
}
protected void saveAdditional(ValueOutput p_407573_) {
+ if (getCapabilities() != null) p_407573_.storeNullable("ForgeCaps", CompoundTag.CODEC, serializeCaps(this.level.registryAccess()));
+ if (getCapabilities() != null && this.level != null) p_407573_.storeNullable("ForgeCaps", CompoundTag.CODEC, serializeCaps(this.level.registryAccess()));
}
public final CompoundTag saveWithFullMetadata(HolderLookup.Provider p_331193_) {