Closed Senjosei closed 6 months ago
When something like this happens, please manually trigger a crash-report by holding F3 + C
for 10 seconds.
here's what i got:
java.lang.ExceptionInInitializerError
at net.minecraft.world.biome.source.FixedBiomeSource.<clinit>(FixedBiomeSource.java:17)
at net.minecraft.world.biome.source.BiomeSources.registerAndGetDefault(BiomeSources.java:8)
at net.minecraft.registry.Registries.method_47485(Registries.java:232)
at net.minecraft.registry.Registries.method_47482(Registries.java:247)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
at net.minecraft.registry.Registries.init(Registries.java:245)
at net.minecraft.registry.Registries.bootstrap(Registries.java:239)
at net.minecraft.Bootstrap.initialize(Bootstrap.java:69)
at net.minecraft.client.main.Main.main(Main.java:170)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
Caused by: java.lang.ClassCastException: class jdk.random.L64X128MixRandom cannot be cast to class net.minecraft.util.math.random.Random (jdk.random.L64X128MixRandom is in module jdk.random of loader 'app'; net.minecraft.util.math.random.Random is in unnamed module of loader net.fabricmc.loader.impl.launch.knot.KnotClassLoader @d2cc05a)
at net.minecraft.util.math.random.ChunkRandom.handler$zza000$faster-random$test(ChunkRandom.java:525)
at net.minecraft.util.math.random.ChunkRandom.<init>(ChunkRandom.java:19)
at net.minecraft.world.biome.Biome.<clinit>(Biome.java:56)
... 13 more
Their random generator gets created here: https://github.com/quiqueck/BCLib/blob/3b23118a28bbea0363e25378aab38cbff45f9683/src/main/java/org/betterx/bclib/api/v2/generator/map/hex/HexBiomeMap.java#L85
Might be related to the way that is set up?
I did find a fix after messing around with ChunkRandom, although I really don't like it.
One fix is to assign a vanilla CheckedRandom in ChunkRandom, but this will hurt worldgen performance.
package com.github.anopensaucedev.fasterrandom.mixin;
import net.minecraft.util.math.random.CheckedRandom;
import net.minecraft.util.math.random.ChunkRandom;
import net.minecraft.util.math.random.Random;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ChunkRandom.class)
public class ChunkRandomMixin {
@Mutable
@Shadow
@Final
private Random baseRandom;
@Inject(method = "<init>(Lnet/minecraft/util/math/random/Random;)V",at = @At("RETURN"))
private void fasterrandom$fixBetterX(Random baseRandom, CallbackInfo ci){
this.baseRandom = new CheckedRandom(0);
}
}
I have absolutely no idea what fasterrandom$test is, as no method is ever named that in the source code, refmap or decompiled source. There is also nothing in these fields that would even have test
as a member.
I might push this fix as-is to resolve it for now, but ideally this should be looked into further.
Could add a compat mixin that changes their random number generator back to a normal one. Maybe a feature to disable the random generator replacement if it's instantiated from certain classes would be handy in the future for this.
Just a shout, maybe the split()
method doesn't work as intended and causes the ClassCastExceptoon
?
https://github.com/AnOpenSauceDev/FastRandom/blob/master/src%2Fmain%2Fjava%2Fcom%2Fgithub%2Fanopensaucedev%2Ffasterrandom%2FRandomGeneratorRandom.java#L28-L31
Just a shout, maybe the split() method doesn't work as intended
Actually, i think that might be it.
variants of split like split(int x, int y, int z)
aren't implemented, but i think pasting them in won't work.
Also, the only test
that makes sense (as in, calls split()
) is all the ones in MaterialRules
, which never manages to get called when entering the nether.
Fixed with #41/#42 (merged)
I was making a modpack when i encountered this.
So if i have BetterX installed and use BetterX world gen A. If tried to goto the nether, i just get stuck on the portal waiting for it to find a location to teleport me B. If i then disable FastRandom and use the portal again, everything works and chunks generate C. Then if i Re-enable FastRandom, I can go into the nether, but the chunks that werent generated before wont load, and if i goto an ungenerated chunk, it thread locks
Same-ish effect when going to the end but in
A.
it just thread locks. Heres the thread dump courtesy ofModernFix
https://pastebin.com/6nVs0criSnip