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

This commit is contained in:
LexManos 2026-01-03 11:41:49 -08:00
parent 8b8d3fdef7
commit 8368a1d20a
No known key found for this signature in database
GPG key ID: 6E90061A7AE1F652

View file

@ -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_) {