endCityFailChance fix (final approach)

This commit is contained in:
Necrontyr 2022-10-16 00:19:36 +02:00
parent 1992fbd988
commit bff1d42469

View file

@ -2,9 +2,6 @@ package org.betterx.betterend.mixin.common;
import org.betterx.betterend.world.generator.GeneratorOptions;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.levelgen.WorldgenRandom;
import net.minecraft.world.level.levelgen.XoroshiroRandomSource;
import net.minecraft.world.level.levelgen.structure.Structure;
import net.minecraft.world.level.levelgen.structure.structures.EndCityStructure;
@ -23,10 +20,8 @@ public class EndCityFeatureMixin {
CallbackInfoReturnable<Optional<Structure.GenerationStub>> info
) {
if (GeneratorOptions.useNewGenerator()) {
final ChunkPos pos = context.chunkPos();
WorldgenRandom chunkRandom = new WorldgenRandom(new XoroshiroRandomSource(context.seed() * pos.x, context.seed() * pos.z));
int chance = GeneratorOptions.getEndCityFailChance();
if (chance > 0 && chunkRandom.nextInt(chance) != 0) {
if (chance > 0 && context.random().nextInt(chance) != 0) {
info.setReturnValue(Optional.empty());
}
}