Finished tree shape
This commit is contained in:
parent
418f048ed3
commit
34318e283b
19 changed files with 120 additions and 137 deletions
|
@ -46,7 +46,7 @@ public class BushFeature extends DefaultFeature {
|
|||
sphere = new SDFDisplacement().setFunction((vec) -> { return MHelper.randRange(-2F, 2F, random); }).setSource(sphere);
|
||||
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
|
||||
sphere.setReplaceFunction(REPLACE);
|
||||
sphere.setPostProcess((info) -> {
|
||||
sphere.addPostProcess((info) -> {
|
||||
if (info.getState().getBlock() instanceof LeavesBlock) {
|
||||
int distance = info.getPos().getManhattanDistance(pos);
|
||||
if (distance < 7) {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class TenaneaBushFeature extends DefaultFeature {
|
|||
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
|
||||
sphere.setReplaceFunction(REPLACE);
|
||||
List<BlockPos> support = Lists.newArrayList();
|
||||
sphere.setPostProcess((info) -> {
|
||||
sphere.addPostProcess((info) -> {
|
||||
if (info.getState().getBlock() instanceof LeavesBlock) {
|
||||
int distance = info.getPos().getManhattanDistance(pos);
|
||||
if (distance < 7) {
|
||||
|
|
|
@ -43,7 +43,7 @@ public class FloatingSpireFeature extends SpireFeature {
|
|||
}).setSource(sdf);
|
||||
final BlockPos center = pos;
|
||||
List<BlockPos> support = Lists.newArrayList();
|
||||
sdf.setReplaceFunction(REPLACE).setPostProcess((info) -> {
|
||||
sdf.setReplaceFunction(REPLACE).addPostProcess((info) -> {
|
||||
if (info.getStateUp().isAir()) {
|
||||
if (random.nextInt(16) == 0) {
|
||||
support.add(info.getPos().up());
|
||||
|
|
|
@ -69,7 +69,7 @@ public class IceStarFeature extends DefaultFeature {
|
|||
final BlockState ancient = EndBlocks.ANCIENT_EMERALD_ICE.getDefaultState();
|
||||
final SDF sdfCopy = sdf;
|
||||
|
||||
sdf.setPostProcess((info) -> {
|
||||
sdf.addPostProcess((info) -> {
|
||||
BlockPos bpos = info.getPos();
|
||||
float px = bpos.getX() - center.getX();
|
||||
float py = bpos.getY() - center.getY();
|
||||
|
|
|
@ -45,7 +45,7 @@ public class SpireFeature extends DefaultFeature {
|
|||
}).setSource(sdf);
|
||||
final BlockPos center = pos;
|
||||
List<BlockPos> support = Lists.newArrayList();
|
||||
sdf.setReplaceFunction(REPLACE).setPostProcess((info) -> {
|
||||
sdf.setReplaceFunction(REPLACE).addPostProcess((info) -> {
|
||||
if (info.getStateUp().isAir()) {
|
||||
if (random.nextInt(16) == 0) {
|
||||
support.add(info.getPos().up());
|
||||
|
|
|
@ -68,7 +68,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
});
|
||||
|
||||
function.setReplaceFunction(REPLACE);
|
||||
function.setPostProcess(POST);
|
||||
function.addPostProcess(POST);
|
||||
function.fillRecursiveIgnore(world, pos, IGNORE);
|
||||
|
||||
return true;
|
||||
|
@ -124,7 +124,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 1.5F; }).setSource(sphere);
|
||||
sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere);
|
||||
Mutable mut = new Mutable();
|
||||
sphere.setPostProcess((info) -> {
|
||||
sphere.addPostProcess((info) -> {
|
||||
if (random.nextInt(5) == 0) {
|
||||
for (Direction dir: Direction.values()) {
|
||||
BlockState state = info.getState(dir, 2);
|
||||
|
|
|
@ -64,7 +64,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
dx = 30 * scale;
|
||||
float dy1 = -20 * scale;
|
||||
float dy2 = 100 * scale;
|
||||
sdf.setPostProcess(POST).fillArea(world, pos, new Box(pos.add(-dx, dy1, -dx), pos.add(dx, dy2, dx)));
|
||||
sdf.addPostProcess(POST).fillArea(world, pos, new Box(pos.add(-dx, dy1, -dx), pos.add(dx, dy2, dx)));
|
||||
SplineHelper.scale(spline, scale);
|
||||
SplineHelper.fillSplineForce(spline, world, EndBlocks.HELIX_TREE.bark.getDefaultState(), pos, (state) -> {
|
||||
return state.getMaterial().isReplaceable();
|
||||
|
|
|
@ -56,7 +56,7 @@ public class JellyshroomFeature extends DefaultFeature {
|
|||
final Vector3f last = spline.get(spline.size() - 1);
|
||||
cap = new SDFTranslate().setTranslate(last.getX(), last.getY(), last.getZ()).setSource(cap);
|
||||
sdf = new SDFSmoothUnion().setRadius(3F).setSourceA(sdf).setSourceB(cap);
|
||||
sdf.setReplaceFunction(REPLACE).setPostProcess((info) -> {
|
||||
sdf.setReplaceFunction(REPLACE).addPostProcess((info) -> {
|
||||
if (EndBlocks.JELLYSHROOM.isTreeLog(info.getState())) {
|
||||
if (EndBlocks.JELLYSHROOM.isTreeLog(info.getStateUp()) && EndBlocks.JELLYSHROOM.isTreeLog(info.getStateDown())) {
|
||||
return EndBlocks.JELLYSHROOM.log.getDefaultState();
|
||||
|
|
|
@ -58,7 +58,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
});
|
||||
|
||||
function.setReplaceFunction(REPLACE);
|
||||
function.setPostProcess(POST);
|
||||
function.addPostProcess(POST);
|
||||
function.fillRecursive(world, pos);
|
||||
|
||||
spline = spline.subList(4, 6);
|
||||
|
@ -110,7 +110,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere);
|
||||
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius - 2, 0).setSource(sphere));
|
||||
Mutable mut = new Mutable();
|
||||
sphere.setPostProcess((info) -> {
|
||||
sphere.addPostProcess((info) -> {
|
||||
if (random.nextInt(5) == 0) {
|
||||
for (Direction dir: Direction.values()) {
|
||||
BlockState state = info.getState(dir, 2);
|
||||
|
|
|
@ -80,7 +80,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
new SDFScale().setScale(scale)
|
||||
.setSource(FUNCTION)
|
||||
.setReplaceFunction(REPLACE)
|
||||
.setPostProcess((info) -> {
|
||||
.addPostProcess((info) -> {
|
||||
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) {
|
||||
if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
|
||||
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(MossyGlowshroomCapBlock.TRANSITION, true));
|
||||
|
|
|
@ -52,7 +52,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
|
|||
return EndBlocks.PYTHADENDRON.bark.getDefaultState();
|
||||
});
|
||||
function.setReplaceFunction(REPLACE);
|
||||
function.setPostProcess(POST);
|
||||
function.addPostProcess(POST);
|
||||
function.fillRecursive(world, pos);
|
||||
|
||||
return true;
|
||||
|
@ -115,7 +115,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
|
|||
sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere);
|
||||
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
|
||||
Mutable mut = new Mutable();
|
||||
sphere.setPostProcess((info) -> {
|
||||
sphere.addPostProcess((info) -> {
|
||||
if (random.nextInt(5) == 0) {
|
||||
for (Direction dir: Direction.values()) {
|
||||
BlockState state = info.getState(dir, 2);
|
||||
|
|
|
@ -89,7 +89,7 @@ public class TenaneaFeature extends DefaultFeature {
|
|||
BlockState outer = EndBlocks.TENANEA_OUTER_LEAVES.getDefaultState();
|
||||
|
||||
List<BlockPos> support = Lists.newArrayList();
|
||||
sphere.setPostProcess((info) -> {
|
||||
sphere.addPostProcess((info) -> {
|
||||
if (random.nextInt(6) == 0 && info.getStateDown().isAir()) {
|
||||
BlockPos d = info.getPos().down();
|
||||
support.add(d);
|
||||
|
|
|
@ -100,7 +100,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
|
|||
sdf = new SDFScale().setScale(scale).setSource(sdf);
|
||||
}
|
||||
|
||||
sdf.setReplaceFunction(REPLACE).setPostProcess((info) -> {
|
||||
sdf.setReplaceFunction(REPLACE).addPostProcess((info) -> {
|
||||
if (EndBlocks.UMBRELLA_TREE.isTreeLog(info.getStateUp()) && EndBlocks.UMBRELLA_TREE.isTreeLog(info.getStateDown())) {
|
||||
return EndBlocks.UMBRELLA_TREE.log.getDefaultState();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue