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);
|
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);
|
this.entityData.set(VARIANT, (byte) 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class EndFishEntity extends AbstractSchoolingFish {
|
||||||
) {
|
) {
|
||||||
SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag);
|
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));
|
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);
|
SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag);
|
||||||
BCLBiome biome = BiomeAPI.getBiome(world.getBiome(blockPosition()));
|
BCLBiome biome = BiomeAPI.getBiome(world.getBiome(blockPosition()));
|
||||||
if (biome == EndBiomes.FOGGY_MUSHROOMLAND) {
|
if (biome.equals(EndBiomes.FOGGY_MUSHROOMLAND)) {
|
||||||
this.setMossy();
|
this.setMossy();
|
||||||
} else if (biome == EndBiomes.MEGALAKE || biome == EndBiomes.MEGALAKE_GROVE) {
|
} else if (biome.equals(EndBiomes.MEGALAKE) || biome.equals(EndBiomes.MEGALAKE_GROVE)) {
|
||||||
this.setLake();
|
this.setLake();
|
||||||
} else if (biome == EndBiomes.AMBER_LAND) {
|
} else if (biome.equals(EndBiomes.AMBER_LAND)) {
|
||||||
this.setAmber(true);
|
this.setAmber();
|
||||||
}
|
}
|
||||||
this.refreshDimensions();
|
this.refreshDimensions();
|
||||||
return data;
|
return data;
|
||||||
|
@ -205,7 +205,7 @@ public class EndSlimeEntity extends Slime {
|
||||||
return getSlimeType() == 2;
|
return getSlimeType() == 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setAmber(boolean mossy) {
|
protected void setAmber() {
|
||||||
this.entityData.set(VARIANT, (byte) 3);
|
this.entityData.set(VARIANT, (byte) 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,10 +228,10 @@ public class EndSlimeEntity extends Slime {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
BCLBiome biome = BiomeAPI.getBiome(world.getBiome(pos));
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
if (biome == EndBiomes.MEGALAKE_GROVE && random.nextBoolean()) {
|
if (biome.equals(EndBiomes.MEGALAKE_GROVE) && random.nextBoolean()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return random.nextInt(4) == 0 && isWaterNear(world, pos);
|
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 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;
|
||||||
|
|
||||||
|
@ -22,14 +19,10 @@ 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));
|
|
||||||
|
|
||||||
if (GeneratorOptions.useNewGenerator()) {
|
if (GeneratorOptions.useNewGenerator()) {
|
||||||
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());
|
||||||
info.cancel();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,15 +92,15 @@ public class LootTableUtil {
|
||||||
|
|
||||||
public static ResourceLocation getTable(Holder<Biome> biome) {
|
public static ResourceLocation getTable(Holder<Biome> biome) {
|
||||||
BCLBiome bclBiome = BiomeAPI.getBiome(biome.value());
|
BCLBiome bclBiome = BiomeAPI.getBiome(biome.value());
|
||||||
if (bclBiome == EndBiomes.FOGGY_MUSHROOMLAND) {
|
if (bclBiome.equals(EndBiomes.FOGGY_MUSHROOMLAND)) {
|
||||||
return FOGGY_MUSHROOMLAND;
|
return FOGGY_MUSHROOMLAND;
|
||||||
} else if (bclBiome == EndBiomes.CHORUS_FOREST) {
|
} else if (bclBiome.equals(EndBiomes.CHORUS_FOREST)) {
|
||||||
return CHORUS_FOREST;
|
return CHORUS_FOREST;
|
||||||
} else if (bclBiome == EndBiomes.SHADOW_FOREST) {
|
} else if (bclBiome.equals(EndBiomes.SHADOW_FOREST)) {
|
||||||
return SHADOW_FOREST;
|
return SHADOW_FOREST;
|
||||||
} else if (bclBiome == EndBiomes.LANTERN_WOODS) {
|
} else if (bclBiome.equals(EndBiomes.LANTERN_WOODS)) {
|
||||||
return LANTERN_WOODS;
|
return LANTERN_WOODS;
|
||||||
} else if (bclBiome == EndBiomes.UMBRELLA_JUNGLE) {
|
} else if (bclBiome.equals(EndBiomes.UMBRELLA_JUNGLE)) {
|
||||||
return UMBRELLA_JUNGLE;
|
return UMBRELLA_JUNGLE;
|
||||||
}
|
}
|
||||||
return COMMON;
|
return COMMON;
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class FloatingSpireFeature extends SpireFeature {
|
||||||
sdf.fillRecursive(world, center);
|
sdf.fillRecursive(world, center);
|
||||||
|
|
||||||
support.forEach((bpos) -> {
|
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()
|
EndFeatures.TENANEA_BUSH.getFeature()
|
||||||
.place(new FeaturePlaceContext<NoneFeatureConfiguration>(
|
.place(new FeaturePlaceContext<NoneFeatureConfiguration>(
|
||||||
Optional.empty(),
|
Optional.empty(),
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class SpireFeature extends DefaultFeature {
|
||||||
}).fillRecursive(world, center);
|
}).fillRecursive(world, center);
|
||||||
|
|
||||||
support.forEach((bpos) -> {
|
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()
|
EndFeatures.TENANEA_BUSH.getFeature()
|
||||||
.place(new FeaturePlaceContext<NoneFeatureConfiguration>(
|
.place(new FeaturePlaceContext<NoneFeatureConfiguration>(
|
||||||
Optional.empty(),
|
Optional.empty(),
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue