mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Add null check to DimensionDataStorage. Fixes #9859
This commit is contained in:
2 files changed
+10
-2
No files matched your search
@@ -14,3 +14,12 @@
|
||||
}
|
||||
|
||||
return (T)saveddata;
|
||||
@@ -94,7 +_,7 @@
|
||||
}
|
||||
|
||||
int i = NbtUtils.getDataVersion(compoundtag, 1343);
|
||||
- compoundtag1 = p_301060_.update(this.fixerUpper, compoundtag, i, p_78160_);
|
||||
+ compoundtag1 = p_301060_ == null ? compoundtag : p_301060_.update(this.fixerUpper, compoundtag, i, p_78160_); // Forge: Allow the data fixer to be null, leaving the modder responsible for keeping track of their own data formats
|
||||
}
|
||||
|
||||
return compoundtag1;
|
||||
@@ -6,7 +6,6 @@
|
||||
package net.minecraftforge.common.util;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.datafix.DataFixTypes;
|
||||
import net.minecraft.world.level.saveddata.SavedData;
|
||||
import net.minecraft.world.level.storage.DimensionDataStorage;
|
||||
|
||||
@@ -58,7 +57,7 @@ public class LevelCapabilityData extends SavedData {
|
||||
ret.read(tag);
|
||||
return ret;
|
||||
},
|
||||
DataFixTypes.SAVED_DATA_COMMAND_STORAGE //TODO: Hook this for our own types?
|
||||
null
|
||||
);
|
||||
|
||||
var ret = data.computeIfAbsent(factory, ID);
|
||||
|
||||
Reference in new issue
Block a user