Don't ignore endCityFailChance config value. Fixes quiqueck/BetterEnd#92

This commit is contained in:
Necrontyr 2022-10-12 08:50:36 +02:00
parent ac96841372
commit 01a4bdbe8e
2 changed files with 22 additions and 21 deletions

View file

@ -24,12 +24,12 @@ public class EndCityFeatureMixin {
) { ) {
final ChunkPos pos = context.chunkPos(); final ChunkPos pos = context.chunkPos();
WorldgenRandom chunkRandom = new WorldgenRandom(new XoroshiroRandomSource(pos.x, pos.z)); WorldgenRandom chunkRandom = new WorldgenRandom(new XoroshiroRandomSource(pos.x, pos.z));
chunkRandom.consumeCount(1);
if (GeneratorOptions.useNewGenerator()) { if (GeneratorOptions.useNewGenerator()) {
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());
info.cancel();
} }
} }
} }

View file

@ -2,34 +2,35 @@
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "org.betterx.betterend.mixin.common", "package": "org.betterx.betterend.mixin.common",
"compatibilityLevel": "JAVA_16", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [
"LevelMixin", "BlockBehaviourMixin",
"NoiseBasedChunkGeneratorAccessor",
"NoiseGeneratorSettingsMixin",
"NoiseInterpolatorAccessor",
"ChorusPlantFeatureMixin",
"PlayerAdvancementsMixin",
"ChorusFlowerBlockMixin", "ChorusFlowerBlockMixin",
"ChorusPlantBlockMixin", "ChorusPlantBlockMixin",
"EndPodiumFeatureMixin", "ChorusPlantFeatureMixin",
"EndDragonFightMixin",
"MappedRegistryMixin",
"WorldGenRegionMixin",
"BlockBehaviourMixin",
"NoiseChunkAccessor",
"CraftingMenuMixin", "CraftingMenuMixin",
"LivingEntityMixin", "EndCityFeatureMixin",
"ServerPlayerMixin", "EndDragonFightMixin",
"SpikeFeatureMixin",
"ServerLevelMixin",
"NoiseChunkMixin",
"EnderManMixin", "EnderManMixin",
"EndPodiumFeatureMixin",
"EndSpikeMixin", "EndSpikeMixin",
"MonsterMixin",
"EntityMixin", "EntityMixin",
"LevelMixin",
"LivingEntityMixin",
"MappedRegistryMixin",
"MonsterMixin",
"NoiseBasedChunkGeneratorAccessor",
"NoiseChunkAccessor",
"NoiseChunkMixin",
"NoiseGeneratorSettingsMixin",
"NoiseInterpolatorAccessor",
"PlayerAdvancementsMixin",
"PlayerMixin", "PlayerMixin",
"SlimeMixin" "ServerLevelMixin",
"ServerPlayerMixin",
"SlimeMixin",
"SpikeFeatureMixin",
"WorldGenRegionMixin"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1