endCityFailChance fix (another approach)
This commit is contained in:
parent
54f1100e22
commit
1992fbd988
1 changed files with 2 additions and 4 deletions
|
@ -22,11 +22,9 @@ public class EndCityFeatureMixin {
|
||||||
Structure.GenerationContext context,
|
Structure.GenerationContext context,
|
||||||
CallbackInfoReturnable<Optional<Structure.GenerationStub>> info
|
CallbackInfoReturnable<Optional<Structure.GenerationStub>> info
|
||||||
) {
|
) {
|
||||||
final ChunkPos pos = context.chunkPos();
|
|
||||||
WorldgenRandom chunkRandom = new WorldgenRandom(new XoroshiroRandomSource(pos.x, pos.z));
|
|
||||||
chunkRandom.consumeCount(1);
|
|
||||||
|
|
||||||
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 && chunkRandom.nextInt(chance) != 0) {
|
||||||
info.setReturnValue(Optional.empty());
|
info.setReturnValue(Optional.empty());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue