Tag switching (WIP)
This commit is contained in:
parent
0486d7d89c
commit
41df84404b
72 changed files with 303 additions and 628 deletions
|
@ -6,16 +6,16 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class CavePumpkinFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.above()).is(EndTags.GEN_TERRAIN) || !world.isEmptyBlock(pos)
|
||||
if (!world.getBlockState(pos.above()).is(TagAPI.GEN_TERRAIN) || !world.isEmptyBlock(pos)
|
||||
|| !world.isEmptyBlock(pos.below())) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProc
|
|||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.bclib.util.StructureHelper;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class CrashedShipFeature extends NBTStructureFeature {
|
||||
|
@ -48,7 +48,7 @@ public class CrashedShipFeature extends NBTStructureFeature {
|
|||
if (x * x + z * z < 3600) {
|
||||
return false;
|
||||
}
|
||||
return pos.getY() > 5 && world.getBlockState(pos.below()).is(EndTags.GEN_TERRAIN);
|
||||
return pos.getY() > 5 && world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,8 +9,8 @@ import net.minecraft.world.level.block.Mirror;
|
|||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.StructureHelper;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class ListFeature extends NBTStructureFeature {
|
||||
private final List<StructureInfo> list;
|
||||
|
@ -30,7 +30,7 @@ public class ListFeature extends NBTStructureFeature {
|
|||
protected boolean canSpawn(WorldGenLevel world, BlockPos pos, Random random) {
|
||||
int cx = pos.getX() >> 4;
|
||||
int cz = pos.getZ() >> 4;
|
||||
return ((cx + cz) & 1) == 0 && pos.getY() > 58 && world.getBlockState(pos.below()).is(EndTags.GEN_TERRAIN);
|
||||
return ((cx + cz) & 1) == 0 && pos.getY() > 58 && world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,8 +22,8 @@ import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
|||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
|
||||
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.processors.DestructionStructureProcessor;
|
||||
|
||||
|
@ -125,11 +125,11 @@ public abstract class NBTStructureFeature extends DefaultFeature {
|
|||
mut.setZ(z);
|
||||
mut.setY(surfMax);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (!state.is(EndTags.GEN_TERRAIN) && state.isFaceSturdy(world, mut, Direction.DOWN)) {
|
||||
if (!state.is(TagAPI.GEN_TERRAIN) && state.isFaceSturdy(world, mut, Direction.DOWN)) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
mut.setY(mut.getY() - 1);
|
||||
BlockState stateSt = world.getBlockState(mut);
|
||||
if (!stateSt.is(EndTags.GEN_TERRAIN)) {
|
||||
if (!stateSt.is(TagAPI.GEN_TERRAIN)) {
|
||||
if (merge == TerrainMerge.SURFACE) {
|
||||
SurfaceBuilderConfiguration config = world.getBiome(mut).getGenerationSettings()
|
||||
.getSurfaceBuilderConfig();
|
||||
|
@ -140,7 +140,7 @@ public abstract class NBTStructureFeature extends DefaultFeature {
|
|||
BlocksHelper.setWithoutUpdate(world, mut, state);
|
||||
}
|
||||
} else {
|
||||
if (stateSt.is(EndTags.END_GROUND) && state.getMaterial().isSolidBlocking()) {
|
||||
if (stateSt.is(TagAPI.END_GROUND) && state.getMaterial().isSolidBlocking()) {
|
||||
if (merge == TerrainMerge.SURFACE) {
|
||||
SurfaceBuilderConfiguration config = world.getBiome(mut).getGenerationSettings()
|
||||
.getSurfaceBuilderConfig();
|
||||
|
|
|
@ -7,8 +7,8 @@ import net.minecraft.core.BlockPos.MutableBlockPos;
|
|||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public abstract class ScatterFeature extends DefaultFeature {
|
||||
|
@ -31,7 +31,7 @@ public abstract class ScatterFeature extends DefaultFeature {
|
|||
protected boolean canSpawn(WorldGenLevel world, BlockPos pos) {
|
||||
if (pos.getY() < 5) {
|
||||
return false;
|
||||
} else if (!world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
|
||||
} else if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -20,7 +21,6 @@ import ru.bclib.sdf.operator.SDFTranslate;
|
|||
import ru.bclib.sdf.primitive.SDFSphere;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -37,8 +37,8 @@ public class BushFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND)
|
||||
&& !world.getBlockState(pos.above()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND)
|
||||
&& !world.getBlockState(pos.above()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float radius = MHelper.randRange(1.8F, 3.5F, random);
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -21,7 +22,6 @@ import ru.bclib.sdf.operator.SDFTranslate;
|
|||
import ru.bclib.sdf.primitive.SDFSphere;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -41,8 +41,8 @@ public class BushWithOuterFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND)
|
||||
&& !world.getBlockState(pos.above()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND)
|
||||
&& !world.getBlockState(pos.above()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float radius = MHelper.randRange(1.8F, 3.5F, random);
|
||||
|
|
|
@ -9,11 +9,11 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class LargeAmaranitaFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
MutableBlockPos mut = new MutableBlockPos().set(pos);
|
||||
|
|
|
@ -9,11 +9,11 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties.LumecornShape;
|
||||
import ru.betterend.blocks.LumecornBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class Lumecorn extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
int height = MHelper.randRange(4, 7, random);
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -27,7 +28,6 @@ import ru.betterend.blocks.BlockProperties.TripleShape;
|
|||
import ru.betterend.blocks.basis.FurBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class TenaneaBushFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float radius = MHelper.randRange(1.8F, 3.5F, random);
|
||||
|
|
|
@ -9,12 +9,12 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFRotation;
|
||||
import ru.bclib.sdf.primitive.SDFHexPrism;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class BigAuroraCrystalFeature extends DefaultFeature {
|
|||
Vector3f vec = MHelper.randomHorizontal(random);
|
||||
prism = new SDFRotation().setRotation(vec, random.nextFloat()).setSource(prism);
|
||||
prism.setReplaceFunction((bState) -> {
|
||||
return bState.getMaterial().isReplaceable() || bState.is(EndTags.GEN_TERRAIN)
|
||||
return bState.getMaterial().isReplaceable() || bState.is(TagAPI.GEN_TERRAIN)
|
||||
|| bState.getMaterial().equals(Material.PLANT) || bState.getMaterial().equals(Material.LEAVES);
|
||||
});
|
||||
prism.fillRecursive(world, pos);
|
||||
|
|
|
@ -11,10 +11,10 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -110,11 +110,11 @@ public class DesertLakeFeature extends DefaultFeature {
|
|||
r *= r;
|
||||
if (x2 + z2 <= r) {
|
||||
state = world.getBlockState(POS);
|
||||
if (state.is(EndTags.GEN_TERRAIN)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN)) {
|
||||
BlocksHelper.setWithoutUpdate(world, POS, AIR);
|
||||
}
|
||||
pos = POS.below();
|
||||
if (world.getBlockState(pos).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
|
||||
state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
|
||||
if (y > waterLevel + 1)
|
||||
BlocksHelper.setWithoutUpdate(world, pos, state);
|
||||
|
@ -162,7 +162,7 @@ public class DesertLakeFeature extends DefaultFeature {
|
|||
BlocksHelper.setWithoutUpdate(world, POS, state);
|
||||
}
|
||||
pos = POS.below();
|
||||
if (world.getBlockState(pos).getBlock().is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos).getBlock().is(TagAPI.GEN_TERRAIN)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
|
||||
}
|
||||
pos = POS.above();
|
||||
|
@ -174,7 +174,7 @@ public class DesertLakeFeature extends DefaultFeature {
|
|||
// Make border
|
||||
else if (y2 + x2 + z2 <= rb) {
|
||||
state = world.getBlockState(POS);
|
||||
if (state.is(EndTags.GEN_TERRAIN) && world.isEmptyBlock(POS.above())) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) && world.isEmptyBlock(POS.above())) {
|
||||
BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.END_MOSS);
|
||||
}
|
||||
else if (y < waterLevel) {
|
||||
|
@ -201,7 +201,7 @@ public class DesertLakeFeature extends DefaultFeature {
|
|||
|
||||
private boolean canReplace(BlockState state) {
|
||||
return state.getMaterial().isReplaceable()
|
||||
|| state.is(EndTags.GEN_TERRAIN)
|
||||
|| state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.is(EndBlocks.ENDSTONE_DUST)
|
||||
|| state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().equals(Material.WATER_PLANT)
|
||||
|
|
|
@ -11,10 +11,10 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -110,11 +110,11 @@ public class EndLakeFeature extends DefaultFeature {
|
|||
r *= r;
|
||||
if (x2 + z2 <= r) {
|
||||
state = world.getBlockState(POS);
|
||||
if (state.is(EndTags.GEN_TERRAIN)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN)) {
|
||||
BlocksHelper.setWithoutUpdate(world, POS, AIR);
|
||||
}
|
||||
pos = POS.below();
|
||||
if (world.getBlockState(pos).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
|
||||
state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
|
||||
if (y > waterLevel + 1)
|
||||
BlocksHelper.setWithoutUpdate(world, pos, state);
|
||||
|
@ -162,7 +162,7 @@ public class EndLakeFeature extends DefaultFeature {
|
|||
BlocksHelper.setWithoutUpdate(world, POS, state);
|
||||
}
|
||||
pos = POS.below();
|
||||
if (world.getBlockState(pos).getBlock().is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos).getBlock().is(TagAPI.GEN_TERRAIN)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
|
||||
}
|
||||
pos = POS.above();
|
||||
|
@ -195,7 +195,7 @@ public class EndLakeFeature extends DefaultFeature {
|
|||
|
||||
private boolean canReplace(BlockState state) {
|
||||
return state.getMaterial().isReplaceable()
|
||||
|| state.is(EndTags.GEN_TERRAIN)
|
||||
|| state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.is(EndBlocks.ENDSTONE_DUST)
|
||||
|| state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().equals(Material.WATER_PLANT)
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFRotation;
|
||||
|
@ -19,16 +20,14 @@ import ru.bclib.sdf.primitive.SDFCappedCone;
|
|||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class FallenPillarFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurface(world,
|
||||
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
|
||||
if (!world.getBlockState(pos.below(5)).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -52,7 +51,7 @@ public class FallenPillarFeature extends DefaultFeature {
|
|||
}
|
||||
return info.getState();
|
||||
}).setReplaceFunction((state) -> {
|
||||
return state.getMaterial().isReplaceable() || state.is(EndTags.GEN_TERRAIN)
|
||||
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.getMaterial().equals(Material.PLANT);
|
||||
}).fillRecursive(world, pos);
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFCoordModify;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -35,7 +36,6 @@ import ru.betterend.blocks.HydrothermalVentBlock;
|
|||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
MutableBlockPos bpos = new MutableBlockPos().set(pos);
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
BlockState state = world.getBlockState(bpos);
|
||||
while (state.is(EndTags.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN)
|
||||
if (state.is(TagAPI.GEN_TERRAIN)
|
||||
&& !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
|
||||
|
@ -221,7 +221,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN)) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
|
||||
mut.setY(mut.getY() + 1);
|
||||
|
@ -252,12 +252,11 @@ public class GeyserFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE1 = (state) -> {
|
||||
return state.isAir() || (state.is(EndTags.GEN_TERRAIN));
|
||||
return state.isAir() || (state.is(TagAPI.GEN_TERRAIN));
|
||||
};
|
||||
|
||||
REPLACE2 = (state) -> {
|
||||
if (state.is(EndTags.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT)
|
||||
|| state.is(EndBlocks.SULPHUR_CRYSTAL)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
|
@ -267,8 +266,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
};
|
||||
|
||||
IGNORE = (state) -> {
|
||||
return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone)
|
||||
|| state.is(EndBlocks.BRIMSTONE);
|
||||
return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state.is(EndBlocks.BRIMSTONE);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -16,7 +17,6 @@ import ru.bclib.sdf.primitive.SDFSphere;
|
|||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class ObsidianBoulderFeature extends DefaultFeature {
|
||||
|
@ -25,7 +25,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
|
|||
NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurface(world,
|
||||
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
private void makeBoulder(WorldGenLevel world, BlockPos pos, Random random) {
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
|
|||
}
|
||||
return info.getState();
|
||||
}).setReplaceFunction((state) -> {
|
||||
return state.getMaterial().isReplaceable() || state.is(EndTags.GEN_TERRAIN)
|
||||
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.getMaterial().equals(Material.PLANT);
|
||||
}).fillRecursive(world, pos);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFRotation;
|
||||
|
@ -21,14 +22,13 @@ import ru.bclib.sdf.primitive.SDFFlatland;
|
|||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class ObsidianPillarBasementFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
|
||||
if (!world.getBlockState(pos.below(5)).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature {
|
|||
}
|
||||
return info.getState();
|
||||
}).setReplaceFunction((state) -> {
|
||||
return state.getMaterial().isReplaceable() || state.is(EndTags.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT);
|
||||
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT);
|
||||
}).fillRecursive(world, pos);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -21,9 +21,8 @@ public class SingleBlockFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.GEN_TERRAIN)) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
|
|||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(crystal.getBlock())) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(crystal.getBlock())) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, crystal);
|
||||
mut.setY(mut.getY() + 1);
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||
|
@ -24,7 +25,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class SpireFeature extends DefaultFeature {
|
||||
|
@ -34,8 +34,8 @@ public class SpireFeature extends DefaultFeature {
|
|||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurfaceWG(world, pos);
|
||||
if (pos.getY() < 10 || !world.getBlockState(pos.below(3)).is(EndTags.GEN_TERRAIN)
|
||||
|| !world.getBlockState(pos.below(6)).is(EndTags.GEN_TERRAIN)) {
|
||||
if (pos.getY() < 10 || !world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN)
|
||||
|| !world.getBlockState(pos.below(6)).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class SpireFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() instanceof LeavesBlock) {
|
||||
|
|
|
@ -11,8 +11,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.basis.StalactiteBlock;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class StalactiteFeature extends DefaultFeature {
|
|||
mut.setY(pos.getY() + i * dir);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (!state.getMaterial().isReplaceable()) {
|
||||
stalagnate = state.is(EndTags.GEN_TERRAIN);
|
||||
stalagnate = state.is(TagAPI.GEN_TERRAIN);
|
||||
height = i;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -16,12 +16,12 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.SulphurCrystalBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
bpos.setY(top - 1);
|
||||
|
||||
BlockState state = world.getBlockState(bpos);
|
||||
while (!state.is(EndTags.GEN_TERRAIN) && bpos.getY() > 5) {
|
||||
while (!state.is(TagAPI.GEN_TERRAIN) && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
}
|
||||
top = (int) (bpos.getY() - (radius * 1.3F + 5));
|
||||
|
||||
while (state.is(EndTags.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
}
|
||||
} else if (dist < r2 * r2) {
|
||||
state = world.getBlockState(mut);
|
||||
if (state.is(EndTags.GEN_TERRAIN) || state.is(Blocks.AIR)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) || state.is(Blocks.AIR)) {
|
||||
double v = noise.eval(x * 0.1, y * 0.1, z * 0.1)
|
||||
+ noise.eval(x * 0.03, y * 0.03, z * 0.03) * 0.5;
|
||||
if (v > 0.4) {
|
||||
|
@ -132,7 +132,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN)
|
||||
if (state.is(TagAPI.GEN_TERRAIN)
|
||||
&& !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
|
||||
|
@ -167,7 +167,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
private boolean isReplaceable(BlockState state) {
|
||||
return state.is(EndTags.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT)
|
||||
return state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT)
|
||||
|| state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state.is(EndBlocks.SULPHUR_CRYSTAL)
|
||||
|| state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().equals(Material.WATER_PLANT) || state.getMaterial().equals(Material.LEAVES);
|
||||
|
|
|
@ -14,12 +14,12 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.SulphurCrystalBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
|
|||
int dist = x2 + z2;
|
||||
if (dist <= r) {
|
||||
POS.setY(getYOnSurface(world, x, z) - 1);
|
||||
if (world.getBlockState(POS).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(POS).is(TagAPI.GEN_TERRAIN)) {
|
||||
if (isBorder(world, POS)) {
|
||||
if (random.nextInt(8) > 0) {
|
||||
brimstone.add(POS.immutable());
|
||||
|
@ -93,7 +93,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
|
|||
brimstone.remove(POS);
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
BlockPos offseted = POS.relative(dir);
|
||||
if (world.getBlockState(offseted).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(offseted).is(TagAPI.GEN_TERRAIN)) {
|
||||
brimstone.add(offseted);
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
|
|||
brimstone.remove(POS);
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
BlockPos offseted = POS.relative(dir);
|
||||
if (world.getBlockState(offseted).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(offseted).is(TagAPI.GEN_TERRAIN)) {
|
||||
brimstone.add(offseted);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
|
|||
}
|
||||
} else if (dist < r2) {
|
||||
POS.setY(getYOnSurface(world, x, z) - 1);
|
||||
if (world.getBlockState(POS).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(POS).is(TagAPI.GEN_TERRAIN)) {
|
||||
brimstone.add(POS.immutable());
|
||||
if (random.nextBoolean()) {
|
||||
brimstone.add(POS.below());
|
||||
|
|
|
@ -8,10 +8,10 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.HydrothermalVentBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -21,26 +21,23 @@ public class SurfaceVentFeature extends DefaultFeature {
|
|||
NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurface(world,
|
||||
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
|
||||
if (!world.getBlockState(pos.below(3)).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MutableBlockPos mut = new MutableBlockPos();
|
||||
int count = MHelper.randRange(15, 30, random);
|
||||
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.WATERLOGGED,
|
||||
false);
|
||||
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.WATERLOGGED, false);
|
||||
for (int i = 0; i < count; i++) {
|
||||
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5,
|
||||
MHelper.floor(random.nextGaussian() * 2 + 0.5));
|
||||
int dist = MHelper.floor(2 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ()))
|
||||
+ random.nextInt(2);
|
||||
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5));
|
||||
int dist = MHelper.floor(2 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2);
|
||||
if (dist > 0) {
|
||||
BlockState state = world.getBlockState(mut);
|
||||
for (int n = 0; n < 10 && state.isAir(); n++) {
|
||||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN)
|
||||
if (state.is(TagAPI.GEN_TERRAIN)
|
||||
&& !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraft.world.level.chunk.ChunkAccess;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.biome.cave.EndCaveBiome;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
@ -28,8 +28,7 @@ public class CaveChunkPopulatorFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
Set<BlockPos> floorPositions = Sets.newHashSet();
|
||||
Set<BlockPos> ceilPositions = Sets.newHashSet();
|
||||
int sx = (pos.getX() >> 4) << 4;
|
||||
|
@ -61,12 +60,13 @@ public class CaveChunkPopulatorFeature extends DefaultFeature {
|
|||
mut.setY(y);
|
||||
BlockState top = chunk.getBlockState(mut);
|
||||
BlockState bottom = chunk.getBlockState(mut2);
|
||||
if (top.isAir() && (bottom.is(EndTags.GEN_TERRAIN) || bottom.is(Blocks.STONE))) {
|
||||
if (top.isAir() && (bottom.is(TagAPI.GEN_TERRAIN) || bottom.is(Blocks.STONE))) {
|
||||
mut3.set(mut2).move(sx, 0, sz);
|
||||
floorPositions.add(mut3.immutable());
|
||||
updateMin(mut3, min);
|
||||
updateMax(mut3, max);
|
||||
} else if (bottom.isAir() && (top.is(EndTags.GEN_TERRAIN) || top.is(Blocks.STONE))) {
|
||||
}
|
||||
else if (bottom.isAir() && (top.is(TagAPI.GEN_TERRAIN) || top.is(Blocks.STONE))) {
|
||||
mut3.set(mut).move(sx, 0, sz);
|
||||
ceilPositions.add(mut3.immutable());
|
||||
updateMin(mut3, min);
|
||||
|
|
|
@ -19,10 +19,10 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.interfaces.IBiomeArray;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
import ru.betterend.world.biome.cave.EndCaveBiome;
|
||||
|
@ -63,11 +63,11 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
|||
mut.set(bpos);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
mut.setY(bpos.getY() - 1);
|
||||
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
|
||||
floorPositions.add(mut.immutable());
|
||||
}
|
||||
mut.setY(bpos.getY() + 1);
|
||||
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
|
||||
ceilPositions.add(mut.immutable());
|
||||
}
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
|||
if (wallBlock != null) {
|
||||
for (Vec3i offset: SPHERE) {
|
||||
BlockPos wallPos = pos.offset(offset);
|
||||
if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos).is(TagAPI.GEN_TERRAIN)) {
|
||||
wallBlock = biome.getWall(wallPos);
|
||||
BlocksHelper.setWithoutUpdate(world, wallPos, wallBlock);
|
||||
placed.add(wallPos);
|
||||
|
@ -164,7 +164,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
|||
bpos.setY(top - 1);
|
||||
|
||||
BlockState state = world.getBlockState(bpos);
|
||||
while (!state.is(EndTags.GEN_TERRAIN) && bpos.getY() > 5) {
|
||||
while (!state.is(TagAPI.GEN_TERRAIN) && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
|||
}
|
||||
top = (int) (bpos.getY() - (radius * 1.3F + 5));
|
||||
|
||||
while (state.is(EndTags.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@ import net.minecraft.core.BlockPos.MutableBlockPos;
|
|||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class RoundCaveFeature extends EndCaveFeature {
|
||||
|
@ -76,7 +76,7 @@ public class RoundCaveFeature extends EndCaveFeature {
|
|||
}
|
||||
|
||||
private boolean isReplaceable(BlockState state) {
|
||||
return state.is(EndTags.GEN_TERRAIN)
|
||||
return state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.getMaterial().isReplaceable()
|
||||
|| state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().equals(Material.LEAVES);
|
||||
|
|
|
@ -18,9 +18,9 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.Heightmap.Types;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.biome.cave.EndCaveBiome;
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class TunelCaveFeature extends EndCaveFeature {
|
|||
float vert = Mth.sin((y + (float) noiseV.eval(x * 0.01, z * 0.01) * 20) * 0.1F) * 0.9F;
|
||||
float dist = (float) noiseD.eval(x * 0.1, y * 0.1, z * 0.1) * 0.12F;
|
||||
vert *= vert;
|
||||
if (val + vert + dist < 0.15 && world.getBlockState(pos).is(EndTags.GEN_TERRAIN) && noWaterNear(world, pos)) {
|
||||
if (val + vert + dist < 0.15 && world.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && noWaterNear(world, pos)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
||||
positions.add(pos.immutable());
|
||||
int height = world.getHeight(Types.WORLD_SURFACE_WG, pos.getX(), pos.getZ());
|
||||
|
@ -115,7 +115,7 @@ public class TunelCaveFeature extends EndCaveFeature {
|
|||
}
|
||||
else if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
mut.setY(bpos.getY() - 1);
|
||||
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
|
||||
Set<BlockPos> floorPositions = floorSets.get(bio);
|
||||
if (floorPositions == null) {
|
||||
floorPositions = Sets.newHashSet();
|
||||
|
@ -124,7 +124,7 @@ public class TunelCaveFeature extends EndCaveFeature {
|
|||
floorPositions.add(mut.immutable());
|
||||
}
|
||||
mut.setY(bpos.getY() + 1);
|
||||
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
|
||||
Set<BlockPos> ceilPositions = ceilSets.get(bio);
|
||||
if (ceilPositions == null) {
|
||||
ceilPositions = Sets.newHashSet();
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -28,7 +29,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(10, 25, random);
|
||||
|
@ -111,7 +111,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSpline(branch, world, EndBlocks.DRAGON_TREE.bark.defaultBlockState(), pos, REPLACE);
|
||||
}
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() == EndBlocks.DRAGON_TREE_LEAVES) {
|
||||
|
|
|
@ -17,13 +17,13 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.blocks.basis.AttachedBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(5, 10, random);
|
||||
|
@ -329,7 +329,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
|
||||
if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFRotation;
|
||||
|
@ -26,7 +27,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.blocks.HelixTreeLeavesBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -25,7 +26,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.blocks.JellyshroomCapBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class JellyshroomFeature extends DefaultFeature {
|
||||
|
@ -35,7 +35,7 @@ public class JellyshroomFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
BlockState bark = EndBlocks.JELLYSHROOM.bark.defaultBlockState();
|
||||
|
@ -89,7 +89,7 @@ public class JellyshroomFeature extends DefaultFeature {
|
|||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSpline(branch, world, wood, pos, REPLACE);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class JellyshroomFeature extends DefaultFeature {
|
|||
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
|
||||
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
|
||||
if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -25,7 +26,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(15, 25, random);
|
||||
|
@ -82,7 +82,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
boolean generate = false;
|
||||
for (int y = minY; y < maxY; y++) {
|
||||
mut.setY(y);
|
||||
if (world.getBlockState(mut).is(EndTags.END_GROUND)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.END_GROUND)) {
|
||||
generate = true;
|
||||
break;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
mut.setY(y);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.is(EndTags.END_GROUND)) {
|
||||
|| state.is(TagAPI.END_GROUND)) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut,
|
||||
y == top ? EndBlocks.LACUGROVE.bark : EndBlocks.LACUGROVE.log);
|
||||
} else {
|
||||
|
@ -180,7 +180,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (EndBlocks.LACUGROVE.isTreeLog(state)) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale;
|
||||
|
@ -30,7 +31,6 @@ import ru.betterend.blocks.BlockProperties.TripleShape;
|
|||
import ru.betterend.blocks.basis.FurBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class LucerniaFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(12, 20, random);
|
||||
|
@ -184,7 +184,7 @@ public class LucerniaFeature extends DefaultFeature {
|
|||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSplineForce(branch, world, EndBlocks.LUCERNIA.bark.defaultBlockState(), pos, REPLACE);
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ public class LucerniaFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() == EndBlocks.LUCERNIA_LEAVES) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFBinary;
|
||||
import ru.bclib.sdf.operator.SDFCoordModify;
|
||||
|
@ -32,7 +33,6 @@ import ru.betterend.blocks.MossyGlowshroomCapBlock;
|
|||
import ru.betterend.blocks.basis.FurBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -86,12 +86,14 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()
|
||||
.setValue(MossyGlowshroomCapBlock.TRANSITION, true));
|
||||
return info.getState();
|
||||
} else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp())
|
||||
}
|
||||
else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp())
|
||||
|| !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) {
|
||||
info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState());
|
||||
return info.getState();
|
||||
}
|
||||
} else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
|
||||
}
|
||||
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
|
||||
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) {
|
||||
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()
|
||||
.setValue(MossyGlowshroomCapBlock.TRANSITION, true));
|
||||
|
@ -100,7 +102,8 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
|
||||
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState());
|
||||
return info.getState();
|
||||
} else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
|
||||
}
|
||||
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
if (info.getState(dir) == AIR) {
|
||||
info.setBlockPos(info.getPos().relative(dir),
|
||||
|
@ -123,8 +126,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
SDFCappedCone cone1 = new SDFCappedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F);
|
||||
SDFCappedCone cone2 = new SDFCappedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F);
|
||||
SDF posedCone2 = new SDFTranslate().setTranslate(0, 5, 0).setSource(cone2);
|
||||
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0)
|
||||
.setSource(new SDFScale().setScale(2).setSource(cone2));
|
||||
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0).setSource(new SDFScale().setScale(2).setSource(cone2));
|
||||
SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3);
|
||||
SDF wave = new SDFFlatWave().setRaysCount(12).setIntensity(1.3F).setSource(upCone);
|
||||
SDF cones = new SDFSmoothUnion().setRadius(3).setSourceA(cone1).setSourceB(wave);
|
||||
|
@ -163,7 +165,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
.setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT));
|
||||
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -26,7 +27,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -36,10 +36,10 @@ public class PythadendronTreeFeature extends DefaultFeature {
|
|||
private static final Function<PosInfo, BlockState> POST;
|
||||
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (world.getBlockState(pos.below()).getBlock() != EndBlocks.CHORUS_NYLIUM)
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
if (world.getBlockState(pos.below()).getBlock() != EndBlocks.CHORUS_NYLIUM) {
|
||||
return false;
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
||||
|
||||
float size = MHelper.randRange(10, 20, random);
|
||||
|
@ -168,7 +168,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() == EndBlocks.PYTHADENDRON_LEAVES) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale;
|
||||
|
@ -30,7 +31,6 @@ import ru.betterend.blocks.BlockProperties.TripleShape;
|
|||
import ru.betterend.blocks.basis.FurBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class TenaneaFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(7, 10, random);
|
||||
|
@ -173,7 +173,7 @@ public class TenaneaFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() == EndBlocks.TENANEA_LEAVES) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||
import ru.bclib.sdf.operator.SDFScale;
|
||||
|
@ -30,7 +31,6 @@ import ru.bclib.util.SplineHelper;
|
|||
import ru.betterend.blocks.UmbrellaTreeClusterBlock;
|
||||
import ru.betterend.blocks.UmbrellaTreeMembraneBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
BlockState wood = EndBlocks.UMBRELLA_TREE.bark.defaultBlockState();
|
||||
|
@ -156,7 +156,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
|
|||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSplineForce(branch, world, wood, pos, REPLACE);
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
|
|||
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
|
||||
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class CavePiece extends BasePiece {
|
||||
|
@ -66,7 +66,7 @@ public class CavePiece extends BasePiece {
|
|||
double r2 = r - 4.5;
|
||||
double dist = xsq + ysq + zsq;
|
||||
if (dist < r2 * r2) {
|
||||
if (world.getBlockState(pos).is(EndTags.END_GROUND)) {
|
||||
if (world.getBlockState(pos).is(TagAPI.END_GROUND)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, CAVE_AIR);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ import net.minecraft.world.level.levelgen.Heightmap;
|
|||
import net.minecraft.world.level.levelgen.Heightmap.Types;
|
||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class CrystalMountainPiece extends MountainPiece {
|
||||
private BlockState top;
|
||||
|
@ -68,7 +68,7 @@ public class CrystalMountainPiece extends MountainPiece {
|
|||
continue;
|
||||
}
|
||||
pos.setY(minY);
|
||||
while (!chunk.getBlockState(pos).is(EndTags.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(pos.below()).is(Blocks.CAVE_AIR)) {
|
||||
while (!chunk.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(pos.below()).is(Blocks.CAVE_AIR)) {
|
||||
pos.setY(pos.getY() - 1);
|
||||
}
|
||||
minY = pos.getY();
|
||||
|
|
|
@ -24,12 +24,12 @@ import net.minecraft.world.level.levelgen.Heightmap.Types;
|
|||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class LakePiece extends BasePiece {
|
||||
|
@ -117,7 +117,7 @@ public class LakePiece extends BasePiece {
|
|||
double dist = x3 + y2 + z3;
|
||||
if (dist < r2) {
|
||||
BlockState state = chunk.getBlockState(mut);
|
||||
if (state.is(EndTags.GEN_TERRAIN) || state.isAir()) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) || state.isAir()) {
|
||||
state = mut.getY() < center.getY() ? WATER : CAVE_AIR;
|
||||
chunk.setBlockState(mut, state, false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue