Attempt to fix weirdness on thread change while importing

This commit is contained in:
mcrcortex
2025-06-30 11:21:01 +10:00
parent 726517a8b6
commit b92b769f7b
2 changed files with 9 additions and 6 deletions

View File

@@ -70,13 +70,10 @@ public abstract class VoxyConfigScreenPages {
if (wasEnabled) {
VoxyCommon.createInstance();
if (vrsh != null && s.enableRendering) {
vrsh.createRenderer();
}
}
}, s -> s.serviceThreads)
.setImpact(OptionImpact.HIGH)
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
.build()
).add(OptionImpl.createBuilder(boolean.class, storage)
.setName(Text.translatable("voxy.config.general.ingest"))

View File

@@ -40,13 +40,19 @@ public class WorldIdentifier {
if (obj instanceof WorldIdentifier other) {
return other.hashCode == this.hashCode &&
other.biomeSeed == this.biomeSeed &&
other.key == this.key &&//other.key.equals(this.key) &&
other.dimension == this.dimension//other.dimension.equals(this.dimension)
equal(other.key, this.key) &&//other.key.equals(this.key) &&
equal(other.dimension, this.dimension)//other.dimension.equals(this.dimension)
;
}
return false;
}
private static <T> boolean equal(RegistryKey<T> a, RegistryKey<T> b) {
if (a == b) return true;
if (a == null || b == null) return false;
return a.getRegistry().equals(b.getRegistry()) && a.getValue().equals(b.getValue());
}
//Quick access utility method to get or create a world object in the current instance
public WorldEngine getOrCreateEngine() {
var instance = VoxyCommon.getInstance();