Skip to content

Commit 3993907

Browse files
committed
Merge remote-tracking branch 'origin/main' into 1.18
2 parents f1811bb + 3dbff47 commit 3993907

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

common/src/main/java/org/embeddedt/modernfix/structure/CachingStructureManager.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,22 @@ public static CompoundTag readStructureTag(ResourceLocation location, DataFixer
6262
currentTag.putInt("DataVersion", 500);
6363
}
6464
int currentDataVersion = currentTag.getInt("DataVersion");
65-
if(currentDataVersion < SharedConstants.getCurrentVersion().getWorldVersion()) {
65+
int requiredMinimumDataVersion = SharedConstants.getCurrentVersion().getWorldVersion();
66+
if(currentDataVersion < requiredMinimumDataVersion) {
6667
/* Needs upgrade, try looking up from cache */
6768
MessageDigest hasher = digestThreadLocal.get();
6869
hasher.reset();
6970
String hash = encodeHex(hasher.digest(structureBytes));
7071
CompoundTag cachedUpgraded = getCachedUpgraded(location, truncateHash(hash));
7172
if(cachedUpgraded == null)
7273
cachedUpgraded = getCachedUpgraded(location, hash); /* pick up old cache */
73-
if(cachedUpgraded != null && cachedUpgraded.getInt("DataVersion") == SharedConstants.getCurrentVersion().getWorldVersion()) {
74+
if(cachedUpgraded != null && cachedUpgraded.getInt("DataVersion") == requiredMinimumDataVersion) {
7475
ModernFix.LOGGER.debug("Using cached upgraded version of {}", location);
7576
currentTag = cachedUpgraded;
7677
} else {
7778
synchronized (laggyStructureMods) {
7879
if(laggyStructureMods.add(location.getNamespace())) {
79-
ModernFix.LOGGER.warn("Mod {} is shipping outdated structure files, which can cause worldgen lag; please report this to them.", location.getNamespace());
80+
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());
8081
}
8182
}
8283
ModernFix.LOGGER.debug("Structure {} is being run through DFU (hash {}), this will cause launch time delays", location, hash);

0 commit comments

Comments
 (0)