Removed SDF, fixes
This commit is contained in:
parent
27e077ddd0
commit
84e35f6a86
74 changed files with 232 additions and 1515 deletions
|
@ -41,7 +41,7 @@ dependencies {
|
||||||
|
|
||||||
useOptional "me.shedaniel:RoughlyEnoughItems:${project.rei_version}"
|
useOptional "me.shedaniel:RoughlyEnoughItems:${project.rei_version}"
|
||||||
useOptional "me.shedaniel:RoughlyEnoughItems-api:${project.rei_version}"
|
useOptional "me.shedaniel:RoughlyEnoughItems-api:${project.rei_version}"
|
||||||
useOptional "grondag:canvas-mc116:${project.canvas_version}"
|
//useOptional "grondag:canvas-mc116:${project.canvas_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
def useOptional(String dep) {
|
def useOptional(String dep) {
|
||||||
|
|
|
@ -84,12 +84,12 @@ public class ChandelierBlock extends AttachedBlock implements IRenderTypeable, B
|
||||||
rotation = BlockModelRotation.X0_Y180;
|
rotation = BlockModelRotation.X0_Y180;
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case WEST:
|
||||||
default:
|
|
||||||
rotation = BlockModelRotation.X0_Y90;
|
rotation = BlockModelRotation.X0_Y90;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
|
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + state);
|
||||||
"block/" + stateId.getPath() + state);
|
|
||||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||||
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
|
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,8 +115,7 @@ public class EndBarrelBlock extends BarrelBlock implements BlockModelProvider {
|
||||||
@Override
|
@Override
|
||||||
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||||
String open = blockState.getValue(OPEN) ? "_open" : "";
|
String open = blockState.getValue(OPEN) ? "_open" : "";
|
||||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
|
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + open);
|
||||||
"block/" + stateId.getPath() + open);
|
|
||||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||||
Direction facing = blockState.getValue(FACING);
|
Direction facing = blockState.getValue(FACING);
|
||||||
BlockModelRotation rotation = BlockModelRotation.X0_Y0;
|
BlockModelRotation rotation = BlockModelRotation.X0_Y0;
|
||||||
|
@ -125,8 +124,8 @@ public class EndBarrelBlock extends BarrelBlock implements BlockModelProvider {
|
||||||
case EAST: rotation = BlockModelRotation.X90_Y90; break;
|
case EAST: rotation = BlockModelRotation.X90_Y90; break;
|
||||||
case SOUTH: rotation = BlockModelRotation.X90_Y180; break;
|
case SOUTH: rotation = BlockModelRotation.X90_Y180; break;
|
||||||
case WEST: rotation = BlockModelRotation.X90_Y270; break;
|
case WEST: rotation = BlockModelRotation.X90_Y270; break;
|
||||||
case DOWN:
|
case DOWN: rotation = BlockModelRotation.X180_Y0; break;
|
||||||
default: rotation = BlockModelRotation.X180_Y0; break;
|
default: break;
|
||||||
}
|
}
|
||||||
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
|
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,23 +56,22 @@ public abstract class EndButtonBlock extends ButtonBlock implements BlockModelPr
|
||||||
@Override
|
@Override
|
||||||
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||||
String powered = blockState.getValue(POWERED) ? "_powered" : "";
|
String powered = blockState.getValue(POWERED) ? "_powered" : "";
|
||||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
|
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + powered);
|
||||||
"block/" + stateId.getPath() + powered);
|
|
||||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||||
AttachFace face = blockState.getValue(FACE);
|
AttachFace face = blockState.getValue(FACE);
|
||||||
boolean isCeiling = face == AttachFace.CEILING;
|
boolean isCeiling = face == AttachFace.CEILING;
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
switch (face) {
|
switch (face) {
|
||||||
case CEILING: x = 180; break;
|
case CEILING: x = 180; break;
|
||||||
case WALL:
|
case WALL: x = 90; break;
|
||||||
default: x = 90; break;
|
default: break;
|
||||||
}
|
}
|
||||||
switch (blockState.getValue(FACING)) {
|
switch (blockState.getValue(FACING)) {
|
||||||
case NORTH: if (isCeiling) { y = 180; } break;
|
case NORTH: if (isCeiling) { y = 180; } break;
|
||||||
case EAST: y = isCeiling ? 270 : 90; break;
|
case EAST: y = isCeiling ? 270 : 90; break;
|
||||||
case SOUTH: if(!isCeiling) { y = 180; } break;
|
case SOUTH: if(!isCeiling) { y = 180; } break;
|
||||||
case WEST:
|
case WEST: y = isCeiling ? 90 : 270; break;
|
||||||
default: y = isCeiling ? 90 : 270; break;
|
default: break;
|
||||||
}
|
}
|
||||||
BlockModelRotation rotation = BlockModelRotation.by(x, y);
|
BlockModelRotation rotation = BlockModelRotation.by(x, y);
|
||||||
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), face == AttachFace.WALL);
|
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), face == AttachFace.WALL);
|
||||||
|
|
|
@ -58,9 +58,10 @@ public class EndDoorBlock extends DoorBlock implements IRenderTypeable, BlockMod
|
||||||
pattern = Patterns.createJson(Patterns.BLOCK_DOOR_BOTTOM_HINGE, blockName, blockName);
|
pattern = Patterns.createJson(Patterns.BLOCK_DOOR_BOTTOM_HINGE, blockName, blockName);
|
||||||
break;
|
break;
|
||||||
case TOP:
|
case TOP:
|
||||||
default:
|
|
||||||
pattern = Patterns.createJson(Patterns.BLOCK_DOOR_TOP, blockName, blockName);
|
pattern = Patterns.createJson(Patterns.BLOCK_DOOR_TOP, blockName, blockName);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return ModelsHelper.fromPattern(pattern);
|
return ModelsHelper.fromPattern(pattern);
|
||||||
}
|
}
|
||||||
|
@ -76,34 +77,40 @@ public class EndDoorBlock extends DoorBlock implements IRenderTypeable, BlockMod
|
||||||
case EAST:
|
case EAST:
|
||||||
if (hinge && open) {
|
if (hinge && open) {
|
||||||
rotation = BlockModelRotation.X0_Y90;
|
rotation = BlockModelRotation.X0_Y90;
|
||||||
} else if (open) {
|
}
|
||||||
|
else if (open) {
|
||||||
rotation = BlockModelRotation.X0_Y270;
|
rotation = BlockModelRotation.X0_Y270;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
if (!hinge && !open || hinge && !open) {
|
if (!hinge && !open || hinge && !open) {
|
||||||
rotation = BlockModelRotation.X0_Y90;
|
rotation = BlockModelRotation.X0_Y90;
|
||||||
} else if (hinge) {
|
}
|
||||||
|
else if (hinge) {
|
||||||
rotation = BlockModelRotation.X0_Y180;
|
rotation = BlockModelRotation.X0_Y180;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case WEST:
|
||||||
if (!hinge && !open || hinge && !open) {
|
if (!hinge && !open || hinge && !open) {
|
||||||
rotation = BlockModelRotation.X0_Y180;
|
rotation = BlockModelRotation.X0_Y180;
|
||||||
} else if (hinge) {
|
}
|
||||||
|
else if (hinge) {
|
||||||
rotation = BlockModelRotation.X0_Y270;
|
rotation = BlockModelRotation.X0_Y270;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
rotation = BlockModelRotation.X0_Y90;
|
rotation = BlockModelRotation.X0_Y90;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NORTH:
|
case NORTH:
|
||||||
default:
|
|
||||||
if (!hinge && !open || hinge && !open) {
|
if (!hinge && !open || hinge && !open) {
|
||||||
rotation = BlockModelRotation.X0_Y270;
|
rotation = BlockModelRotation.X0_Y270;
|
||||||
} else if (!hinge) {
|
}
|
||||||
|
else if (!hinge) {
|
||||||
rotation = BlockModelRotation.X0_Y180;
|
rotation = BlockModelRotation.X0_Y180;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
|
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
|
||||||
"block/" + stateId.getPath() + "_" + doorType);
|
"block/" + stateId.getPath() + "_" + doorType);
|
||||||
|
@ -130,10 +137,7 @@ public class EndDoorBlock extends DoorBlock implements IRenderTypeable, BlockMod
|
||||||
}
|
}
|
||||||
|
|
||||||
protected enum DoorType implements StringRepresentable {
|
protected enum DoorType implements StringRepresentable {
|
||||||
BOTTOM_HINGE("bottom_hinge"),
|
BOTTOM_HINGE("bottom_hinge"), TOP_HINGE("top_hinge"), BOTTOM("bottom"), TOP("top");
|
||||||
TOP_HINGE("top_hinge"),
|
|
||||||
BOTTOM("bottom"),
|
|
||||||
TOP("top");
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,7 @@ public class EndPillarBlock extends RotatedPillarBlock implements BlockModelProv
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(),
|
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath());
|
||||||
"block/" + stateId.getPath());
|
|
||||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||||
return ModelsHelper.createRotatedModel(modelId, blockState.getValue(AXIS));
|
return ModelsHelper.createRotatedModel(modelId, blockState.getValue(AXIS));
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,12 +69,10 @@ public class EndStairsBlock extends StairBlock implements BlockModelProvider {
|
||||||
StairsShape shape = blockState.getValue(SHAPE);
|
StairsShape shape = blockState.getValue(SHAPE);
|
||||||
switch (shape) {
|
switch (shape) {
|
||||||
case INNER_LEFT:
|
case INNER_LEFT:
|
||||||
case INNER_RIGHT:
|
case INNER_RIGHT: state = "_inner"; break;
|
||||||
state = "_inner"; break;
|
|
||||||
case OUTER_LEFT:
|
case OUTER_LEFT:
|
||||||
case OUTER_RIGHT:
|
case OUTER_RIGHT: state = "_outer"; break;
|
||||||
default:
|
default: break;
|
||||||
state = "_outer"; break;
|
|
||||||
}
|
}
|
||||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + state);
|
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + state);
|
||||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||||
|
@ -100,9 +98,9 @@ public class EndStairsBlock extends StairBlock implements BlockModelProvider {
|
||||||
else if (!isLeft) y = 90;
|
else if (!isLeft) y = 90;
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case WEST:
|
||||||
default:
|
|
||||||
y = (isTop && isRight) ? 270 : (!isTop && isLeft) ? 90 : 180;
|
y = (isTop && isRight) ? 270 : (!isTop && isLeft) ? 90 : 180;
|
||||||
break;
|
break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
BlockModelRotation rotation = BlockModelRotation.by(x, y);
|
BlockModelRotation rotation = BlockModelRotation.by(x, y);
|
||||||
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), true);
|
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), true);
|
||||||
|
|
|
@ -77,9 +77,9 @@ public class EndTrapdoorBlock extends TrapDoorBlock implements IRenderTypeable,
|
||||||
y = (isTop && isOpen) ? 0 : 180;
|
y = (isTop && isOpen) ? 0 : 180;
|
||||||
break;
|
break;
|
||||||
case WEST:
|
case WEST:
|
||||||
default:
|
|
||||||
y = (isTop && isOpen) ? 90 : 270;
|
y = (isTop && isOpen) ? 90 : 270;
|
||||||
break;
|
break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
BlockModelRotation rotation = BlockModelRotation.by(x, y);
|
BlockModelRotation rotation = BlockModelRotation.by(x, y);
|
||||||
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
|
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
|
||||||
|
|
|
@ -361,9 +361,9 @@ public class PedestalBlock extends BlockBaseNotFull implements EntityBlock {
|
||||||
pattern = Patterns.createJson(Patterns.BLOCK_PEDESTAL_BOTTOM, textures);
|
pattern = Patterns.createJson(Patterns.BLOCK_PEDESTAL_BOTTOM, textures);
|
||||||
break;
|
break;
|
||||||
case PILLAR:
|
case PILLAR:
|
||||||
default:
|
|
||||||
pattern = Patterns.createJson(Patterns.BLOCK_PEDESTAL_PILLAR, textures);
|
pattern = Patterns.createJson(Patterns.BLOCK_PEDESTAL_PILLAR, textures);
|
||||||
break;
|
break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
return ModelsHelper.fromPattern(pattern);
|
return ModelsHelper.fromPattern(pattern);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,8 @@ public class ModelsHelper {
|
||||||
BlockModelRotation rotation = BlockModelRotation.X0_Y0;
|
BlockModelRotation rotation = BlockModelRotation.X0_Y0;
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
case X: rotation = BlockModelRotation.X90_Y90; break;
|
case X: rotation = BlockModelRotation.X90_Y90; break;
|
||||||
case Z: default: rotation = BlockModelRotation.X90_Y0; break;
|
case Z: rotation = BlockModelRotation.X90_Y0; break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
return createMultiVariant(resourceLocation, rotation.getRotation(), false);
|
return createMultiVariant(resourceLocation, rotation.getRotation(), false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,11 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.integration.Integrations;
|
import ru.betterend.integration.Integrations;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class BigEtherTreeFeature extends DefaultFeature {
|
public class BigEtherTreeFeature extends DefaultFeature {
|
||||||
|
|
|
@ -17,18 +17,18 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.PosInfo;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.integration.Integrations;
|
import ru.betterend.integration.Integrations;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.PosInfo;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFFlatWave;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class GreatNightshadeTreeFeature extends DefaultFeature {
|
public class GreatNightshadeTreeFeature extends DefaultFeature {
|
||||||
|
|
|
@ -17,18 +17,18 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.PosInfo;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.integration.Integrations;
|
import ru.betterend.integration.Integrations;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.PosInfo;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFFlatWave;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
||||||
|
|
|
@ -16,17 +16,17 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.operator.SDFUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.integration.Integrations;
|
import ru.betterend.integration.Integrations;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class OldBulbisTreeFeature extends DefaultFeature {
|
public class OldBulbisTreeFeature extends DefaultFeature {
|
||||||
|
|
|
@ -13,10 +13,10 @@ import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import net.minecraft.world.level.WorldGenLevel;
|
import net.minecraft.world.level.WorldGenLevel;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFLine;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFLine;
|
|
||||||
|
|
||||||
public class SplineHelper {
|
public class SplineHelper {
|
||||||
public static List<Vector3f> makeSpline(float x1, float y1, float z1, float x2, float y2, float z2, int points) {
|
public static List<Vector3f> makeSpline(float x1, float y1, float z1, float x2, float y2, float z2, int points) {
|
||||||
|
|
|
@ -1,104 +0,0 @@
|
||||||
package ru.betterend.util.sdf;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.core.Direction;
|
|
||||||
import net.minecraft.world.level.block.Blocks;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
|
|
||||||
public class PosInfo implements Comparable<PosInfo> {
|
|
||||||
private static final BlockState AIR = Blocks.AIR.defaultBlockState();
|
|
||||||
private final Map<BlockPos, PosInfo> blocks;
|
|
||||||
private final Map<BlockPos, PosInfo> add;
|
|
||||||
private final BlockPos pos;
|
|
||||||
private BlockState state;
|
|
||||||
|
|
||||||
public static PosInfo create(Map<BlockPos, PosInfo> blocks, Map<BlockPos, PosInfo> add, BlockPos pos) {
|
|
||||||
return new PosInfo(blocks, add, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
private PosInfo(Map<BlockPos, PosInfo> blocks, Map<BlockPos, PosInfo> add, BlockPos pos) {
|
|
||||||
this.blocks = blocks;
|
|
||||||
this.add = add;
|
|
||||||
this.pos = pos;
|
|
||||||
blocks.put(pos, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockState getState() {
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockState getState(BlockPos pos) {
|
|
||||||
PosInfo info = blocks.get(pos);
|
|
||||||
if (info == null) {
|
|
||||||
info = add.get(pos);
|
|
||||||
return info == null ? AIR : info.getState();
|
|
||||||
}
|
|
||||||
return info.getState();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setState(BlockState state) {
|
|
||||||
this.state = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setState(BlockPos pos, BlockState state) {
|
|
||||||
PosInfo info = blocks.get(pos);
|
|
||||||
if (info != null) {
|
|
||||||
info.setState(state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockState getState(Direction dir) {
|
|
||||||
PosInfo info = blocks.get(pos.relative(dir));
|
|
||||||
if (info == null) {
|
|
||||||
info = add.get(pos.relative(dir));
|
|
||||||
return info == null ? AIR : info.getState();
|
|
||||||
}
|
|
||||||
return info.getState();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockState getState(Direction dir, int distance) {
|
|
||||||
PosInfo info = blocks.get(pos.relative(dir, distance));
|
|
||||||
if (info == null) {
|
|
||||||
return AIR;
|
|
||||||
}
|
|
||||||
return info.getState();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockState getStateUp() {
|
|
||||||
return getState(Direction.UP);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockState getStateDown() {
|
|
||||||
return getState(Direction.DOWN);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return pos.hashCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (!(obj instanceof PosInfo)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return pos.equals(((PosInfo) obj).pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int compareTo(PosInfo info) {
|
|
||||||
return this.pos.getY() - info.pos.getY();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockPos getPos() {
|
|
||||||
return pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBlockPos(BlockPos pos, BlockState state) {
|
|
||||||
PosInfo info = new PosInfo(blocks, add, pos);
|
|
||||||
info.state = state;
|
|
||||||
add.put(pos, info);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,310 +0,0 @@
|
||||||
package ru.betterend.util.sdf;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
|
||||||
import net.minecraft.core.Direction;
|
|
||||||
import net.minecraft.world.level.ServerLevelAccessor;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
import net.minecraft.world.phys.AABB;
|
|
||||||
import ru.betterend.util.BlocksHelper;
|
|
||||||
import ru.betterend.world.structures.StructureWorld;
|
|
||||||
|
|
||||||
public abstract class SDF {
|
|
||||||
private List<Function<PosInfo, BlockState>> postProcesses = Lists.newArrayList();
|
|
||||||
private Function<BlockState, Boolean> canReplace = (state) -> {
|
|
||||||
return state.getMaterial().isReplaceable();
|
|
||||||
};
|
|
||||||
|
|
||||||
public abstract float getDistance(float x, float y, float z);
|
|
||||||
|
|
||||||
public abstract BlockState getBlockState(BlockPos pos);
|
|
||||||
|
|
||||||
public SDF addPostProcess(Function<PosInfo, BlockState> postProcess) {
|
|
||||||
this.postProcesses.add(postProcess);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDF setReplaceFunction(Function<BlockState, Boolean> canReplace) {
|
|
||||||
this.canReplace = canReplace;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void fillRecursive(ServerLevelAccessor world, BlockPos start) {
|
|
||||||
Map<BlockPos, PosInfo> mapWorld = Maps.newHashMap();
|
|
||||||
Map<BlockPos, PosInfo> addInfo = Maps.newHashMap();
|
|
||||||
Set<BlockPos> blocks = Sets.newHashSet();
|
|
||||||
Set<BlockPos> ends = Sets.newHashSet();
|
|
||||||
Set<BlockPos> add = Sets.newHashSet();
|
|
||||||
ends.add(new BlockPos(0, 0, 0));
|
|
||||||
boolean run = true;
|
|
||||||
|
|
||||||
MutableBlockPos bPos = new MutableBlockPos();
|
|
||||||
|
|
||||||
while (run) {
|
|
||||||
for (BlockPos center: ends) {
|
|
||||||
for (Direction dir: Direction.values()) {
|
|
||||||
bPos.set(center).move(dir);
|
|
||||||
BlockPos wpos = bPos.offset(start);
|
|
||||||
|
|
||||||
if (!blocks.contains(bPos) && canReplace.apply(world.getBlockState(wpos))) {
|
|
||||||
if (this.getDistance(bPos.getX(), bPos.getY(), bPos.getZ()) < 0) {
|
|
||||||
BlockState state = getBlockState(wpos);
|
|
||||||
PosInfo.create(mapWorld, addInfo, wpos).setState(state);
|
|
||||||
add.add(bPos.immutable());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
blocks.addAll(ends);
|
|
||||||
ends.clear();
|
|
||||||
ends.addAll(add);
|
|
||||||
add.clear();
|
|
||||||
|
|
||||||
run &= !ends.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PosInfo> infos = new ArrayList<PosInfo>(mapWorld.values());
|
|
||||||
if (infos.size() > 0) {
|
|
||||||
Collections.sort(infos);
|
|
||||||
postProcesses.forEach((postProcess) -> {
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
info.setState(postProcess.apply(info));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
BlocksHelper.setWithoutUpdate(world, info.getPos(), info.getState());
|
|
||||||
});
|
|
||||||
|
|
||||||
infos.clear();
|
|
||||||
infos.addAll(addInfo.values());
|
|
||||||
Collections.sort(infos);
|
|
||||||
postProcesses.forEach((postProcess) -> {
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
info.setState(postProcess.apply(info));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
if (canReplace.apply(world.getBlockState(info.getPos()))) {
|
|
||||||
BlocksHelper.setWithoutUpdate(world, info.getPos(), info.getState());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void fillArea(ServerLevelAccessor world, BlockPos center, AABB box) {
|
|
||||||
Map<BlockPos, PosInfo> mapWorld = Maps.newHashMap();
|
|
||||||
Map<BlockPos, PosInfo> addInfo = Maps.newHashMap();
|
|
||||||
|
|
||||||
MutableBlockPos mut = new MutableBlockPos();
|
|
||||||
for (int y = (int) box.minY; y <= box.maxY; y++) {
|
|
||||||
mut.setY(y);
|
|
||||||
for (int x = (int) box.minX; x <= box.maxX; x++) {
|
|
||||||
mut.setX(x);
|
|
||||||
for (int z = (int) box.minZ; z <= box.maxZ; z++) {
|
|
||||||
mut.setZ(z);
|
|
||||||
if (canReplace.apply(world.getBlockState(mut))) {
|
|
||||||
BlockPos fpos = mut.subtract(center);
|
|
||||||
if (this.getDistance(fpos.getX(), fpos.getY(), fpos.getZ()) < 0) {
|
|
||||||
PosInfo.create(mapWorld, addInfo, mut.immutable()).setState(getBlockState(mut));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PosInfo> infos = new ArrayList<PosInfo>(mapWorld.values());
|
|
||||||
if (infos.size() > 0) {
|
|
||||||
Collections.sort(infos);
|
|
||||||
postProcesses.forEach((postProcess) -> {
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
info.setState(postProcess.apply(info));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
BlocksHelper.setWithoutUpdate(world, info.getPos(), info.getState());
|
|
||||||
});
|
|
||||||
|
|
||||||
infos.clear();
|
|
||||||
infos.addAll(addInfo.values());
|
|
||||||
Collections.sort(infos);
|
|
||||||
postProcesses.forEach((postProcess) -> {
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
info.setState(postProcess.apply(info));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
if (canReplace.apply(world.getBlockState(info.getPos()))) {
|
|
||||||
BlocksHelper.setWithoutUpdate(world, info.getPos(), info.getState());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void fillRecursiveIgnore(ServerLevelAccessor world, BlockPos start, Function<BlockState, Boolean> ignore) {
|
|
||||||
Map<BlockPos, PosInfo> mapWorld = Maps.newHashMap();
|
|
||||||
Map<BlockPos, PosInfo> addInfo = Maps.newHashMap();
|
|
||||||
Set<BlockPos> blocks = Sets.newHashSet();
|
|
||||||
Set<BlockPos> ends = Sets.newHashSet();
|
|
||||||
Set<BlockPos> add = Sets.newHashSet();
|
|
||||||
ends.add(new BlockPos(0, 0, 0));
|
|
||||||
boolean run = true;
|
|
||||||
|
|
||||||
MutableBlockPos bPos = new MutableBlockPos();
|
|
||||||
|
|
||||||
while (run) {
|
|
||||||
for (BlockPos center: ends) {
|
|
||||||
for (Direction dir: Direction.values()) {
|
|
||||||
bPos.set(center).move(dir);
|
|
||||||
BlockPos wpos = bPos.offset(start);
|
|
||||||
BlockState state = world.getBlockState(wpos);
|
|
||||||
boolean ign = ignore.apply(state);
|
|
||||||
if (!blocks.contains(bPos) && (ign || canReplace.apply(state))) {
|
|
||||||
if (this.getDistance(bPos.getX(), bPos.getY(), bPos.getZ()) < 0) {
|
|
||||||
PosInfo.create(mapWorld, addInfo, wpos).setState(ign ? state : getBlockState(bPos));
|
|
||||||
add.add(bPos.immutable());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
blocks.addAll(ends);
|
|
||||||
ends.clear();
|
|
||||||
ends.addAll(add);
|
|
||||||
add.clear();
|
|
||||||
|
|
||||||
run &= !ends.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PosInfo> infos = new ArrayList<PosInfo>(mapWorld.values());
|
|
||||||
if (infos.size() > 0) {
|
|
||||||
Collections.sort(infos);
|
|
||||||
postProcesses.forEach((postProcess) -> {
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
info.setState(postProcess.apply(info));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
BlocksHelper.setWithoutUpdate(world, info.getPos(), info.getState());
|
|
||||||
});
|
|
||||||
|
|
||||||
infos.clear();
|
|
||||||
infos.addAll(addInfo.values());
|
|
||||||
Collections.sort(infos);
|
|
||||||
postProcesses.forEach((postProcess) -> {
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
info.setState(postProcess.apply(info));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
if (canReplace.apply(world.getBlockState(info.getPos()))) {
|
|
||||||
BlocksHelper.setWithoutUpdate(world, info.getPos(), info.getState());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void fillRecursive(StructureWorld world, BlockPos start) {
|
|
||||||
Map<BlockPos, PosInfo> mapWorld = Maps.newHashMap();
|
|
||||||
Map<BlockPos, PosInfo> addInfo = Maps.newHashMap();
|
|
||||||
Set<BlockPos> blocks = Sets.newHashSet();
|
|
||||||
Set<BlockPos> ends = Sets.newHashSet();
|
|
||||||
Set<BlockPos> add = Sets.newHashSet();
|
|
||||||
ends.add(new BlockPos(0, 0, 0));
|
|
||||||
boolean run = true;
|
|
||||||
|
|
||||||
MutableBlockPos bPos = new MutableBlockPos();
|
|
||||||
|
|
||||||
while (run) {
|
|
||||||
for (BlockPos center: ends) {
|
|
||||||
for (Direction dir: Direction.values()) {
|
|
||||||
bPos.set(center).move(dir);
|
|
||||||
BlockPos wpos = bPos.offset(start);
|
|
||||||
|
|
||||||
if (!blocks.contains(bPos)) {
|
|
||||||
if (this.getDistance(bPos.getX(), bPos.getY(), bPos.getZ()) < 0) {
|
|
||||||
BlockState state = getBlockState(wpos);
|
|
||||||
PosInfo.create(mapWorld, addInfo, wpos).setState(state);
|
|
||||||
add.add(bPos.immutable());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
blocks.addAll(ends);
|
|
||||||
ends.clear();
|
|
||||||
ends.addAll(add);
|
|
||||||
add.clear();
|
|
||||||
|
|
||||||
run &= !ends.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PosInfo> infos = new ArrayList<PosInfo>(mapWorld.values());
|
|
||||||
Collections.sort(infos);
|
|
||||||
postProcesses.forEach((postProcess) -> {
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
info.setState(postProcess.apply(info));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
world.setBlock(info.getPos(), info.getState());
|
|
||||||
});
|
|
||||||
|
|
||||||
infos.clear();
|
|
||||||
infos.addAll(addInfo.values());
|
|
||||||
Collections.sort(infos);
|
|
||||||
postProcesses.forEach((postProcess) -> {
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
info.setState(postProcess.apply(info));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
infos.forEach((info) -> {
|
|
||||||
world.setBlock(info.getPos(), info.getState());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<BlockPos> getPositions(ServerLevelAccessor world, BlockPos start) {
|
|
||||||
Set<BlockPos> blocks = Sets.newHashSet();
|
|
||||||
Set<BlockPos> ends = Sets.newHashSet();
|
|
||||||
Set<BlockPos> add = Sets.newHashSet();
|
|
||||||
ends.add(new BlockPos(0, 0, 0));
|
|
||||||
boolean run = true;
|
|
||||||
|
|
||||||
MutableBlockPos bPos = new MutableBlockPos();
|
|
||||||
|
|
||||||
while (run) {
|
|
||||||
for (BlockPos center: ends) {
|
|
||||||
for (Direction dir: Direction.values()) {
|
|
||||||
bPos.set(center).move(dir);
|
|
||||||
BlockPos wpos = bPos.offset(start);
|
|
||||||
BlockState state = world.getBlockState(wpos);
|
|
||||||
if (!blocks.contains(wpos) && canReplace.apply(state)) {
|
|
||||||
if (this.getDistance(bPos.getX(), bPos.getY(), bPos.getZ()) < 0) {
|
|
||||||
add.add(bPos.immutable());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ends.forEach((end) -> blocks.add(end.offset(start)));
|
|
||||||
ends.clear();
|
|
||||||
ends.addAll(add);
|
|
||||||
add.clear();
|
|
||||||
|
|
||||||
run &= !ends.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
return blocks;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
|
|
||||||
public abstract class SDFBinary extends SDF {
|
|
||||||
protected SDF sourceA;
|
|
||||||
protected SDF sourceB;
|
|
||||||
protected boolean firstValue;
|
|
||||||
|
|
||||||
public SDFBinary setSourceA(SDF sourceA) {
|
|
||||||
this.sourceA = sourceA;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFBinary setSourceB(SDF sourceB) {
|
|
||||||
this.sourceB = sourceB;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void selectValue(float a, float b) {
|
|
||||||
firstValue = a < b;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getBlockState(BlockPos pos) {
|
|
||||||
if (firstValue) {
|
|
||||||
return sourceA.getBlockState(pos);
|
|
||||||
} else {
|
|
||||||
return sourceB.getBlockState(pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
import com.mojang.math.Vector3f;
|
|
||||||
|
|
||||||
public class SDFCoordModify extends SDFUnary {
|
|
||||||
private static final Vector3f POS = new Vector3f();
|
|
||||||
private Consumer<Vector3f> function;
|
|
||||||
|
|
||||||
public SDFCoordModify setFunction(Consumer<Vector3f> function) {
|
|
||||||
this.function = function;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
POS.set(x, y, z);
|
|
||||||
function.accept(POS);
|
|
||||||
return this.source.getDistance(POS.x(), POS.y(), POS.z());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFCopyRotate extends SDFUnary {
|
|
||||||
int count = 1;
|
|
||||||
|
|
||||||
public SDFCopyRotate setCount(int count) {
|
|
||||||
this.count = count;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float px = (float) Math.atan2(x, z);
|
|
||||||
float pz = MHelper.length(x, z);
|
|
||||||
return this.source.getDistance(px, y, pz);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
import com.mojang.math.Vector3f;
|
|
||||||
|
|
||||||
public class SDFDisplacement extends SDFUnary {
|
|
||||||
private static final Vector3f POS = new Vector3f();
|
|
||||||
private Function<Vector3f, Float> displace;
|
|
||||||
|
|
||||||
public SDFDisplacement setFunction(Function<Vector3f, Float> displace) {
|
|
||||||
this.displace = displace;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
POS.set(x, y, z);
|
|
||||||
return this.source.getDistance(x, y, z) + displace.apply(POS);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
public class SDFFlatWave extends SDFDisplacement {
|
|
||||||
private int rayCount = 1;
|
|
||||||
private float intensity;
|
|
||||||
private float angle;
|
|
||||||
|
|
||||||
public SDFFlatWave() {
|
|
||||||
setFunction((pos) -> {
|
|
||||||
return (float) Math.cos(Math.atan2(pos.x(), pos.z()) * rayCount + angle) * intensity;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFFlatWave setRaysCount(int count) {
|
|
||||||
this.rayCount = count;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFFlatWave setAngle(float angle) {
|
|
||||||
this.angle = angle;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFFlatWave setIntensity(float intensity) {
|
|
||||||
this.intensity = intensity;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.NativeImage;
|
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
|
|
||||||
public class SDFHeightmap extends SDFDisplacement {
|
|
||||||
private float intensity = 1F;
|
|
||||||
private NativeImage map;
|
|
||||||
private float offsetX;
|
|
||||||
private float offsetZ;
|
|
||||||
private float scale;
|
|
||||||
private float cos = 1;
|
|
||||||
private float sin = 0;
|
|
||||||
|
|
||||||
public SDFHeightmap() {
|
|
||||||
setFunction((pos) -> {
|
|
||||||
if (map == null) {
|
|
||||||
return 0F;
|
|
||||||
}
|
|
||||||
float px = Mth.clamp(pos.x() * scale + offsetX, 0, map.getWidth() - 2);
|
|
||||||
float pz = Mth.clamp(pos.z() * scale + offsetZ, 0, map.getHeight() - 2);
|
|
||||||
float dx = (px * cos - pz * sin);
|
|
||||||
float dz = (pz * cos + px * sin);
|
|
||||||
int x1 = Mth.floor(dx);
|
|
||||||
int z1 = Mth.floor(dz);
|
|
||||||
int x2 = x1 + 1;
|
|
||||||
int z2 = z1 + 1;
|
|
||||||
dx = dx - x1;
|
|
||||||
dz = dz - z1;
|
|
||||||
float a = (map.getPixelRGBA(x1, z1) & 255) / 255F;
|
|
||||||
float b = (map.getPixelRGBA(x2, z1) & 255) / 255F;
|
|
||||||
float c = (map.getPixelRGBA(x1, z2) & 255) / 255F;
|
|
||||||
float d = (map.getPixelRGBA(x2, z2) & 255) / 255F;
|
|
||||||
a = Mth.lerp(dx, a, b);
|
|
||||||
b = Mth.lerp(dx, c, d);
|
|
||||||
return -Mth.lerp(dz, a, b) * intensity;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFHeightmap setMap(NativeImage map) {
|
|
||||||
this.map = map;
|
|
||||||
offsetX = map.getWidth() * 0.5F;
|
|
||||||
offsetZ = map.getHeight() * 0.5F;
|
|
||||||
scale = map.getWidth();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFHeightmap setAngle(float angle) {
|
|
||||||
sin = Mth.sin(angle);
|
|
||||||
cos = Mth.cos(angle);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFHeightmap setScale(float scale) {
|
|
||||||
this.scale = map.getWidth() * scale;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFHeightmap setIntensity(float intensity) {
|
|
||||||
this.intensity = intensity;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFIntersection extends SDFBinary {
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float a = this.sourceA.getDistance(x, y, z);
|
|
||||||
float b = this.sourceB.getDistance(x, y, z);
|
|
||||||
this.selectValue(a, b);
|
|
||||||
return MHelper.max(a, b);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
public class SDFInvert extends SDFUnary {
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
return -this.source.getDistance(x, y, z);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,60 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
|
||||||
|
|
||||||
public class SDFRadialNoiseMap extends SDFDisplacement {
|
|
||||||
private static final float SIN = Mth.sin(0.5F);
|
|
||||||
private static final float COS = Mth.cos(0.5F);
|
|
||||||
|
|
||||||
private OpenSimplexNoise noise;
|
|
||||||
private float intensity = 1F;
|
|
||||||
private float radius = 1F;
|
|
||||||
private short offsetX;
|
|
||||||
private short offsetZ;
|
|
||||||
|
|
||||||
public SDFRadialNoiseMap() {
|
|
||||||
setFunction((pos) -> {
|
|
||||||
if (intensity == 0) {
|
|
||||||
return 0F;
|
|
||||||
}
|
|
||||||
float px = pos.x() / radius;
|
|
||||||
float pz = pos.z() / radius;
|
|
||||||
float distance = MHelper.lengthSqr(px, pz);
|
|
||||||
if (distance > 1) {
|
|
||||||
return 0F;
|
|
||||||
}
|
|
||||||
distance = 1 - Mth.sqrt(distance);
|
|
||||||
float nx = px * COS - pz * SIN;
|
|
||||||
float nz = pz * COS + px * SIN;
|
|
||||||
distance *= getNoise(nx * 0.75 + offsetX, nz * 0.75 + offsetZ);
|
|
||||||
return distance * intensity;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private float getNoise(double x, double z) {
|
|
||||||
return (float) noise.eval(x, z) + (float) noise.eval(x * 3 + 1000, z * 3) * 0.5F + (float) noise.eval(x * 9 + 1000, z * 9) * 0.2F;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFRadialNoiseMap setSeed(long seed) {
|
|
||||||
noise = new OpenSimplexNoise(seed);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFRadialNoiseMap setIntensity(float intensity) {
|
|
||||||
this.intensity = intensity;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFRadialNoiseMap setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFRadialNoiseMap setOffset(int x, int z) {
|
|
||||||
offsetX = (short) (x & 32767);
|
|
||||||
offsetZ = (short) (z & 32767);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import com.mojang.math.Quaternion;
|
|
||||||
import com.mojang.math.Vector3f;
|
|
||||||
|
|
||||||
public class SDFRotation extends SDFUnary {
|
|
||||||
private static final Vector3f POS = new Vector3f();
|
|
||||||
private Quaternion rotation;
|
|
||||||
|
|
||||||
public SDFRotation setRotation(Vector3f axis, float rotationAngle) {
|
|
||||||
rotation = new Quaternion(axis, rotationAngle, false);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
POS.set(x, y, z);
|
|
||||||
POS.transform(rotation);
|
|
||||||
return source.getDistance(POS.x(), POS.y(), POS.z());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
public class SDFRound extends SDFUnary {
|
|
||||||
private float radius;
|
|
||||||
|
|
||||||
public SDFRound setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
return this.source.getDistance(x, y, z) - radius;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
public class SDFScale extends SDFUnary {
|
|
||||||
private float scale;
|
|
||||||
|
|
||||||
public SDFScale setScale(float scale) {
|
|
||||||
this.scale = scale;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
return source.getDistance(x / scale, y / scale, z / scale) * scale;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
public class SDFScale3D extends SDFUnary {
|
|
||||||
private float x;
|
|
||||||
private float y;
|
|
||||||
private float z;
|
|
||||||
|
|
||||||
public SDFScale3D setScale(float x, float y, float z) {
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.z = z;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
return source.getDistance(x / this.x, y / this.y, z / this.z);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
|
|
||||||
public class SDFSmoothIntersection extends SDFBinary {
|
|
||||||
private float radius;
|
|
||||||
|
|
||||||
public SDFSmoothIntersection setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float a = this.sourceA.getDistance(x, y, z);
|
|
||||||
float b = this.sourceB.getDistance(x, y, z);
|
|
||||||
this.selectValue(a, b);
|
|
||||||
float h = Mth.clamp(0.5F - 0.5F * (b - a) / radius, 0F, 1F);
|
|
||||||
return Mth.lerp(h, b, a) + radius * h * (1F - h);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
|
|
||||||
public class SDFSmoothSubtraction extends SDFBinary {
|
|
||||||
private float radius;
|
|
||||||
|
|
||||||
public SDFSmoothSubtraction setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float a = this.sourceA.getDistance(x, y, z);
|
|
||||||
float b = this.sourceB.getDistance(x, y, z);
|
|
||||||
this.selectValue(a, b);
|
|
||||||
float h = Mth.clamp(0.5F - 0.5F * (b + a) / radius, 0F, 1F);
|
|
||||||
return Mth.lerp(h, b, -a) + radius * h * (1F - h);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
|
|
||||||
public class SDFSmoothUnion extends SDFBinary {
|
|
||||||
private float radius;
|
|
||||||
|
|
||||||
public SDFSmoothUnion setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float a = this.sourceA.getDistance(x, y, z);
|
|
||||||
float b = this.sourceB.getDistance(x, y, z);
|
|
||||||
this.selectValue(a, b);
|
|
||||||
float h = Mth.clamp(0.5F + 0.5F * (b - a) / radius, 0F, 1F);
|
|
||||||
return Mth.lerp(h, b, a) - radius * h * (1F - h);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFSubtraction extends SDFBinary {
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float a = this.sourceA.getDistance(x, y, z);
|
|
||||||
float b = this.sourceB.getDistance(x, y, z);
|
|
||||||
this.selectValue(a, b);
|
|
||||||
return MHelper.max(a, -b);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
public class SDFTranslate extends SDFUnary {
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float z;
|
|
||||||
|
|
||||||
public SDFTranslate setTranslate(float x, float y, float z) {
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.z = z;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
return source.getDistance(x - this.x, y - this.y, z - this.z);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
|
|
||||||
public abstract class SDFUnary extends SDF {
|
|
||||||
protected SDF source;
|
|
||||||
|
|
||||||
public SDFUnary setSource(SDF source) {
|
|
||||||
this.source = source;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BlockState getBlockState(BlockPos pos) {
|
|
||||||
return source.getBlockState(pos);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package ru.betterend.util.sdf.operator;
|
|
||||||
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFUnion extends SDFBinary {
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float a = this.sourceA.getDistance(x, y, z);
|
|
||||||
float b = this.sourceB.getDistance(x, y, z);
|
|
||||||
this.selectValue(a, b);
|
|
||||||
return MHelper.min(a, b);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
package ru.betterend.util.sdf.primitive;
|
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFCappedCone extends SDFPrimitive {
|
|
||||||
private float radius1;
|
|
||||||
private float radius2;
|
|
||||||
private float height;
|
|
||||||
|
|
||||||
public SDFCappedCone setRadius1(float radius) {
|
|
||||||
this.radius1 = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFCappedCone setRadius2(float radius) {
|
|
||||||
this.radius2 = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFCappedCone setHeight(float height) {
|
|
||||||
this.height = height;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float qx = MHelper.length(x, z);
|
|
||||||
float k2x = radius2 - radius1;
|
|
||||||
float k2y = 2 * height;
|
|
||||||
float cax = qx - MHelper.min(qx, (y < 0F) ? radius1 : radius2);
|
|
||||||
float cay = Math.abs(y) - height;
|
|
||||||
float mlt = Mth.clamp(MHelper.dot(radius2 - qx, height - y, k2x, k2y) / MHelper.dot(k2x, k2y, k2x, k2y), 0F, 1F);
|
|
||||||
float cbx = qx - radius2 + k2x * mlt;
|
|
||||||
float cby = y - height + k2y * mlt;
|
|
||||||
float s = (cbx < 0F && cay < 0F) ? -1F : 1F;
|
|
||||||
return s * (float) Math.sqrt(MHelper.min(MHelper.dot(cax, cay, cax, cay), MHelper.dot(cbx, cby, cbx, cby)));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
package ru.betterend.util.sdf.primitive;
|
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFCapsule extends SDFPrimitive {
|
|
||||||
private float radius;
|
|
||||||
private float height;
|
|
||||||
|
|
||||||
public SDFCapsule setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFCapsule setHeight(float height) {
|
|
||||||
this.height = height;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
return MHelper.length(x, y - Mth.clamp(y, 0, height), z) - radius;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package ru.betterend.util.sdf.primitive;
|
|
||||||
|
|
||||||
public class SDFFlatland extends SDFPrimitive {
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
package ru.betterend.util.sdf.primitive;
|
|
||||||
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFHexPrism extends SDFPrimitive {
|
|
||||||
private float radius;
|
|
||||||
private float height;
|
|
||||||
|
|
||||||
public SDFHexPrism setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFHexPrism setHeight(float height) {
|
|
||||||
this.height = height;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float px = Math.abs(x);
|
|
||||||
float py = Math.abs(y);
|
|
||||||
float pz = Math.abs(z);
|
|
||||||
return MHelper.max(py - height, MHelper.max((px * 0.866025F + pz * 0.5F), pz) - radius);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
package ru.betterend.util.sdf.primitive;
|
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFLine extends SDFPrimitive {
|
|
||||||
private float radius;
|
|
||||||
private float x1;
|
|
||||||
private float y1;
|
|
||||||
private float z1;
|
|
||||||
private float x2;
|
|
||||||
private float y2;
|
|
||||||
private float z2;
|
|
||||||
|
|
||||||
public SDFLine setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFLine setStart(float x, float y, float z) {
|
|
||||||
this.x1 = x;
|
|
||||||
this.y1 = y;
|
|
||||||
this.z1 = z;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFLine setEnd(float x, float y, float z) {
|
|
||||||
this.x2 = x;
|
|
||||||
this.y2 = y;
|
|
||||||
this.z2 = z;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float pax = x - x1;
|
|
||||||
float pay = y - y1;
|
|
||||||
float paz = z - z1;
|
|
||||||
|
|
||||||
float bax = x2 - x1;
|
|
||||||
float bay = y2 - y1;
|
|
||||||
float baz = z2 - z1;
|
|
||||||
|
|
||||||
float dpb = MHelper.dot(pax, pay, paz, bax, bay, baz);
|
|
||||||
float dbb = MHelper.dot(bax, bay, baz, bax, bay, baz);
|
|
||||||
float h = Mth.clamp(dpb / dbb, 0F, 1F);
|
|
||||||
return MHelper.length(pax - bax * h, pay - bay * h, paz - baz * h) - radius;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
package ru.betterend.util.sdf.primitive;
|
|
||||||
|
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFPie extends SDFPrimitive {
|
|
||||||
private float sin;
|
|
||||||
private float cos;
|
|
||||||
private float radius;
|
|
||||||
|
|
||||||
public SDFPie setAngle(float angle) {
|
|
||||||
this.sin = (float) Math.sin(angle);
|
|
||||||
this.cos = (float) Math.cos(angle);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFPie setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
float px = Math.abs(x);
|
|
||||||
float l = MHelper.length(px, y, z) - radius;
|
|
||||||
float m = MHelper.dot(px, z, sin, cos);
|
|
||||||
m = Mth.clamp(m, 0, radius);
|
|
||||||
m = MHelper.length(px - sin * m, z - cos * m);
|
|
||||||
return MHelper.max(l, m * (float) Math.signum(cos * px - sin * z));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
package ru.betterend.util.sdf.primitive;
|
|
||||||
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
|
|
||||||
public abstract class SDFPrimitive extends SDF {
|
|
||||||
protected Function<BlockPos, BlockState> placerFunction;
|
|
||||||
|
|
||||||
public SDFPrimitive setBlock(Function<BlockPos, BlockState> placerFunction) {
|
|
||||||
this.placerFunction = placerFunction;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFPrimitive setBlock(BlockState state) {
|
|
||||||
this.placerFunction = (pos) -> {
|
|
||||||
return state;
|
|
||||||
};
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SDFPrimitive setBlock(Block block) {
|
|
||||||
this.placerFunction = (pos) -> {
|
|
||||||
return block.defaultBlockState();
|
|
||||||
};
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockState getBlockState(BlockPos pos) {
|
|
||||||
return placerFunction.apply(pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*public abstract CompoundTag toNBT(CompoundTag root) {
|
|
||||||
|
|
||||||
}*/
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
package ru.betterend.util.sdf.primitive;
|
|
||||||
|
|
||||||
import ru.bclib.util.MHelper;
|
|
||||||
|
|
||||||
public class SDFSphere extends SDFPrimitive {
|
|
||||||
private float radius;
|
|
||||||
|
|
||||||
public SDFSphere setRadius(float radius) {
|
|
||||||
this.radius = radius;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getDistance(float x, float y, float z) {
|
|
||||||
return MHelper.length(x, y, z) - radius;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -12,12 +12,12 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderBaseConfiguration;
|
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderBaseConfiguration;
|
||||||
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderConfiguration;
|
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderConfiguration;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
|
|
||||||
public class BiomeIslandFeature extends DefaultFeature {
|
public class BiomeIslandFeature extends DefaultFeature {
|
||||||
private static final MutableBlockPos CENTER = new MutableBlockPos();
|
private static final MutableBlockPos CENTER = new MutableBlockPos();
|
||||||
|
|
|
@ -12,16 +12,16 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class BushFeature extends DefaultFeature {
|
public class BushFeature extends DefaultFeature {
|
||||||
|
|
|
@ -13,16 +13,16 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class BushWithOuterFeature extends DefaultFeature {
|
public class BushWithOuterFeature extends DefaultFeature {
|
||||||
|
|
|
@ -15,6 +15,12 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.BlockProperties;
|
import ru.betterend.blocks.BlockProperties;
|
||||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||||
|
@ -23,12 +29,6 @@ import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class TenaneaBushFeature extends DefaultFeature {
|
public class TenaneaBushFeature extends DefaultFeature {
|
||||||
|
|
|
@ -9,13 +9,13 @@ import net.minecraft.world.level.WorldGenLevel;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFRotation;
|
||||||
|
import ru.bclib.sdf.primitive.SDFHexPrism;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFRotation;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFHexPrism;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class BigAuroraCrystalFeature extends DefaultFeature {
|
public class BigAuroraCrystalFeature extends DefaultFeature {
|
||||||
|
|
|
@ -11,15 +11,15 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFRotation;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFRotation;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class FallenPillarFeature extends DefaultFeature {
|
public class FallenPillarFeature extends DefaultFeature {
|
||||||
|
|
|
@ -11,13 +11,13 @@ import net.minecraft.world.level.WorldGenLevel;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBiomes;
|
import ru.betterend.registry.EndBiomes;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
|
|
||||||
public class FloatingSpireFeature extends SpireFeature {
|
public class FloatingSpireFeature extends SpireFeature {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -16,6 +16,20 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFCoordModify;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFInvert;
|
||||||
|
import ru.bclib.sdf.operator.SDFRotation;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.operator.SDFUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
|
import ru.bclib.sdf.primitive.SDFFlatland;
|
||||||
|
import ru.bclib.sdf.primitive.SDFPrimitive;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.HydrothermalVentBlock;
|
import ru.betterend.blocks.HydrothermalVentBlock;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
|
@ -23,20 +37,6 @@ import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFCoordModify;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFInvert;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFRotation;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFFlatland;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFPrimitive;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class GeyserFeature extends DefaultFeature {
|
public class GeyserFeature extends DefaultFeature {
|
||||||
|
|
|
@ -11,13 +11,13 @@ import net.minecraft.world.level.WorldGenLevel;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFRotation;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.operator.SDFUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFRotation;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class IceStarFeature extends DefaultFeature {
|
public class IceStarFeature extends DefaultFeature {
|
||||||
|
|
|
@ -9,14 +9,14 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class ObsidianBoulderFeature extends DefaultFeature {
|
public class ObsidianBoulderFeature extends DefaultFeature {
|
||||||
|
|
|
@ -11,17 +11,17 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFRotation;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
|
import ru.bclib.sdf.primitive.SDFFlatland;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFRotation;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFFlatland;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class ObsidianPillarBasementFeature extends DefaultFeature {
|
public class ObsidianPillarBasementFeature extends DefaultFeature {
|
||||||
|
|
|
@ -8,12 +8,12 @@ import net.minecraft.world.level.block.Blocks;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFCoordModify;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFCoordModify;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class OreLayerFeature extends DefaultFeature {
|
public class OreLayerFeature extends DefaultFeature {
|
||||||
|
|
|
@ -15,16 +15,16 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBiomes;
|
import ru.betterend.registry.EndBiomes;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class SpireFeature extends DefaultFeature {
|
public class SpireFeature extends DefaultFeature {
|
||||||
|
|
|
@ -16,20 +16,20 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.PosInfo;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.PosInfo;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class DragonTreeFeature extends DefaultFeature {
|
public class DragonTreeFeature extends DefaultFeature {
|
||||||
|
|
|
@ -17,14 +17,14 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.PosInfo;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.basis.AttachedBlock;
|
import ru.betterend.blocks.basis.AttachedBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.PosInfo;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class GiganticAmaranitaFeature extends DefaultFeature {
|
public class GiganticAmaranitaFeature extends DefaultFeature {
|
||||||
|
|
|
@ -15,19 +15,19 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
|
import ru.bclib.sdf.PosInfo;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFRotation;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.operator.SDFUnion;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.HelixTreeLeavesBlock;
|
import ru.betterend.blocks.HelixTreeLeavesBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.PosInfo;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFRotation;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class HelixTreeFeature extends DefaultFeature {
|
public class HelixTreeFeature extends DefaultFeature {
|
||||||
|
|
|
@ -14,18 +14,18 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.JellyshroomCapBlock;
|
import ru.betterend.blocks.JellyshroomCapBlock;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFFlatWave;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class JellyshroomFeature extends DefaultFeature {
|
public class JellyshroomFeature extends DefaultFeature {
|
||||||
|
|
|
@ -15,18 +15,18 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.PosInfo;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.PosInfo;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class LacugroveFeature extends DefaultFeature {
|
public class LacugroveFeature extends DefaultFeature {
|
||||||
|
|
|
@ -16,6 +16,13 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.BlockProperties;
|
import ru.betterend.blocks.BlockProperties;
|
||||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||||
|
@ -25,13 +32,6 @@ import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class LucerniaFeature extends DefaultFeature {
|
public class LucerniaFeature extends DefaultFeature {
|
||||||
|
|
|
@ -13,6 +13,19 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFBinary;
|
||||||
|
import ru.bclib.sdf.operator.SDFCoordModify;
|
||||||
|
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.operator.SDFUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
|
import ru.bclib.sdf.primitive.SDFPrimitive;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.MossyGlowshroomCapBlock;
|
import ru.betterend.blocks.MossyGlowshroomCapBlock;
|
||||||
import ru.betterend.blocks.basis.FurBlock;
|
import ru.betterend.blocks.basis.FurBlock;
|
||||||
|
@ -21,19 +34,6 @@ import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFBinary;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFCoordModify;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFFlatWave;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFPrimitive;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class MossyGlowshroomFeature extends DefaultFeature {
|
public class MossyGlowshroomFeature extends DefaultFeature {
|
||||||
|
|
|
@ -15,19 +15,19 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.PosInfo;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.PosInfo;
|
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class PythadendronTreeFeature extends DefaultFeature {
|
public class PythadendronTreeFeature extends DefaultFeature {
|
||||||
|
|
|
@ -16,6 +16,13 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.BlockProperties;
|
import ru.betterend.blocks.BlockProperties;
|
||||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||||
|
@ -25,13 +32,6 @@ import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class TenaneaFeature extends DefaultFeature {
|
public class TenaneaFeature extends DefaultFeature {
|
||||||
|
|
|
@ -16,6 +16,15 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.Material;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.operator.SDFUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.UmbrellaTreeClusterBlock;
|
import ru.betterend.blocks.UmbrellaTreeClusterBlock;
|
||||||
import ru.betterend.blocks.UmbrellaTreeMembraneBlock;
|
import ru.betterend.blocks.UmbrellaTreeMembraneBlock;
|
||||||
|
@ -23,15 +32,6 @@ import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndTags;
|
import ru.betterend.registry.EndTags;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFFlatWave;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
import ru.betterend.world.features.DefaultFeature;
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
public class UmbrellaTreeFeature extends DefaultFeature {
|
public class UmbrellaTreeFeature extends DefaultFeature {
|
||||||
|
|
|
@ -8,14 +8,14 @@ import java.util.Random;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFRadialNoiseMap;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.noise.OpenSimplexNoise;
|
import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFRadialNoiseMap;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
|
|
||||||
public class IslandLayer {
|
public class IslandLayer {
|
||||||
private static final Random RANDOM = new Random();
|
private static final Random RANDOM = new Random();
|
||||||
|
|
|
@ -1,170 +0,0 @@
|
||||||
package ru.betterend.world.structures;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.nbt.CompoundTag;
|
|
||||||
import net.minecraft.nbt.ListTag;
|
|
||||||
import net.minecraft.nbt.NbtUtils;
|
|
||||||
import net.minecraft.world.level.ChunkPos;
|
|
||||||
import net.minecraft.world.level.WorldGenLevel;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
|
||||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
|
||||||
|
|
||||||
public class StructureWorld {
|
|
||||||
private Map<ChunkPos, Part> parts = Maps.newHashMap();
|
|
||||||
private ChunkPos lastPos;
|
|
||||||
private Part lastPart;
|
|
||||||
private int minX = Integer.MAX_VALUE;
|
|
||||||
private int minY = Integer.MAX_VALUE;
|
|
||||||
private int minZ = Integer.MAX_VALUE;
|
|
||||||
private int maxX = Integer.MIN_VALUE;
|
|
||||||
private int maxY = Integer.MIN_VALUE;
|
|
||||||
private int maxZ = Integer.MIN_VALUE;
|
|
||||||
|
|
||||||
public StructureWorld() {}
|
|
||||||
|
|
||||||
public StructureWorld(CompoundTag tag) {
|
|
||||||
minX = tag.getInt("minX");
|
|
||||||
maxX = tag.getInt("maxX");
|
|
||||||
minY = tag.getInt("minY");
|
|
||||||
maxY = tag.getInt("maxY");
|
|
||||||
minZ = tag.getInt("minZ");
|
|
||||||
maxZ = tag.getInt("maxZ");
|
|
||||||
|
|
||||||
ListTag map = tag.getList("parts", 10);
|
|
||||||
map.forEach((element) -> {
|
|
||||||
CompoundTag compound = (CompoundTag) element;
|
|
||||||
Part part = new Part(compound);
|
|
||||||
int x = compound.getInt("x");
|
|
||||||
int z = compound.getInt("z");
|
|
||||||
parts.put(new ChunkPos(x, z), part);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBlock(BlockPos pos, BlockState state) {
|
|
||||||
ChunkPos cPos = new ChunkPos(pos);
|
|
||||||
|
|
||||||
if (cPos.equals(lastPos)) {
|
|
||||||
lastPart.addBlock(pos, state);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Part part = parts.get(cPos);
|
|
||||||
if (part == null) {
|
|
||||||
part = new Part();
|
|
||||||
parts.put(cPos, part);
|
|
||||||
|
|
||||||
if (cPos.x < minX) minX = cPos.x;
|
|
||||||
if (cPos.x > maxX) maxX = cPos.x;
|
|
||||||
if (cPos.z < minZ) minZ = cPos.z;
|
|
||||||
if (cPos.z > maxZ) maxZ = cPos.z;
|
|
||||||
}
|
|
||||||
if (pos.getY() < minY) minY = pos.getY();
|
|
||||||
if (pos.getY() > maxY) maxY = pos.getY();
|
|
||||||
part.addBlock(pos, state);
|
|
||||||
|
|
||||||
lastPos = cPos;
|
|
||||||
lastPart = part;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean placeChunk(WorldGenLevel world, ChunkPos chunkPos) {
|
|
||||||
Part part = parts.get(chunkPos);
|
|
||||||
if (part != null) {
|
|
||||||
ChunkAccess chunk = world.getChunk(chunkPos.x, chunkPos.z);
|
|
||||||
part.placeChunk(chunk);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CompoundTag toBNT() {
|
|
||||||
CompoundTag tag = new CompoundTag();
|
|
||||||
tag.putInt("minX", minX);
|
|
||||||
tag.putInt("maxX", maxX);
|
|
||||||
tag.putInt("minY", minY);
|
|
||||||
tag.putInt("maxY", maxY);
|
|
||||||
tag.putInt("minZ", minZ);
|
|
||||||
tag.putInt("maxZ", maxZ);
|
|
||||||
ListTag map = new ListTag();
|
|
||||||
tag.put("parts", map);
|
|
||||||
parts.forEach((pos, part) -> {
|
|
||||||
map.add(part.toNBT(pos.x, pos.z));
|
|
||||||
});
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BoundingBox getBounds() {
|
|
||||||
if (minX == Integer.MAX_VALUE || maxX == Integer.MIN_VALUE || minZ == Integer.MAX_VALUE || maxZ == Integer.MIN_VALUE) {
|
|
||||||
return BoundingBox.getUnknownBox();
|
|
||||||
}
|
|
||||||
return new BoundingBox(minX << 4, minY, minZ << 4, (maxX << 4) | 15, maxY, (maxZ << 4) | 15);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final class Part {
|
|
||||||
Map<BlockPos, BlockState> blocks = Maps.newHashMap();
|
|
||||||
|
|
||||||
public Part() {}
|
|
||||||
|
|
||||||
public Part(CompoundTag tag) {
|
|
||||||
ListTag map = tag.getList("blocks", 10);
|
|
||||||
ListTag map2 = tag.getList("states", 10);
|
|
||||||
BlockState[] states = new BlockState[map2.size()];
|
|
||||||
for (int i = 0; i < states.length; i++) {
|
|
||||||
states[i] = NbtUtils.readBlockState((CompoundTag) map2.get(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
map.forEach((element) -> {
|
|
||||||
CompoundTag block = (CompoundTag) element;
|
|
||||||
BlockPos pos = NbtUtils.readBlockPos(block.getCompound("pos"));
|
|
||||||
int stateID = block.getInt("state");
|
|
||||||
BlockState state = stateID < states.length ? states[stateID] : Block.stateById(stateID);
|
|
||||||
blocks.put(pos, state);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void addBlock(BlockPos pos, BlockState state) {
|
|
||||||
BlockPos inner = new BlockPos(pos.getX() & 15, pos.getY(), pos.getZ() & 15);
|
|
||||||
blocks.put(inner, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
void placeChunk(ChunkAccess chunk) {
|
|
||||||
blocks.forEach((pos, state) -> {
|
|
||||||
chunk.setBlockState(pos, state, false);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
CompoundTag toNBT(int x, int z) {
|
|
||||||
CompoundTag tag = new CompoundTag();
|
|
||||||
tag.putInt("x", x);
|
|
||||||
tag.putInt("z", z);
|
|
||||||
ListTag map = new ListTag();
|
|
||||||
tag.put("blocks", map);
|
|
||||||
ListTag stateMap = new ListTag();
|
|
||||||
tag.put("states", stateMap);
|
|
||||||
|
|
||||||
int[] id = new int[1];
|
|
||||||
Map<BlockState, Integer> states = Maps.newHashMap();
|
|
||||||
|
|
||||||
blocks.forEach((pos, state) -> {
|
|
||||||
int stateID = states.getOrDefault(states, -1);
|
|
||||||
if (stateID < 0) {
|
|
||||||
stateID = id[0] ++;
|
|
||||||
states.put(state, stateID);
|
|
||||||
stateMap.add(NbtUtils.writeBlockState(state));
|
|
||||||
}
|
|
||||||
|
|
||||||
CompoundTag block = new CompoundTag();
|
|
||||||
block.put("pos", NbtUtils.writeBlockPos(pos));
|
|
||||||
block.putInt("state", stateID);
|
|
||||||
map.add(block);
|
|
||||||
});
|
|
||||||
|
|
||||||
return tag;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -16,13 +16,13 @@ import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConf
|
||||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||||
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
||||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFRotation;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.operator.SDFUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFRotation;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
import ru.betterend.world.structures.piece.VoxelPiece;
|
import ru.betterend.world.structures.piece.VoxelPiece;
|
||||||
|
|
||||||
public class GiantIceStarStructure extends SDFStructureFeature {
|
public class GiantIceStarStructure extends SDFStructureFeature {
|
||||||
|
|
|
@ -7,6 +7,20 @@ import com.mojang.math.Vector3f;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
|
import ru.bclib.sdf.operator.SDFBinary;
|
||||||
|
import ru.bclib.sdf.operator.SDFCoordModify;
|
||||||
|
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||||
|
import ru.bclib.sdf.operator.SDFRound;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale;
|
||||||
|
import ru.bclib.sdf.operator.SDFScale3D;
|
||||||
|
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||||
|
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||||
|
import ru.bclib.sdf.operator.SDFTranslate;
|
||||||
|
import ru.bclib.sdf.operator.SDFUnion;
|
||||||
|
import ru.bclib.sdf.primitive.SDFCappedCone;
|
||||||
|
import ru.bclib.sdf.primitive.SDFPrimitive;
|
||||||
|
import ru.bclib.sdf.primitive.SDFSphere;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.blocks.MossyGlowshroomCapBlock;
|
import ru.betterend.blocks.MossyGlowshroomCapBlock;
|
||||||
import ru.betterend.blocks.basis.FurBlock;
|
import ru.betterend.blocks.basis.FurBlock;
|
||||||
|
@ -14,20 +28,6 @@ import ru.betterend.noise.OpenSimplexNoise;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
import ru.betterend.util.SplineHelper;
|
import ru.betterend.util.SplineHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFBinary;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFCoordModify;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFFlatWave;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFRound;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
|
||||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFPrimitive;
|
|
||||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
|
||||||
|
|
||||||
public class GiantMossyGlowshroomStructure extends SDFStructureFeature {
|
public class GiantMossyGlowshroomStructure extends SDFStructureFeature {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,8 +12,8 @@ import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConf
|
||||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||||
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
||||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||||
|
import ru.bclib.sdf.SDF;
|
||||||
import ru.bclib.util.MHelper;
|
import ru.bclib.util.MHelper;
|
||||||
import ru.betterend.util.sdf.SDF;
|
|
||||||
import ru.betterend.world.structures.piece.VoxelPiece;
|
import ru.betterend.world.structures.piece.VoxelPiece;
|
||||||
|
|
||||||
public abstract class SDFStructureFeature extends FeatureBaseStructure {
|
public abstract class SDFStructureFeature extends FeatureBaseStructure {
|
||||||
|
|
|
@ -11,8 +11,8 @@ import net.minecraft.world.level.WorldGenLevel;
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||||
|
import ru.bclib.world.structures.StructureWorld;
|
||||||
import ru.betterend.registry.EndStructures;
|
import ru.betterend.registry.EndStructures;
|
||||||
import ru.betterend.world.structures.StructureWorld;
|
|
||||||
|
|
||||||
public class VoxelPiece extends BasePiece {
|
public class VoxelPiece extends BasePiece {
|
||||||
private StructureWorld world;
|
private StructureWorld world;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue