Density fixes

This commit is contained in:
paulevsGitch 2020-12-24 21:45:12 +03:00
parent 2c2757ba8e
commit de0cf098ae
13 changed files with 78 additions and 23 deletions

View file

@ -80,7 +80,7 @@ public class EndFeatures {
public static final EndFeature LANCELEAF = new EndFeature("lanceleaf", new LanceleafFeature(), 3); public static final EndFeature LANCELEAF = new EndFeature("lanceleaf", new LanceleafFeature(), 3);
public static final EndFeature GLOW_PILLAR = new EndFeature("glow_pillar", new GlowPillarFeature(), 1); public static final EndFeature GLOW_PILLAR = new EndFeature("glow_pillar", new GlowPillarFeature(), 1);
public static final EndFeature TWISTED_UMBRELLA_MOSS = new EndFeature("twisted_umbrella_moss", new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS_TALL, 6), 5); public static final EndFeature TWISTED_UMBRELLA_MOSS = new EndFeature("twisted_umbrella_moss", new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS_TALL, 6), 5);
public static final EndFeature JUNGLE_GRASS = new EndFeature("jungle_grass", new CavePlantFeature(EndBlocks.JUNGLE_GRASS, 7), 8); public static final EndFeature JUNGLE_GRASS = new EndFeature("jungle_grass", new SinglePlantFeature(EndBlocks.JUNGLE_GRASS, 7, 3), 8);
// Vines // // Vines //
public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3); public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3);

View file

@ -10,6 +10,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.client.util.math.Vector3f; import net.minecraft.client.util.math.Vector3f;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.BlockPos.Mutable; import net.minecraft.util.math.BlockPos.Mutable;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
@ -124,14 +125,14 @@ public class UmbrellaTreeFeature extends DefaultFeature {
for (Center c: centers) { for (Center c: centers) {
if (!world.getBlockState(new BlockPos(c.px, c.py, c.pz)).isAir()) { if (!world.getBlockState(new BlockPos(c.px, c.py, c.pz)).isAir()) {
count = MHelper.floor(MHelper.randRange(1F, 5F, random) * scale); count = MHelper.floor(MHelper.randRange(5F, 10F, random) * scale);
float startAngle = random.nextFloat() * MHelper.PI2; float startAngle = random.nextFloat() * MHelper.PI2;
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
float angle = (float) i / count * MHelper.PI2 + startAngle; float angle = (float) i / count * MHelper.PI2 + startAngle;
float dist = MHelper.randRange(1.8F, 3.4F, random) * scale; float dist = MHelper.randRange(1.5F, 2.5F, random) * scale;
double px = c.px + Math.sin(angle) * dist; double px = c.px + Math.sin(angle) * dist;
double pz = c.pz + Math.cos(angle) * dist; double pz = c.pz + Math.cos(angle) * dist;
makeFruits(world, px, c.py - 1, pz, random, fruit, scale); makeFruits(world, px, c.py - 1, pz, fruit, scale);
} }
} }
} }
@ -175,18 +176,16 @@ public class UmbrellaTreeFeature extends DefaultFeature {
return sphere; return sphere;
} }
private void makeFruits(StructureWorldAccess world, double px, double py, double pz, Random random, BlockState fruit, float scale) { private void makeFruits(StructureWorldAccess world, double px, double py, double pz, BlockState fruit, float scale) {
Mutable mut = new Mutable(); Mutable mut = new Mutable().set(px, py, pz);
int length = MHelper.floor(MHelper.randRange(1F, 5F, random) * scale + 0.5F); for (int i = 0; i < 8; i++) {
for (int i = 0; i < length; i++) { mut.move(Direction.DOWN);
mut.setY(MHelper.floor(py - i));
double radius = (1 - (double) i / length) * 0.5;
for (int j = 0; j < 2; j++) {
mut.setX(MHelper.floor(random.nextGaussian() * radius + px + 0.5));
mut.setZ(MHelper.floor(random.nextGaussian() * radius + pz + 0.5));
if (world.isAir(mut)) { if (world.isAir(mut)) {
BlockState state = world.getBlockState(mut.up());
if (state.isOf(EndBlocks.UMBRELLA_TREE_MEMBRANE) && state.get(BlockUmbrellaTreeMembrane.COLOR) < 2) {
BlocksHelper.setWithoutUpdate(world, mut, fruit); BlocksHelper.setWithoutUpdate(world, mut, fruit);
} }
break;
} }
} }
} }

View file

@ -4,7 +4,15 @@
{ "model": "betterend:block/jungle_grass_01" }, { "model": "betterend:block/jungle_grass_01" },
{ "model": "betterend:block/jungle_grass_02" }, { "model": "betterend:block/jungle_grass_02" },
{ "model": "betterend:block/jungle_grass_03" }, { "model": "betterend:block/jungle_grass_03" },
{ "model": "betterend:block/jungle_grass_04" } { "model": "betterend:block/jungle_grass_04" },
{ "model": "betterend:block/jungle_grass_05" },
{ "model": "betterend:block/jungle_grass_06" },
{ "model": "betterend:block/jungle_grass_07" },
{ "model": "betterend:block/jungle_grass_08" },
{ "model": "betterend:block/jungle_grass_09" },
{ "model": "betterend:block/jungle_grass_10" },
{ "model": "betterend:block/jungle_grass_11" },
{ "model": "betterend:block/jungle_grass_12" }
] ]
} }
} }

View file

@ -4,32 +4,32 @@
"particle": "#texture" "particle": "#texture"
}, },
"elements": [ "elements": [
{ "from": [ 4, 0, 0 ], { "from": [ 4.1, 0, 0 ],
"to": [ 4, 16, 16 ], "to": [ 4.1, 16, 16 ],
"shade": false, "shade": false,
"faces": { "faces": {
"west": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" }, "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" } "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" }
} }
}, },
{ "from": [ 12, 0, 0 ], { "from": [ 11.9, 0, 0 ],
"to": [ 12, 16, 16 ], "to": [ 11.9, 16, 16 ],
"shade": false, "shade": false,
"faces": { "faces": {
"west": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" }, "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" } "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" }
} }
}, },
{ "from": [ 0, 0, 4 ], { "from": [ 0, 0, 4.1 ],
"to": [ 16, 16, 4 ], "to": [ 16, 16, 4.1 ],
"shade": false, "shade": false,
"faces": { "faces": {
"north": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" }, "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" },
"south": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" } "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" }
} }
}, },
{ "from": [ 0, 0, 12 ], { "from": [ 0, 0, 11.9 ],
"to": [ 16, 16, 12 ], "to": [ 16, 16, 11.9 ],
"shade": false, "shade": false,
"faces": { "faces": {
"north": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" }, "north": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" },

View file

@ -0,0 +1,6 @@
{
"parent": "block/cross",
"textures": {
"cross": "betterend:block/jungle_grass_2"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "betterend:block/crop_block",
"textures": {
"texture": "betterend:block/jungle_grass_2"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "betterend:block/cross_inverted",
"textures": {
"cross": "betterend:block/jungle_grass_2"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "betterend:block/crop_block_inverted",
"textures": {
"texture": "betterend:block/jungle_grass_2"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "block/cross",
"textures": {
"cross": "betterend:block/twisted_umbrella_moss_small"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "betterend:block/crop_block",
"textures": {
"texture": "betterend:block/twisted_umbrella_moss_small"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "betterend:block/cross_inverted",
"textures": {
"cross": "betterend:block/twisted_umbrella_moss_small"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "betterend:block/crop_block_inverted",
"textures": {
"texture": "betterend:block/twisted_umbrella_moss_small"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B