updated isFeatureChunk
and generatePieces
Signatures
This commit is contained in:
parent
8531be7b94
commit
036d594012
9 changed files with 88 additions and 65 deletions
|
@ -1,5 +1,6 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.world.level.LevelHeightAccessor;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -18,15 +19,15 @@ import ru.betterend.world.generator.GeneratorOptions;
|
|||
@Mixin(EndCityFeature.class)
|
||||
public class EndCityFeatureMixin {
|
||||
@Inject(method = "isFeatureChunk", at = @At("HEAD"), cancellable = true)
|
||||
private void be_isFeatureChunk(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, WorldgenRandom chunkRandom, int i, int j, Biome biome, ChunkPos chunkPos, NoneFeatureConfiguration defaultFeatureConfig, CallbackInfoReturnable<Boolean> info) {
|
||||
private void be_isFeatureChunk(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, WorldgenRandom chunkRandom, ChunkPos pos, Biome biome, ChunkPos chunkPos, NoneFeatureConfiguration defaultFeatureConfig, LevelHeightAccessor levelHeightAccessor, CallbackInfoReturnable<Boolean> info) {
|
||||
if (GeneratorOptions.useNewGenerator()) {
|
||||
int chance = GeneratorOptions.getEndCityFailChance();
|
||||
if (chance == 0) {
|
||||
info.setReturnValue(getYPositionForFeature(i, j, chunkGenerator) >= 60);
|
||||
info.setReturnValue(getYPositionForFeature(pos, chunkGenerator, levelHeightAccessor) >= 60);
|
||||
info.cancel();
|
||||
}
|
||||
else if (chunkRandom.nextInt(chance) == 0){
|
||||
info.setReturnValue(getYPositionForFeature(i, j, chunkGenerator) >= 60);
|
||||
info.setReturnValue(getYPositionForFeature(pos, chunkGenerator, levelHeightAccessor) >= 60);
|
||||
info.cancel();
|
||||
}
|
||||
else {
|
||||
|
@ -37,7 +38,7 @@ public class EndCityFeatureMixin {
|
|||
}
|
||||
|
||||
@Shadow
|
||||
private static int getYPositionForFeature(int chunkX, int chunkZ, ChunkGenerator chunkGenerator) {
|
||||
private static int getYPositionForFeature(ChunkPos pos, ChunkGenerator chunkGenerator, LevelHeightAccessor levelHeightAccessor) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue