New textures and models

This commit is contained in:
paulevsGitch 2020-10-15 01:04:17 +03:00
parent e1f5779b0f
commit d4f56b152e
43 changed files with 153 additions and 17 deletions

View file

@ -5,6 +5,7 @@ import ru.betterend.world.features.DoublePlantFeature;
import ru.betterend.world.features.EndFeature; import ru.betterend.world.features.EndFeature;
import ru.betterend.world.features.EndLakeFeature; import ru.betterend.world.features.EndLakeFeature;
import ru.betterend.world.features.MossyGlowshroomFeature; import ru.betterend.world.features.MossyGlowshroomFeature;
import ru.betterend.world.features.PythadendronBushFeature;
import ru.betterend.world.features.PythadendronTreeFeature; import ru.betterend.world.features.PythadendronTreeFeature;
import ru.betterend.world.features.SinglePlantFeature; import ru.betterend.world.features.SinglePlantFeature;
import ru.betterend.world.features.VineFeature; import ru.betterend.world.features.VineFeature;
@ -12,13 +13,16 @@ import ru.betterend.world.features.VineFeature;
public class FeatureRegistry { public class FeatureRegistry {
// Trees // // Trees //
public static final EndFeature MOSSY_GLOWSHROOM = new EndFeature("mossy_glowshroom", new MossyGlowshroomFeature(), 3); public static final EndFeature MOSSY_GLOWSHROOM = new EndFeature("mossy_glowshroom", new MossyGlowshroomFeature(), 3);
public static final EndFeature PYTHADENDRON_TREE = new EndFeature("pythadendron_tree", new PythadendronTreeFeature(), 1); public static final EndFeature PYTHADENDRON_TREE = new EndFeature("pythadendron_tree", new PythadendronTreeFeature(), 2);
// Bushes //
public static final EndFeature PYTHADENDRON_BUSH = new EndFeature("pythadendron_bush", new PythadendronBushFeature(), 4);
// Plants // // Plants //
public static final EndFeature UMBRELLA_MOSS = new EndFeature("umbrella_moss", new DoublePlantFeature(BlockRegistry.UMBRELLA_MOSS, BlockRegistry.UMBRELLA_MOSS_TALL, 5), 5); public static final EndFeature UMBRELLA_MOSS = new EndFeature("umbrella_moss", new DoublePlantFeature(BlockRegistry.UMBRELLA_MOSS, BlockRegistry.UMBRELLA_MOSS_TALL, 5), 5);
public static final EndFeature CREEPING_MOSS = new EndFeature("creeping_moss", new SinglePlantFeature(BlockRegistry.CREEPING_MOSS, 5), 5); public static final EndFeature CREEPING_MOSS = new EndFeature("creeping_moss", new SinglePlantFeature(BlockRegistry.CREEPING_MOSS, 5), 5);
public static final EndFeature BLUE_VINE = new EndFeature("blue_vine", new BlueVineFeature(), 1); public static final EndFeature BLUE_VINE = new EndFeature("blue_vine", new BlueVineFeature(), 1);
public static final EndFeature CHORUS_GRASS = new EndFeature("chorus_grass", new SinglePlantFeature(BlockRegistry.CHORUS_GRASS, 4), 4); public static final EndFeature CHORUS_GRASS = new EndFeature("chorus_grass", new SinglePlantFeature(BlockRegistry.CHORUS_GRASS, 4), 5);
public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(BlockRegistry.DENSE_VINE, 24), 3); public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(BlockRegistry.DENSE_VINE, 24), 3);

View file

@ -1,6 +1,8 @@
package ru.betterend.world.biome; package ru.betterend.world.biome;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.world.gen.GenerationStep.Feature;
import net.minecraft.world.gen.feature.ConfiguredFeatures;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.BlockRegistry;
import ru.betterend.registry.EntityRegistry; import ru.betterend.registry.EntityRegistry;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.FeatureRegistry;
@ -17,6 +19,8 @@ public class BiomeChorusForest extends EndBiome {
.addFeature(FeatureRegistry.ENDER_ORE) .addFeature(FeatureRegistry.ENDER_ORE)
.addFeature(FeatureRegistry.RARE_END_LAKE) .addFeature(FeatureRegistry.RARE_END_LAKE)
.addFeature(FeatureRegistry.PYTHADENDRON_TREE) .addFeature(FeatureRegistry.PYTHADENDRON_TREE)
.addFeature(FeatureRegistry.PYTHADENDRON_BUSH)
.addFeature(Feature.VEGETAL_DECORATION, ConfiguredFeatures.CHORUS_PLANT)
.addFeature(FeatureRegistry.CHORUS_GRASS) .addFeature(FeatureRegistry.CHORUS_GRASS)
.addMobSpawn(EntityRegistry.END_SLIME, 5, 1, 2) .addMobSpawn(EntityRegistry.END_SLIME, 5, 1, 2)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));

View file

@ -0,0 +1,53 @@
package ru.betterend.world.features;
import java.util.Random;
import java.util.function.Function;
import net.minecraft.block.BlockState;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.Material;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockRegistry;
import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper;
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;
public class PythadendronBushFeature extends DefaultFeature {
private static final Function<BlockState, Boolean> REPLACE;
@Override
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
if (world.getBlockState(pos.down()).getBlock() != BlockRegistry.CHORUS_NYLIUM) return false;
float radius = MHelper.randRange(1.8F, 4.5F, random);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
SDF sphere = new SDFSphere().setRadius(radius).setBlock(BlockRegistry.PYTHADENDRON_LEAVES.getDefaultState().with(LeavesBlock.DISTANCE, 1));
sphere = new SDFScale3D().setScale(1, 0.5F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere);
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));
sphere.setReplaceFunction(REPLACE);
sphere.fillRecursive(world, pos);
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.PYTHADENDRON.bark);
return true;
}
static {
REPLACE = (state) -> {
if (state.getMaterial().equals(Material.PLANT)) {
return true;
}
return state.getMaterial().isReplaceable();
};
}
}

View file

@ -1,16 +1,22 @@
{ {
"variants": { "variants": {
"axis=x": { "axis=x": [
"model": "betterend:block/pythadendron_bark", { "model": "betterend:block/pythadendron_bark", "x": 90, "y": 90 },
"x": 90, { "model": "betterend:block/pythadendron_bark_2", "x": 90, "y": 90 },
"y": 90 { "model": "betterend:block/pythadendron_bark_3", "x": 90, "y": 90 },
}, { "model": "betterend:block/pythadendron_bark_4", "x": 90, "y": 90 }
"axis=y": { ],
"model": "betterend:block/pythadendron_bark" "axis=y": [
}, { "model": "betterend:block/pythadendron_bark" },
"axis=z": { { "model": "betterend:block/pythadendron_bark_2" },
"model": "betterend:block/pythadendron_bark", { "model": "betterend:block/pythadendron_bark_3" },
"x": 90 { "model": "betterend:block/pythadendron_bark_4" }
} ],
"axis=z": [
{ "model": "betterend:block/pythadendron_bark", "x": 90 },
{ "model": "betterend:block/pythadendron_bark_2", "x": 90 },
{ "model": "betterend:block/pythadendron_bark_3", "x": 90 },
{ "model": "betterend:block/pythadendron_bark_4", "x": 90 }
]
} }
} }

View file

@ -1,7 +1,22 @@
{ {
"variants": { "variants": {
"axis=x": { "model": "betterend:block/pythadendron_log", "x": 90, "y": 90 }, "axis=x": [
"axis=y": { "model": "betterend:block/pythadendron_log" }, { "model": "betterend:block/pythadendron_log", "x": 90, "y": 90 },
"axis=z": { "model": "betterend:block/pythadendron_log", "x": 90 } { "model": "betterend:block/pythadendron_log_2", "x": 90, "y": 90 },
{ "model": "betterend:block/pythadendron_log_3", "x": 90, "y": 90 },
{ "model": "betterend:block/pythadendron_log_4", "x": 90, "y": 90 }
],
"axis=y": [
{ "model": "betterend:block/pythadendron_log" },
{ "model": "betterend:block/pythadendron_log_2" },
{ "model": "betterend:block/pythadendron_log_3" },
{ "model": "betterend:block/pythadendron_log_4" }
],
"axis=z": [
{ "model": "betterend:block/pythadendron_log", "x": 90 },
{ "model": "betterend:block/pythadendron_log_2", "x": 90 },
{ "model": "betterend:block/pythadendron_log_3", "x": 90 },
{ "model": "betterend:block/pythadendron_log_4", "x": 90 }
]
} }
} }

View file

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "betterend:block/pythadendron_log_side_mossy"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "block/cube_mirrored_all",
"textures": {
"all": "betterend:block/pythadendron_log_side"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "block/cube_mirrored_all",
"textures": {
"all": "betterend:block/pythadendron_log_side_mossy"
}
}

View file

@ -0,0 +1,12 @@
{
"parent": "block/cube",
"textures": {
"down": "betterend:block/pythadendron_log_top",
"east": "betterend:block/pythadendron_log_side_mossy",
"north": "betterend:block/pythadendron_log_side_mossy",
"particle": "betterend:block/pythadendron_log_side_mossy",
"south": "betterend:block/pythadendron_log_side_mossy",
"up": "betterend:block/pythadendron_log_top",
"west": "betterend:block/pythadendron_log_side_mossy"
}
}

View file

@ -0,0 +1,12 @@
{
"parent": "block/cube_mirrored",
"textures": {
"down": "betterend:block/pythadendron_log_top",
"east": "betterend:block/pythadendron_log_side",
"north": "betterend:block/pythadendron_log_side",
"particle": "betterend:block/pythadendron_log_side",
"south": "betterend:block/pythadendron_log_side",
"up": "betterend:block/pythadendron_log_top",
"west": "betterend:block/pythadendron_log_side"
}
}

View file

@ -0,0 +1,12 @@
{
"parent": "block/cube_mirrored",
"textures": {
"down": "betterend:block/pythadendron_log_top",
"east": "betterend:block/pythadendron_log_side_mossy",
"north": "betterend:block/pythadendron_log_side_mossy",
"particle": "betterend:block/pythadendron_log_side_mossy",
"south": "betterend:block/pythadendron_log_side_mossy",
"up": "betterend:block/pythadendron_log_top",
"west": "betterend:block/pythadendron_log_side_mossy"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 711 B

After

Width:  |  Height:  |  Size: 711 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 134 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 171 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 228 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 261 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 645 B

After

Width:  |  Height:  |  Size: 645 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 720 B

After

Width:  |  Height:  |  Size: 720 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 611 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 606 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 614 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 590 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 606 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

After

Width:  |  Height:  |  Size: 718 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 635 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

After

Width:  |  Height:  |  Size: 682 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 681 B

After

Width:  |  Height:  |  Size: 681 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 619 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 488 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 237 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 B

After

Width:  |  Height:  |  Size: 570 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 482 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 297 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 324 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 322 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 249 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 189 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 195 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 585 B

Before After
Before After