endCityFailChance fix (final approach)
This commit is contained in:
parent
1992fbd988
commit
bff1d42469
1 changed files with 1 additions and 6 deletions
|
@ -2,9 +2,6 @@ package org.betterx.betterend.mixin.common;
|
||||||
|
|
||||||
import org.betterx.betterend.world.generator.GeneratorOptions;
|
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.Structure;
|
||||||
import net.minecraft.world.level.levelgen.structure.structures.EndCityStructure;
|
import net.minecraft.world.level.levelgen.structure.structures.EndCityStructure;
|
||||||
|
|
||||||
|
@ -23,10 +20,8 @@ public class EndCityFeatureMixin {
|
||||||
CallbackInfoReturnable<Optional<Structure.GenerationStub>> info
|
CallbackInfoReturnable<Optional<Structure.GenerationStub>> info
|
||||||
) {
|
) {
|
||||||
if (GeneratorOptions.useNewGenerator()) {
|
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();
|
int chance = GeneratorOptions.getEndCityFailChance();
|
||||||
if (chance > 0 && chunkRandom.nextInt(chance) != 0) {
|
if (chance > 0 && context.random().nextInt(chance) != 0) {
|
||||||
info.setReturnValue(Optional.empty());
|
info.setReturnValue(Optional.empty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue