Tag switching (WIP)

This commit is contained in:
paulevsGitch 2021-05-26 17:13:36 +03:00
parent 0486d7d89c
commit 41df84404b
72 changed files with 303 additions and 628 deletions

View file

@ -16,6 +16,7 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.AABB;
import ru.bclib.api.TagAPI;
import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFSubtraction;
@ -26,7 +27,6 @@ import ru.bclib.util.MHelper;
import ru.bclib.util.SplineHelper;
import ru.betterend.integration.Integrations;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndTags;
import ru.betterend.world.features.DefaultFeature;
public class OldBulbisTreeFeature extends DefaultFeature {
@ -38,9 +38,9 @@ public class OldBulbisTreeFeature 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;
if (!world.getBlockState(pos.below(4)).getBlock().is(EndTags.GEN_TERRAIN))
if (!world.getBlockState(pos.below(4)).getBlock().is(TagAPI.GEN_TERRAIN))
return false;
BlockState stem = Integrations.BYG.getDefaultState("bulbis_stem");
@ -50,7 +50,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight");
Function<BlockState, Boolean> replacement = (state) -> {
if (state.equals(stem) || state.equals(wood) || state.is(EndTags.END_GROUND)
if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND)
|| state.getMaterial().equals(Material.PLANT)) {
return true;
}
@ -159,7 +159,7 @@ public class OldBulbisTreeFeature 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, replacement);
}
}