Tag migration

This commit is contained in:
paulevsGitch 2021-07-21 16:04:24 +03:00
parent 92a392cffe
commit a390486d5b
76 changed files with 224 additions and 164 deletions

View file

@ -2,6 +2,7 @@ package ru.betterend.world.biome.land;
import ru.bclib.world.biomes.BCLBiomeDef;
import ru.betterend.BetterEnd;
import ru.betterend.registry.EndFeatures;
import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.surface.SurfaceBuilders;
@ -13,6 +14,7 @@ public class UmbraValleyBiome extends EndBiome {
.setPlantsColor(200, 200, 200)
.setWaterAndFogColor(69, 104, 134)
.setSurface(SurfaceBuilders.UMBRA_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
.addFeature(EndFeatures.UMBRALITH_ARCH)
);
}
}

View file

@ -18,7 +18,7 @@ public class CavePumpkinFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.above()).is(TagAPI.GEN_TERRAIN) || !world.isEmptyBlock(pos) || !world.isEmptyBlock(
if (!world.getBlockState(pos.above()).is(TagAPI.BLOCK_GEN_TERRAIN) || !world.isEmptyBlock(pos) || !world.isEmptyBlock(
pos.below())) {
return false;
}

View file

@ -49,7 +49,7 @@ public class CrashedShipFeature extends NBTStructureFeature {
if (x * x + z * z < 3600) {
return false;
}
return pos.getY() > 5 && world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN);
return pos.getY() > 5 && world.getBlockState(pos.below()).is(TagAPI.BLOCK_GEN_TERRAIN);
}
@Override

View file

@ -32,7 +32,7 @@ public abstract class ScatterFeature extends DefaultFeature {
if (pos.getY() < 5) {
return false;
}
else if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
else if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) {
return false;
}
return true;

View file

@ -39,8 +39,8 @@ public class BushFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above())
.is(TagAPI.END_GROUND))
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(pos.above())
.is(TagAPI.BLOCK_END_GROUND))
return false;
float radius = MHelper.randRange(1.8F, 3.5F, random);

View file

@ -43,8 +43,8 @@ public class BushWithOuterFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above())
.is(TagAPI.END_GROUND))
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(pos.above())
.is(TagAPI.BLOCK_END_GROUND))
return false;
float radius = MHelper.randRange(1.8F, 3.5F, random);

View file

@ -23,7 +23,7 @@ public class LargeAmaranitaFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
MutableBlockPos mut = new MutableBlockPos().set(pos);
int height = MHelper.randRange(2, 3, random);

View file

@ -23,7 +23,7 @@ public class Lumecorn extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
int height = MHelper.randRange(4, 7, random);
MutableBlockPos mut = new MutableBlockPos().set(pos);

View file

@ -42,7 +42,7 @@ public class TenaneaBushFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
float radius = MHelper.randRange(1.8F, 3.5F, random);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());

View file

@ -0,0 +1,54 @@
package ru.betterend.world.features.terrain;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import ru.bclib.api.TagAPI;
import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFRotation;
import ru.bclib.sdf.primitive.SDFTorus;
import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature;
import ru.betterend.noise.OpenSimplexNoise;
import java.util.Random;
public class ArchFeature extends DefaultFeature {
@Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceContext) {
final WorldGenLevel world = featurePlaceContext.level();
BlockPos origin = featurePlaceContext.origin();
Random random = featurePlaceContext.random();
BlockPos pos = getPosOnSurfaceWG(world, new BlockPos((origin.getX() & 0xFFFFFFF0) | 7, 0, (origin.getZ() & 0xFFFFFFF0) | 7));
if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) {
return false;
}
float bigRadius = MHelper.randRange(10F, 20F, random);
float smallRadius = MHelper.randRange(3F, 7F, random);
if (smallRadius + bigRadius > 23) {
smallRadius = 23 - bigRadius;
}
SDF arch = new SDFTorus().setBigRadius(bigRadius).setSmallRadius(smallRadius).setBlock(Blocks.DIAMOND_BLOCK);
arch = new SDFRotation().setRotation(MHelper.randomHorizontal(random), (float) Math.PI * 0.5F).setSource(arch);
final float smallRadiusF = smallRadius;
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
arch = new SDFDisplacement().setFunction((vec) -> {
return (float) (Math.abs(noise.eval(
vec.x() * 0.1,
vec.y() * 0.1,
vec.z() * 0.1
)) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F) - smallRadiusF * Math.abs(1 - vec.y() / bigRadius);
}).setSource(arch);
arch.fillArea(world, pos, AABB.ofSize(Vec3.atCenterOf(pos), 46, 46, 46));
return true;
}
}

View file

@ -40,7 +40,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(TagAPI.GEN_TERRAIN) || bState.getMaterial()
return bState.getMaterial().isReplaceable() || bState.is(TagAPI.BLOCK_GEN_TERRAIN) || bState.getMaterial()
.equals(Material.PLANT) || bState
.getMaterial()
.equals(Material.LEAVES);

View file

@ -118,11 +118,11 @@ public class DesertLakeFeature extends DefaultFeature {
r *= r;
if (x2 + z2 <= r) {
state = world.getBlockState(POS);
if (state.is(TagAPI.GEN_TERRAIN)) {
if (state.is(TagAPI.BLOCK_GEN_TERRAIN)) {
BlocksHelper.setWithoutUpdate(world, POS, AIR);
}
pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) {
state = world.getBiome(pos)
.getGenerationSettings()
.getSurfaceBuilderConfig()
@ -180,7 +180,7 @@ public class DesertLakeFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, POS, state);
}
pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
}
pos = POS.above();
@ -193,7 +193,7 @@ public class DesertLakeFeature extends DefaultFeature {
// Make border
else if (y2 + x2 + z2 <= rb) {
state = world.getBlockState(POS);
if (state.is(TagAPI.GEN_TERRAIN) && world.isEmptyBlock(POS.above())) {
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && world.isEmptyBlock(POS.above())) {
BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.END_MOSS);
}
else if (y < waterLevel) {
@ -235,7 +235,7 @@ public class DesertLakeFeature extends DefaultFeature {
private boolean canReplace(BlockState state) {
return state.getMaterial()
.isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial()
.isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial()
.equals(
Material.PLANT) || state
.getMaterial()

View file

@ -118,11 +118,11 @@ public class EndLakeFeature extends DefaultFeature {
r *= r;
if (x2 + z2 <= r) {
state = world.getBlockState(POS);
if (state.is(TagAPI.GEN_TERRAIN)) {
if (state.is(TagAPI.BLOCK_GEN_TERRAIN)) {
BlocksHelper.setWithoutUpdate(world, POS, AIR);
}
pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) {
state = world.getBiome(pos)
.getGenerationSettings()
.getSurfaceBuilderConfig()
@ -180,7 +180,7 @@ public class EndLakeFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, POS, state);
}
pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
}
pos = POS.above();
@ -225,7 +225,7 @@ public class EndLakeFeature extends DefaultFeature {
private boolean canReplace(BlockState state) {
return state.getMaterial()
.isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial()
.isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial()
.equals(
Material.PLANT) || state
.getMaterial()

View file

@ -31,7 +31,7 @@ public class FallenPillarFeature extends DefaultFeature {
world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
);
if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) {
if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) {
return false;
}
@ -57,7 +57,7 @@ public class FallenPillarFeature extends DefaultFeature {
}
return info.getState();
}).setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial()
return state.getMaterial().isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial()
.equals(Material.PLANT);
}).fillRecursive(world, pos);

View file

@ -60,7 +60,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(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
while (state.is(TagAPI.BLOCK_GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos);
}
@ -194,7 +194,7 @@ public class GeyserFeature extends DefaultFeature {
mut.setY(mut.getY() - 1);
state = world.getBlockState(mut);
}
if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
if (state.is(TagAPI.BLOCK_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);
MHelper.shuffle(HORIZONTAL, random);
@ -239,7 +239,7 @@ public class GeyserFeature extends DefaultFeature {
mut.setY(mut.getY() - 1);
state = world.getBlockState(mut);
}
if (state.is(TagAPI.GEN_TERRAIN)) {
if (state.is(TagAPI.BLOCK_GEN_TERRAIN)) {
for (int j = 0; j <= dist; j++) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
mut.setY(mut.getY() + 1);
@ -271,11 +271,11 @@ public class GeyserFeature extends DefaultFeature {
static {
REPLACE1 = (state) -> {
return state.isAir() || (state.is(TagAPI.GEN_TERRAIN));
return state.isAir() || (state.is(TagAPI.BLOCK_GEN_TERRAIN));
};
REPLACE2 = (state) -> {
if (state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) {
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) {
return true;
}
if (state.getMaterial().equals(Material.PLANT)) {

View file

@ -29,7 +29,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
);
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) {
return false;
}
@ -46,7 +46,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
}
private void makeBoulder(WorldGenLevel world, BlockPos pos, Random random) {
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) {
return;
}
@ -68,7 +68,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
}
return info.getState();
}).setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial()
return state.getMaterial().isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial()
.equals(Material.PLANT);
}).fillRecursive(world, pos);
}

View file

@ -33,7 +33,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature {
world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
);
if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) {
if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) {
return false;
}
@ -64,7 +64,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature {
}
return info.getState();
}).setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial()
return state.getMaterial().isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial()
.equals(Material.PLANT);
}).fillRecursive(world, pos);

View file

@ -25,7 +25,7 @@ public class SingleBlockFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN)) {
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_GEN_TERRAIN)) {
return false;
}

View file

@ -21,7 +21,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN)) {
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_GEN_TERRAIN)) {
return false;
}
@ -42,7 +42,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
mut.setY(mut.getY() - 1);
state = world.getBlockState(mut);
}
if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(crystal.getBlock())) {
if (state.is(TagAPI.BLOCK_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);

View file

@ -39,8 +39,8 @@ public class SpireFeature extends DefaultFeature {
final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator();
pos = getPosOnSurfaceWG(world, pos);
if (pos.getY() < 10 || !world.getBlockState(pos.below(3))
.is(TagAPI.GEN_TERRAIN) || !world.getBlockState(pos.below(6))
.is(TagAPI.GEN_TERRAIN)) {
.is(TagAPI.BLOCK_GEN_TERRAIN) || !world.getBlockState(pos.below(6))
.is(TagAPI.BLOCK_GEN_TERRAIN)) {
return false;
}
@ -95,7 +95,7 @@ public class SpireFeature extends DefaultFeature {
static {
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND)) {
if (state.is(TagAPI.BLOCK_END_GROUND)) {
return true;
}
if (state.getBlock() instanceof LeavesBlock) {

View file

@ -45,7 +45,7 @@ public class StalactiteFeature extends DefaultFeature {
mut.setY(pos.getY() + i * dir);
BlockState state = world.getBlockState(mut);
if (!state.getMaterial().isReplaceable()) {
stalagnate = state.is(TagAPI.GEN_TERRAIN);
stalagnate = state.is(TagAPI.BLOCK_GEN_TERRAIN);
height = i;
break;
}

View file

@ -44,7 +44,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
bpos.setY(top - 1);
BlockState state = world.getBlockState(bpos);
while (!state.is(TagAPI.GEN_TERRAIN) && bpos.getY() > 5) {
while (!state.is(TagAPI.BLOCK_GEN_TERRAIN) && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos);
}
@ -53,7 +53,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
}
top = (int) (bpos.getY() - (radius * 1.3F + 5));
while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
while (state.is(TagAPI.BLOCK_GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos);
}
@ -105,7 +105,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
}
else if (dist < r2 * r2) {
state = world.getBlockState(mut);
if (state.is(TagAPI.GEN_TERRAIN) || state.is(Blocks.AIR)) {
if (state.is(TagAPI.BLOCK_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,
@ -144,7 +144,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
mut.setY(mut.getY() - 1);
state = world.getBlockState(mut);
}
if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above())
if (state.is(TagAPI.BLOCK_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);
@ -183,7 +183,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
}
private boolean isReplaceable(BlockState state) {
return state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state
return state.is(TagAPI.BLOCK_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()

View file

@ -61,7 +61,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(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(POS).is(TagAPI.BLOCK_GEN_TERRAIN)) {
if (isBorder(world, POS)) {
if (random.nextInt(8) > 0) {
brimstone.add(POS.immutable());
@ -97,7 +97,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
brimstone.remove(POS);
for (Direction dir : BlocksHelper.HORIZONTAL) {
BlockPos offseted = POS.relative(dir);
if (world.getBlockState(offseted).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(offseted).is(TagAPI.BLOCK_GEN_TERRAIN)) {
brimstone.add(offseted);
}
}
@ -106,7 +106,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
brimstone.remove(POS);
for (Direction dir : BlocksHelper.HORIZONTAL) {
BlockPos offseted = POS.relative(dir);
if (world.getBlockState(offseted).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(offseted).is(TagAPI.BLOCK_GEN_TERRAIN)) {
brimstone.add(offseted);
}
}
@ -123,7 +123,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
}
else if (dist < r2) {
POS.setY(getYOnSurface(world, x, z) - 1);
if (world.getBlockState(POS).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(POS).is(TagAPI.BLOCK_GEN_TERRAIN)) {
brimstone.add(POS.immutable());
if (random.nextBoolean()) {
brimstone.add(POS.below());

View file

@ -25,7 +25,7 @@ public class SurfaceVentFeature extends DefaultFeature {
world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
);
if (!world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN)) {
if (!world.getBlockState(pos.below(3)).is(TagAPI.BLOCK_GEN_TERRAIN)) {
return false;
}
@ -46,7 +46,7 @@ public class SurfaceVentFeature extends DefaultFeature {
mut.setY(mut.getY() - 1);
state = world.getBlockState(mut);
}
if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
if (state.is(TagAPI.BLOCK_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);
mut.setY(mut.getY() + 1);

View file

@ -62,13 +62,13 @@ public class CaveChunkPopulatorFeature extends DefaultFeature {
mut.setY(y);
BlockState top = chunk.getBlockState(mut);
BlockState bottom = chunk.getBlockState(mut2);
if (top.isAir() && (bottom.is(TagAPI.GEN_TERRAIN) || bottom.is(Blocks.STONE))) {
if (top.isAir() && (bottom.is(TagAPI.BLOCK_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(TagAPI.GEN_TERRAIN) || top.is(Blocks.STONE))) {
else if (bottom.isAir() && (top.is(TagAPI.BLOCK_GEN_TERRAIN) || top.is(Blocks.STONE))) {
mut3.set(mut).move(sx, 0, sz);
ceilPositions.add(mut3.immutable());
updateMin(mut3, min);

View file

@ -65,11 +65,11 @@ public abstract class EndCaveFeature extends DefaultFeature {
caveBlocks.parallelStream().forEach((bpos) -> {
if (world.getBlockState(bpos).getMaterial().isReplaceable()) {
BlockPos side = bpos.below();
if (world.getBlockState(side).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(side).is(TagAPI.BLOCK_GEN_TERRAIN)) {
floorPositions.add(side);
}
side = bpos.above();
if (world.getBlockState(side).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(side).is(TagAPI.BLOCK_GEN_TERRAIN)) {
ceilPositions.add(side);
}
}
@ -130,7 +130,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
for (Vec3i offset : SPHERE) {
BlockPos wallPos = pos.offset(offset);
if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos)
.is(TagAPI.GEN_TERRAIN)) {
.is(TagAPI.BLOCK_GEN_TERRAIN)) {
wallBlock = biome.getWall(wallPos);
BlocksHelper.setWithoutUpdate(world, wallPos, wallBlock);
placed.add(wallPos);
@ -170,7 +170,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
bpos.setY(top - 1);
BlockState state = world.getBlockState(bpos);
while (!state.is(TagAPI.GEN_TERRAIN) && bpos.getY() > 5) {
while (!state.is(TagAPI.BLOCK_GEN_TERRAIN) && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos);
}
@ -179,7 +179,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
}
top = (int) (bpos.getY() - (radius * 1.3F + 5));
while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
while (state.is(TagAPI.BLOCK_GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos);
}

View file

@ -74,7 +74,7 @@ public class RoundCaveFeature extends EndCaveFeature {
}
private boolean isReplaceable(BlockState state) {
return state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().isReplaceable() || state.getMaterial()
return state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial().isReplaceable() || state.getMaterial()
.equals(Material.PLANT) || state
.getMaterial()
.equals(Material.LEAVES);

View file

@ -80,7 +80,7 @@ public class TunelCaveFeature extends EndCaveFeature {
) * 20) * 0.1F) * 0.9F;
float dist = (float) noiseD.eval(pos.getX() * 0.1, y * 0.1, pos.getZ() * 0.1) * 0.12F;
val = (val + vert * vert + dist) + density + gradient;
if (val < 0.15 && world.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && noWaterNear(world, pos)) {
if (val < 0.15 && world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN) && noWaterNear(world, pos)) {
positions.add(pos.immutable());
}
}
@ -139,7 +139,7 @@ public class TunelCaveFeature extends EndCaveFeature {
}
else if (world.getBlockState(mut).getMaterial().isReplaceable()) {
mut.setY(bpos.getY() - 1);
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(mut).is(TagAPI.BLOCK_GEN_TERRAIN)) {
Set<BlockPos> floorPositions = floorSets.get(bio);
if (floorPositions == null) {
floorPositions = Sets.newHashSet();
@ -148,7 +148,7 @@ public class TunelCaveFeature extends EndCaveFeature {
floorPositions.add(mut.immutable());
}
mut.setY(bpos.getY() + 1);
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(mut).is(TagAPI.BLOCK_GEN_TERRAIN)) {
Set<BlockPos> ceilPositions = ceilSets.get(bio);
if (ceilPositions == null) {
ceilPositions = Sets.newHashSet();

View file

@ -45,7 +45,7 @@ public class DragonTreeFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
float size = MHelper.randRange(10, 25, random);
List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 6);
@ -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(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.BLOCK_GEN_TERRAIN)) {
SplineHelper.fillSpline(branch, world, EndBlocks.DRAGON_TREE.bark.defaultBlockState(), pos, REPLACE);
}
}
@ -195,7 +195,7 @@ public class DragonTreeFeature extends DefaultFeature {
static {
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND)) {
if (state.is(TagAPI.BLOCK_END_GROUND)) {
return true;
}
if (state.getBlock() == EndBlocks.DRAGON_TREE_LEAVES) {

View file

@ -36,7 +36,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
float size = MHelper.randRange(5, 10, random);
List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 5);
@ -361,7 +361,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
static {
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
if (state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
return true;
}
return state.getMaterial().isReplaceable();

View file

@ -37,7 +37,7 @@ public class HelixTreeFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
BlocksHelper.setWithoutUpdate(world, pos, AIR);
float angle = random.nextFloat() * MHelper.PI2;

View file

@ -36,7 +36,7 @@ public class JellyshroomFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
BlockState bark = EndBlocks.JELLYSHROOM.bark.defaultBlockState();
BlockState membrane = EndBlocks.JELLYSHROOM_CAP_PURPLE.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(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.BLOCK_GEN_TERRAIN)) {
SplineHelper.fillSpline(branch, world, wood, pos, REPLACE);
}
}
@ -122,7 +122,7 @@ public class JellyshroomFeature extends DefaultFeature {
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
if (state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
return true;
}
return state.getMaterial().isReplaceable();

View file

@ -38,7 +38,7 @@ public class LacugroveFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
float size = MHelper.randRange(15, 25, random);
List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 6);
@ -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(TagAPI.END_GROUND)) {
if (world.getBlockState(mut).is(TagAPI.BLOCK_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(TagAPI.END_GROUND)) {
.equals(Material.PLANT) || state.is(TagAPI.BLOCK_END_GROUND)) {
BlocksHelper.setWithoutUpdate(
world,
mut,
@ -188,7 +188,7 @@ public class LacugroveFeature extends DefaultFeature {
static {
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND)) {
if (state.is(TagAPI.BLOCK_END_GROUND)) {
return true;
}
if (EndBlocks.LACUGROVE.isTreeLog(state)) {

View file

@ -46,7 +46,7 @@ public class LucerniaFeature extends DefaultFeature {
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
final NoneFeatureConfiguration config = featureConfig.config();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
float size = MHelper.randRange(12, 20, random);
int count = (int) (size * 0.3F);
@ -186,7 +186,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(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.BLOCK_GEN_TERRAIN)) {
SplineHelper.fillSplineForce(branch, world, EndBlocks.LUCERNIA.bark.defaultBlockState(), pos, REPLACE);
}
}
@ -194,7 +194,7 @@ public class LucerniaFeature extends DefaultFeature {
static {
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND)) {
if (state.is(TagAPI.BLOCK_END_GROUND)) {
return true;
}
if (state.getBlock() == EndBlocks.LUCERNIA_LEAVES) {

View file

@ -172,7 +172,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
.setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT));
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND)) {
if (state.is(TagAPI.BLOCK_END_GROUND)) {
return true;
}
if (state.getMaterial().equals(Material.PLANT)) {

View file

@ -188,7 +188,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
static {
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND)) {
if (state.is(TagAPI.BLOCK_END_GROUND)) {
return true;
}
if (state.getBlock() == EndBlocks.PYTHADENDRON_LEAVES) {

View file

@ -44,7 +44,7 @@ public class TenaneaFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
float size = MHelper.randRange(7, 10, random);
int count = (int) (size * 0.45F);
@ -175,7 +175,7 @@ public class TenaneaFeature extends DefaultFeature {
static {
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND)) {
if (state.is(TagAPI.BLOCK_END_GROUND)) {
return true;
}
if (state.getBlock() == EndBlocks.TENANEA_LEAVES) {

View file

@ -44,7 +44,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
final NoneFeatureConfiguration config = featureConfig.config();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false;
BlockState wood = EndBlocks.UMBRELLA_TREE.bark.defaultBlockState();
BlockState membrane = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState()
@ -161,7 +161,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(TagAPI.GEN_TERRAIN)) {
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.BLOCK_GEN_TERRAIN)) {
SplineHelper.fillSplineForce(branch, world, wood, pos, REPLACE);
}
}
@ -220,7 +220,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND) || state.getMaterial()
if (state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial()
.equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) {
return true;
}

View file

@ -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(TagAPI.END_GROUND)) {
if (world.getBlockState(pos).is(TagAPI.BLOCK_END_GROUND)) {
BlocksHelper.setWithoutUpdate(world, pos, CAVE_AIR);
}
}

View file

@ -68,7 +68,7 @@ public class CrystalMountainPiece extends MountainPiece {
continue;
}
pos.setY(minY);
while (!chunk.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(
while (!chunk.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(
pos.below()).is(Blocks.CAVE_AIR)) {
pos.setY(pos.getY() - 1);
}

View file

@ -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(TagAPI.GEN_TERRAIN) || state.isAir()) {
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.isAir()) {
state = mut.getY() < center.getY() ? WATER : CAVE_AIR;
chunk.setBlockState(mut, state, false);
}