Fixes
This commit is contained in:
parent
1f697db60b
commit
c1a0dfc0c2
3 changed files with 18 additions and 2 deletions
|
@ -17,6 +17,7 @@ import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
import ru.betterend.blocks.BlockProperties;
|
import ru.betterend.blocks.BlockProperties;
|
||||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||||
|
import ru.betterend.blocks.basis.BlockFur;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
|
@ -32,6 +33,7 @@ import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class TenaneaBushFeature extends DefaultFeature {
|
public class TenaneaBushFeature extends DefaultFeature {
|
||||||
private static final Function<BlockState, Boolean> REPLACE;
|
private static final Function<BlockState, Boolean> REPLACE;
|
||||||
|
private static final Direction[] DIRECTIONS = Direction.values();
|
||||||
|
|
||||||
public TenaneaBushFeature() {}
|
public TenaneaBushFeature() {}
|
||||||
|
|
||||||
|
@ -57,6 +59,14 @@ public class TenaneaBushFeature extends DefaultFeature {
|
||||||
BlockPos d = info.getPos().down();
|
BlockPos d = info.getPos().down();
|
||||||
support.add(d);
|
support.add(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MHelper.shuffle(DIRECTIONS, random);
|
||||||
|
for (Direction d: DIRECTIONS) {
|
||||||
|
if (info.getState(d).isAir()) {
|
||||||
|
info.setBlockPos(info.getPos().offset(d), EndBlocks.TENANEA_OUTER_LEAVES.getDefaultState().with(BlockFur.FACING, d));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return info.getState().with(LeavesBlock.DISTANCE, distance);
|
return info.getState().with(LeavesBlock.DISTANCE, distance);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.world.StructureWorldAccess;
|
||||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
|
import ru.betterend.registry.EndBiomes;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
import ru.betterend.util.MHelper;
|
import ru.betterend.util.MHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
import ru.betterend.util.sdf.SDF;
|
||||||
|
@ -54,7 +55,9 @@ public class FloatingSpireFeature extends SpireFeature {
|
||||||
sdf.fillRecursive(world, center);
|
sdf.fillRecursive(world, center);
|
||||||
|
|
||||||
support.forEach((bpos) -> {
|
support.forEach((bpos) -> {
|
||||||
EndFeatures.TENANEA_BUSH.getFeature().generate(world, chunkGenerator, random, bpos, null);
|
if (EndBiomes.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) {
|
||||||
|
EndFeatures.TENANEA_BUSH.getFeature().generate(world, chunkGenerator, random, bpos, null);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.StructureWorldAccess;
|
||||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
|
import ru.betterend.registry.EndBiomes;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.MHelper;
|
import ru.betterend.util.MHelper;
|
||||||
|
@ -56,7 +57,9 @@ public class SpireFeature extends DefaultFeature {
|
||||||
sdf.fillRecursive(world, center);
|
sdf.fillRecursive(world, center);
|
||||||
|
|
||||||
support.forEach((bpos) -> {
|
support.forEach((bpos) -> {
|
||||||
EndFeatures.TENANEA_BUSH.getFeature().generate(world, chunkGenerator, random, bpos, null);
|
if (EndBiomes.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) {
|
||||||
|
EndFeatures.TENANEA_BUSH.getFeature().generate(world, chunkGenerator, random, bpos, null);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue