Merge remote-tracking branch 'origin/main' into 1.18
This commit is contained in:
commit
39939076e7
|
|
@ -62,7 +62,8 @@ public class CachingStructureManager {
|
||||||
currentTag.putInt("DataVersion", 500);
|
currentTag.putInt("DataVersion", 500);
|
||||||
}
|
}
|
||||||
int currentDataVersion = currentTag.getInt("DataVersion");
|
int currentDataVersion = currentTag.getInt("DataVersion");
|
||||||
if(currentDataVersion < SharedConstants.getCurrentVersion().getWorldVersion()) {
|
int requiredMinimumDataVersion = SharedConstants.getCurrentVersion().getWorldVersion();
|
||||||
|
if(currentDataVersion < requiredMinimumDataVersion) {
|
||||||
/* Needs upgrade, try looking up from cache */
|
/* Needs upgrade, try looking up from cache */
|
||||||
MessageDigest hasher = digestThreadLocal.get();
|
MessageDigest hasher = digestThreadLocal.get();
|
||||||
hasher.reset();
|
hasher.reset();
|
||||||
|
|
@ -70,13 +71,13 @@ public class CachingStructureManager {
|
||||||
CompoundTag cachedUpgraded = getCachedUpgraded(location, truncateHash(hash));
|
CompoundTag cachedUpgraded = getCachedUpgraded(location, truncateHash(hash));
|
||||||
if(cachedUpgraded == null)
|
if(cachedUpgraded == null)
|
||||||
cachedUpgraded = getCachedUpgraded(location, hash); /* pick up old cache */
|
cachedUpgraded = getCachedUpgraded(location, hash); /* pick up old cache */
|
||||||
if(cachedUpgraded != null && cachedUpgraded.getInt("DataVersion") == SharedConstants.getCurrentVersion().getWorldVersion()) {
|
if(cachedUpgraded != null && cachedUpgraded.getInt("DataVersion") == requiredMinimumDataVersion) {
|
||||||
ModernFix.LOGGER.debug("Using cached upgraded version of {}", location);
|
ModernFix.LOGGER.debug("Using cached upgraded version of {}", location);
|
||||||
currentTag = cachedUpgraded;
|
currentTag = cachedUpgraded;
|
||||||
} else {
|
} else {
|
||||||
synchronized (laggyStructureMods) {
|
synchronized (laggyStructureMods) {
|
||||||
if(laggyStructureMods.add(location.getNamespace())) {
|
if(laggyStructureMods.add(location.getNamespace())) {
|
||||||
ModernFix.LOGGER.warn("Mod {} is shipping outdated structure files, which can cause worldgen lag; please report this to them.", location.getNamespace());
|
ModernFix.LOGGER.warn("The namespace {} contains an outdated structure file, which can cause worldgen lag. Please view debug.log for the full filename, determine which mod provides the structure, and report to the mod/datapack author, including the debug log.", location.getNamespace());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ModernFix.LOGGER.debug("Structure {} is being run through DFU (hash {}), this will cause launch time delays", location, hash);
|
ModernFix.LOGGER.debug("Structure {} is being run through DFU (hash {}), this will cause launch time delays", location, hash);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user