Void roots fixes
This commit is contained in:
parent
2f31dad5a2
commit
d3faca6016
5 changed files with 4 additions and 22 deletions
|
@ -8,7 +8,6 @@ import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
|||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import ru.betterend.blocks.EternalPedestal;
|
||||
import ru.betterend.blocks.entities.EternalPedestalEntity;
|
||||
import ru.betterend.client.render.BeamRenderer;
|
||||
|
|
|
@ -2,7 +2,6 @@ package ru.betterend.blocks.entities.render;
|
|||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
|
@ -15,7 +14,6 @@ import net.minecraft.client.util.math.Vector3f;
|
|||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
|
||||
import ru.betterend.blocks.basis.BlockPedestal;
|
||||
import ru.betterend.blocks.entities.PedestalBlockEntity;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package ru.betterend.registry;
|
|||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry;
|
||||
|
||||
import ru.betterend.blocks.entities.render.EndChestBlockEntityRenderer;
|
||||
import ru.betterend.blocks.entities.render.EndSignBlockEntityRenderer;
|
||||
import ru.betterend.blocks.entities.render.EternalPedestalBlockEntityRenderer;
|
||||
|
|
|
@ -13,7 +13,6 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.BlockPos.Mutable;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.sdf.SDF;
|
||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
||||
import ru.betterend.util.sdf.primitive.SDFLine;
|
||||
|
@ -88,22 +87,6 @@ public class SplineHelper {
|
|||
return true;
|
||||
}
|
||||
|
||||
public static boolean fillSplineRoot(List<Vector3f> spline, StructureWorldAccess world, BlockState state, BlockPos pos, Function<BlockState, Boolean> replace) {
|
||||
Vector3f startPos = spline.get(0);
|
||||
for (int i = 1; i < spline.size(); i++) {
|
||||
Vector3f endPos = spline.get(i);
|
||||
if (i > 3 && !world.getBlockState(pos.add(endPos.getX(), endPos.getY(), endPos.getZ())).isIn(EndTags.END_GROUND)) {
|
||||
return false;
|
||||
}
|
||||
if (!(fillLine(startPos, endPos, world, state, pos, replace))) {
|
||||
return false;
|
||||
}
|
||||
startPos = endPos;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean fillLine(Vector3f start, Vector3f end, StructureWorldAccess world, BlockState state, BlockPos pos, Function<BlockState, Boolean> replace) {
|
||||
float dx = end.getX() - start.getX();
|
||||
float dy = end.getY() - start.getY();
|
||||
|
|
|
@ -108,7 +108,10 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
List<Vector3f> branch = SplineHelper.copySpline(ROOT);
|
||||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
SplineHelper.fillSplineRoot(branch, world, EndBlocks.DRAGON_TREE.bark.getDefaultState(), pos, REPLACE);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.add(last.getX(), last.getY(), last.getZ())).isIn(EndTags.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSpline(branch, world, EndBlocks.DRAGON_TREE.bark.getDefaultState(), pos, REPLACE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue