Merge pull request #94 from Necrontyrr/1.19
Fix endCityFailChance config. Fix slime variant.
This commit is contained in:
commit
a5bfe04ed1
8 changed files with 38 additions and 44 deletions
|
@ -51,7 +51,7 @@ public class CubozoaEntity extends AbstractSchoolingFish {
|
|||
) {
|
||||
SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag);
|
||||
|
||||
if (BiomeAPI.getBiome(world.getBiome(blockPosition())) == EndBiomes.SULPHUR_SPRINGS) {
|
||||
if (BiomeAPI.getBiome(world.getBiome(blockPosition())).equals(EndBiomes.SULPHUR_SPRINGS)) {
|
||||
this.entityData.set(VARIANT, (byte) 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class EndFishEntity extends AbstractSchoolingFish {
|
|||
) {
|
||||
SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag);
|
||||
|
||||
if (BiomeAPI.getBiome(world.getBiome(blockPosition())) == EndBiomes.SULPHUR_SPRINGS) {
|
||||
if (BiomeAPI.getBiome(world.getBiome(blockPosition())).equals(EndBiomes.SULPHUR_SPRINGS)) {
|
||||
this.entityData.set(VARIANT, (byte) (random.nextInt(VARIANTS_SULPHUR) + VARIANTS_NORMAL));
|
||||
}
|
||||
|
||||
|
|
|
@ -90,12 +90,12 @@ public class EndSlimeEntity extends Slime {
|
|||
) {
|
||||
SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag);
|
||||
BCLBiome biome = BiomeAPI.getBiome(world.getBiome(blockPosition()));
|
||||
if (biome == EndBiomes.FOGGY_MUSHROOMLAND) {
|
||||
if (biome.equals(EndBiomes.FOGGY_MUSHROOMLAND)) {
|
||||
this.setMossy();
|
||||
} else if (biome == EndBiomes.MEGALAKE || biome == EndBiomes.MEGALAKE_GROVE) {
|
||||
} else if (biome.equals(EndBiomes.MEGALAKE) || biome.equals(EndBiomes.MEGALAKE_GROVE)) {
|
||||
this.setLake();
|
||||
} else if (biome == EndBiomes.AMBER_LAND) {
|
||||
this.setAmber(true);
|
||||
} else if (biome.equals(EndBiomes.AMBER_LAND)) {
|
||||
this.setAmber();
|
||||
}
|
||||
this.refreshDimensions();
|
||||
return data;
|
||||
|
@ -205,7 +205,7 @@ public class EndSlimeEntity extends Slime {
|
|||
return getSlimeType() == 2;
|
||||
}
|
||||
|
||||
protected void setAmber(boolean mossy) {
|
||||
protected void setAmber() {
|
||||
this.entityData.set(VARIANT, (byte) 3);
|
||||
}
|
||||
|
||||
|
@ -228,10 +228,10 @@ public class EndSlimeEntity extends Slime {
|
|||
return false;
|
||||
}
|
||||
BCLBiome biome = BiomeAPI.getBiome(world.getBiome(pos));
|
||||
if (biome == EndBiomes.CHORUS_FOREST || biome == EndBiomes.MEGALAKE) {
|
||||
if (biome.equals(EndBiomes.CHORUS_FOREST) || biome.equals(EndBiomes.MEGALAKE)) {
|
||||
return true;
|
||||
}
|
||||
if (biome == EndBiomes.MEGALAKE_GROVE && random.nextBoolean()) {
|
||||
if (biome.equals(EndBiomes.MEGALAKE_GROVE) && random.nextBoolean()) {
|
||||
return true;
|
||||
}
|
||||
return random.nextInt(4) == 0 && isWaterNear(world, pos);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -22,14 +19,10 @@ public class EndCityFeatureMixin {
|
|||
Structure.GenerationContext context,
|
||||
CallbackInfoReturnable<Optional<Structure.GenerationStub>> info
|
||||
) {
|
||||
final ChunkPos pos = context.chunkPos();
|
||||
WorldgenRandom chunkRandom = new WorldgenRandom(new XoroshiroRandomSource(pos.x, pos.z));
|
||||
|
||||
if (GeneratorOptions.useNewGenerator()) {
|
||||
int chance = GeneratorOptions.getEndCityFailChance();
|
||||
if (chance > 0 && chunkRandom.nextInt(chance) != 0) {
|
||||
if (chance > 0 && context.random().nextInt(chance) != 0) {
|
||||
info.setReturnValue(Optional.empty());
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,15 +92,15 @@ public class LootTableUtil {
|
|||
|
||||
public static ResourceLocation getTable(Holder<Biome> biome) {
|
||||
BCLBiome bclBiome = BiomeAPI.getBiome(biome.value());
|
||||
if (bclBiome == EndBiomes.FOGGY_MUSHROOMLAND) {
|
||||
if (bclBiome.equals(EndBiomes.FOGGY_MUSHROOMLAND)) {
|
||||
return FOGGY_MUSHROOMLAND;
|
||||
} else if (bclBiome == EndBiomes.CHORUS_FOREST) {
|
||||
} else if (bclBiome.equals(EndBiomes.CHORUS_FOREST)) {
|
||||
return CHORUS_FOREST;
|
||||
} else if (bclBiome == EndBiomes.SHADOW_FOREST) {
|
||||
} else if (bclBiome.equals(EndBiomes.SHADOW_FOREST)) {
|
||||
return SHADOW_FOREST;
|
||||
} else if (bclBiome == EndBiomes.LANTERN_WOODS) {
|
||||
} else if (bclBiome.equals(EndBiomes.LANTERN_WOODS)) {
|
||||
return LANTERN_WOODS;
|
||||
} else if (bclBiome == EndBiomes.UMBRELLA_JUNGLE) {
|
||||
} else if (bclBiome.equals(EndBiomes.UMBRELLA_JUNGLE)) {
|
||||
return UMBRELLA_JUNGLE;
|
||||
}
|
||||
return COMMON;
|
||||
|
|
|
@ -86,7 +86,7 @@ public class FloatingSpireFeature extends SpireFeature {
|
|||
sdf.fillRecursive(world, center);
|
||||
|
||||
support.forEach((bpos) -> {
|
||||
if (BiomeAPI.getBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) {
|
||||
if (BiomeAPI.getBiome(world.getBiome(bpos)).equals(EndBiomes.BLOSSOMING_SPIRES)) {
|
||||
EndFeatures.TENANEA_BUSH.getFeature()
|
||||
.place(new FeaturePlaceContext<NoneFeatureConfiguration>(
|
||||
Optional.empty(),
|
||||
|
|
|
@ -86,7 +86,7 @@ public class SpireFeature extends DefaultFeature {
|
|||
}).fillRecursive(world, center);
|
||||
|
||||
support.forEach((bpos) -> {
|
||||
if (BiomeAPI.getBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) {
|
||||
if (BiomeAPI.getBiome(world.getBiome(bpos)).equals(EndBiomes.BLOSSOMING_SPIRES)) {
|
||||
EndFeatures.TENANEA_BUSH.getFeature()
|
||||
.place(new FeaturePlaceContext<NoneFeatureConfiguration>(
|
||||
Optional.empty(),
|
||||
|
|
|
@ -2,34 +2,35 @@
|
|||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "org.betterx.betterend.mixin.common",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"LevelMixin",
|
||||
"NoiseBasedChunkGeneratorAccessor",
|
||||
"NoiseGeneratorSettingsMixin",
|
||||
"NoiseInterpolatorAccessor",
|
||||
"ChorusPlantFeatureMixin",
|
||||
"PlayerAdvancementsMixin",
|
||||
"BlockBehaviourMixin",
|
||||
"ChorusFlowerBlockMixin",
|
||||
"ChorusPlantBlockMixin",
|
||||
"EndPodiumFeatureMixin",
|
||||
"EndDragonFightMixin",
|
||||
"MappedRegistryMixin",
|
||||
"WorldGenRegionMixin",
|
||||
"BlockBehaviourMixin",
|
||||
"NoiseChunkAccessor",
|
||||
"ChorusPlantFeatureMixin",
|
||||
"CraftingMenuMixin",
|
||||
"LivingEntityMixin",
|
||||
"ServerPlayerMixin",
|
||||
"SpikeFeatureMixin",
|
||||
"ServerLevelMixin",
|
||||
"NoiseChunkMixin",
|
||||
"EndCityFeatureMixin",
|
||||
"EndDragonFightMixin",
|
||||
"EnderManMixin",
|
||||
"EndPodiumFeatureMixin",
|
||||
"EndSpikeMixin",
|
||||
"MonsterMixin",
|
||||
"EntityMixin",
|
||||
"LevelMixin",
|
||||
"LivingEntityMixin",
|
||||
"MappedRegistryMixin",
|
||||
"MonsterMixin",
|
||||
"NoiseBasedChunkGeneratorAccessor",
|
||||
"NoiseChunkAccessor",
|
||||
"NoiseChunkMixin",
|
||||
"NoiseGeneratorSettingsMixin",
|
||||
"NoiseInterpolatorAccessor",
|
||||
"PlayerAdvancementsMixin",
|
||||
"PlayerMixin",
|
||||
"SlimeMixin"
|
||||
"ServerLevelMixin",
|
||||
"ServerPlayerMixin",
|
||||
"SlimeMixin",
|
||||
"SpikeFeatureMixin",
|
||||
"WorldGenRegionMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue