World data cache fixes

This commit is contained in:
paulevsGitch 2021-06-11 23:03:07 +03:00
parent e0a9d21d59
commit 5cef3a03eb
2 changed files with 21 additions and 3 deletions

View file

@ -33,9 +33,11 @@ public class DataFixerAPI {
Collection<ModContainer> mods = FabricLoader.getInstance().getAllMods();
for (ModContainer mod: mods) {
String name = mod.getMetadata().getId();
int preVersion = getModVersion(WorldDataAPI.getRootTag(name).getString("version"));
int version = getModVersion(mod.getMetadata().getVersion().toString());
if (version > 0) {
shoudFix |= FIX_VERSIONS.getOrDefault(name, version) < version;
if (version > preVersion) {
int fixVersion = FIX_VERSIONS.getOrDefault(name, version);
shoudFix |= fixVersion < version && fixVersion >= preVersion;
}
};
if (!shoudFix) {