Crystal grass & small changes

This commit is contained in:
paulevsGitch 2020-10-26 06:03:54 +03:00
parent 4073e0a32c
commit 7de70c9553
22 changed files with 376 additions and 14 deletions

View file

@ -90,6 +90,7 @@ public class BlockRegistry {
public static final Block CREEPING_MOSS = registerBlock("creeping_moss", new BlockGlowingMoss(11));
public static final Block CHORUS_GRASS = registerBlock("chorus_grass", new BlockChorusGrass());
public static final Block CAVE_GRASS = registerBlock("cave_grass", new BlockTerrainPlant(CAVE_MOSS));
public static final Block CRYSTAL_GRASS = registerBlock("crystal_grass", new BlockTerrainPlant(CRYSTAL_MOSS));
public static final Block BLUE_VINE_SEED = registerBlock("blue_vine_seed", new BlockBlueVineSeed());
public static final Block BLUE_VINE = registerBlockNI("blue_vine", new BlockBlueVine());

View file

@ -3,6 +3,7 @@ package ru.betterend.registry;
import net.fabricmc.fabric.api.tag.TagRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItem;
import net.minecraft.tag.BlockTags;
import net.minecraft.tag.Tag;
import net.minecraft.tag.Tag.Identified;
@ -11,6 +12,7 @@ import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biome.Category;
import net.minecraft.world.gen.surfacebuilder.SurfaceConfig;
import ru.betterend.BetterEnd;
import ru.betterend.blocks.BlockTerrain;
import ru.betterend.util.TagHelper;
public class BlockTagRegistry {
@ -22,14 +24,17 @@ public class BlockTagRegistry {
}
public static void register() {
addSurfaceBlock(BlockRegistry.END_MOSS);
addSurfaceBlock(BlockRegistry.END_MYCELIUM);
addSurfaceBlock(BlockRegistry.CHORUS_NYLIUM);
addSurfaceBlock(BlockRegistry.ENDSTONE_DUST);
addSurfaceBlock(BlockRegistry.CAVE_MOSS);
ItemRegistry.getModBlocks().forEach((item) -> {
Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockTerrain) {
addSurfaceBlock(block);
TagHelper.addTag(BlockTags.NYLIUM, block);
}
});
TagHelper.addTag(GEN_TERRAIN, BlockRegistry.ENDER_ORE, BlockRegistry.FLAVOLITE.stone, BlockRegistry.VIOLECITE.stone);
TagHelper.addTag(BlockTags.NYLIUM, BlockRegistry.END_MOSS, BlockRegistry.END_MYCELIUM, BlockRegistry.CHORUS_NYLIUM, BlockRegistry.CAVE_MOSS);
}
public static void addSurfaceBlock(Block block) {

View file

@ -42,6 +42,7 @@ public class FeatureRegistry {
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), 5);
public static final EndFeature CAVE_GRASS = new EndFeature("cave_grass", new CavePlantFeature(BlockRegistry.CAVE_GRASS, 7), 7);
public static final EndFeature CRYSTAL_GRASS = new EndFeature("crystal_grass", new SinglePlantFeature(BlockRegistry.CRYSTAL_GRASS, 8, false), 5);
public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(BlockRegistry.DENSE_VINE, 24), 3);
@ -75,7 +76,7 @@ public class FeatureRegistry {
if (pos < features.size()) {
List<Supplier<ConfiguredFeature<?, ?>>> list = features.get(pos);
// If only chorus plants are enabled
if (list.size() < 2) {
if (list.size() == 1) {
features.get(pos).clear();
}
}

View file

@ -1,6 +1,5 @@
package ru.betterend.world.biome;
import net.minecraft.block.Blocks;
import net.minecraft.entity.EntityType;
import ru.betterend.registry.BlockRegistry;
import ru.betterend.registry.FeatureRegistry;
@ -11,10 +10,11 @@ public class BiomeCrystalMountains extends EndBiome {
public BiomeCrystalMountains() {
super(new BiomeDefinition("crystal_mountains")
.setPlantsColor(255, 133, 211)
.setSurface(BlockRegistry.CRYSTAL_MOSS, Blocks.END_STONE)
.setSurface(BlockRegistry.CRYSTAL_MOSS)
.setMusic(SoundRegistry.MUSIC_CRYSTAL_MOUNTAINS)
.addStructureFeature(StructureRegistry.MOUNTAIN)
.addFeature(FeatureRegistry.ROUND_CAVE)
.addFeature(FeatureRegistry.CRYSTAL_GRASS)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -39,7 +39,7 @@ public abstract class ScatterFeature extends DefaultFeature {
protected boolean getGroundPlant(StructureWorldAccess world, Mutable pos) {
int down = BlocksHelper.downRay(world, pos, 16);
if (down > 10) {
if (down > Math.abs(getYOffset() * 2)) {
return false;
}
pos.setY(pos.getY() - down);

View file

@ -11,10 +11,21 @@ import ru.betterend.util.BlocksHelper;
public class SinglePlantFeature extends ScatterFeature {
private final Block plant;
private final boolean rawHeightmap;
public SinglePlantFeature(Block plant, int radius) {
this(plant, radius, true);
}
public SinglePlantFeature(Block plant, int radius, boolean rawHeightmap) {
super(radius);
this.plant = plant;
this.rawHeightmap = rawHeightmap;
}
@Override
protected BlockPos getCenterGround(StructureWorldAccess world, BlockPos pos) {
return rawHeightmap ? getPosOnSurfaceWG(world, pos) : getPosOnSurface(world, pos);
}
@Override

View file

@ -104,8 +104,8 @@ public class MountainPiece extends BasePiece {
maxY *= (float) noise.eval(px * 0.1, pz * 0.1) * 0.1F + 0.8F;
maxY += 56;
int cover = (int) (maxY - 1);
boolean needCover = noise.eval(px * 0.3, pz * 0.3) > 0 && (noise.eval(px * 0.03, pz * 0.03) - (maxY - 60) * 0.2) > 0;
for (int y = minY; y < maxY; y++) {
boolean needCover = (noise.eval(px * 0.1, pz * 0.1) + MHelper.randRange(-0.4, 0.4, random) - (maxY - 70) * 0.1) > 0;
for (int y = minY - 1; y < maxY; y++) {
pos.setY(y);
chunk.setBlockState(pos, needCover && y >= cover ? top : Blocks.END_STONE.getDefaultState(), false);
}

View file

@ -0,0 +1,22 @@
{
"variants": {
"": [
{ "model": "betterend:block/crystal_grass_1" },
{ "model": "betterend:block/crystal_grass_2", "weight": 1 },
{ "model": "betterend:block/crystal_grass_3", "weight": 2 },
{ "model": "betterend:block/crystal_grass_4", "weight": 3 },
{ "model": "betterend:block/crystal_grass_1", "y": 90 },
{ "model": "betterend:block/crystal_grass_2", "y": 90, "weight": 1 },
{ "model": "betterend:block/crystal_grass_3", "y": 90, "weight": 2 },
{ "model": "betterend:block/crystal_grass_4", "y": 90, "weight": 3 },
{ "model": "betterend:block/crystal_grass_1", "y": 180 },
{ "model": "betterend:block/crystal_grass_2", "y": 180, "weight": 1 },
{ "model": "betterend:block/crystal_grass_3", "y": 180, "weight": 2 },
{ "model": "betterend:block/crystal_grass_4", "y": 180, "weight": 3 },
{ "model": "betterend:block/crystal_grass_1", "y": 270 },
{ "model": "betterend:block/crystal_grass_2", "y": 270, "weight": 1 },
{ "model": "betterend:block/crystal_grass_3", "y": 270, "weight": 2 },
{ "model": "betterend:block/crystal_grass_4", "y": 270, "weight": 3 }
]
}
}

View file

@ -196,5 +196,6 @@
"block.betterend.crystal_moss_path": "Crystal Moss Path",
"block.betterend.pythadendron_leaves": "Pythadendron Leaves",
"item.betterend.eternal_crystal": "Eternal Crystal",
"item.betterend.spawn_egg_end_fish": "End Fish Spawn Egg"
"item.betterend.spawn_egg_end_fish": "End Fish Spawn Egg",
"block.betterend.crystal_grass": "Crystal Grass"
}

View file

@ -192,11 +192,12 @@
"block.betterend.cave_bush": "Пещерный куст",
"block.betterend.cave_moss_path": "Тропа из пещерного мха",
"block.betterend.crystal_moss": "Кристаллический мох",
"block.betterend.crystal_moss": "Кристальный мох",
"block.betterend.crystal_moss_path": "Тропа из кристаллический мох",
"block.betterend.pythadendron_leaves": "Листья пифодендрона",
"block.betterend.violecite_polished": "Полированный виолецит",
"block.betterend.violecite_tiles": "Виолецитовая плитка",
"item.betterend.eternal_crystal": "Вечный кристалл",
"item.betterend.spawn_egg_end_fish": "Яйцо призыва рыбы Края"
"item.betterend.spawn_egg_end_fish": "Яйцо призыва рыбы Края",
"block.betterend.crystal_grass": "Кристальная трава"
}

View file

@ -0,0 +1,126 @@
{
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
"textures": {
"particle": "betterend:block/crystal_grass_2",
"texture": "betterend:block/crystal_grass_2"
},
"elements": [
{
"__comment": "PlaneX3",
"from": [ 2, 0, 2 ],
"to": [ 2.001, 9, 18 ],
"rotation": { "origin": [ 2, 0, 2 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 7, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 7, 0, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneX3",
"from": [ 14, 0, 2 ],
"to": [ 14.001, 9, 18 ],
"rotation": { "origin": [ 14, 0, 2 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 7, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 7, 0, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 5.5, 8.5, 5.5 ],
"to": [ 10.5, 8.501, 10.5 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 4.5, 8, 8 ],
"to": [ 9.5, 8.001, 13 ],
"rotation": { "origin": [ 4.5, 8, 8 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 1.125, 3.5, 1 ],
"to": [ 6.125, 3.501, 6 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 0.125, 3, 3.5 ],
"to": [ 5.125, 3.001, 8.5 ],
"rotation": { "origin": [ 0.125, 3, 3.5 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 9.75, 3.5, 1.25 ],
"to": [ 14.75, 3.501, 6.25 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 8.75, 3, 3.75 ],
"to": [ 13.75, 3.001, 8.75 ],
"rotation": { "origin": [ 8.75, 3, 3.75 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 9, 4.5, 9.125 ],
"to": [ 14, 4.501, 14.125 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 8, 4, 11.625 ],
"to": [ 13, 4.001, 16.625 ],
"rotation": { "origin": [ 8, 4, 11.625 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 2, 4.5, 9 ],
"to": [ 7, 4.501, 14 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 1, 4, 11.5 ],
"to": [ 6, 4.001, 16.5 ],
"rotation": { "origin": [ 1, 4, 11.5 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
}
]
}

View file

@ -0,0 +1,107 @@
{
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
"textures": {
"particle": "betterend:block/crystal_grass_3",
"texture": "betterend:block/crystal_grass_3"
},
"elements": [
{
"__comment": "PlaneX3",
"from": [ 2, 0, 2 ],
"to": [ 2.001, 9, 18 ],
"rotation": { "origin": [ 2, 0, 2 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 7, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 7, 0, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneX3",
"from": [ 14, 0, 2 ],
"to": [ 14.001, 9, 18 ],
"rotation": { "origin": [ 14, 0, 2 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 7, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 7, 0, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 3, 8.5, 3 ],
"to": [ 8, 8.501, 8 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 2, 8, 5.5 ],
"to": [ 7, 8.001, 10.5 ],
"rotation": { "origin": [ 2, 8, 5.5 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 8.375, 8.5, 2.625 ],
"to": [ 13.375, 8.501, 7.625 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 7.375, 8, 5.125 ],
"to": [ 12.375, 8.001, 10.125 ],
"rotation": { "origin": [ 7.375, 8, 5.125 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 3.5, 4.5, 7.5 ],
"to": [ 8.5, 4.501, 12.5 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 2.5, 4, 10 ],
"to": [ 7.5, 4.001, 15 ],
"rotation": { "origin": [ 2.5, 4, 10 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 8, 5, 7 ],
"to": [ 13, 5.001, 12 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 7, 4.5, 9.5 ],
"to": [ 12, 4.501, 14.5 ],
"rotation": { "origin": [ 7, 4.5, 9.5 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
}
]
}

View file

@ -0,0 +1,50 @@
{
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
"textures": {
"particle": "betterend:block/crystal_grass_4",
"texture": "betterend:block/crystal_grass_4"
},
"elements": [
{
"__comment": "PlaneX3",
"from": [ 2.5, 0, 2.5 ],
"to": [ 2.501, 9, 18.5 ],
"rotation": { "origin": [ 2.5, 0, 2.5 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 7, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 7, 0, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneX3",
"from": [ 13.5, 0, 2.5 ],
"to": [ 13.501, 9, 18.5 ],
"rotation": { "origin": [ 13.5, 0, 2.5 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 7, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 7, 0, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 5.5, 8.5, 5.5 ],
"to": [ 10.5, 8.501, 10.5 ],
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneY6",
"from": [ 4.5, 8, 8 ],
"to": [ 9.5, 8.001, 13 ],
"rotation": { "origin": [ 4.5, 8, 8 ], "axis": "y", "angle": 45 },
"faces": {
"down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" },
"up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }
}
}
]
}

View file

@ -0,0 +1,31 @@
{
"__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio",
"textures": {
"particle": "betterend:block/crystal_grass_5",
"texture": "betterend:block/crystal_grass_5"
},
"elements": [
{
"__comment": "PlaneX3",
"from": [ 2.5, 0, 2.5 ],
"to": [ 2.501, 10, 18.5 ],
"rotation": { "origin": [ 2.5, 0, 2.5 ], "axis": "y", "angle": 45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 6, 0, 16 ], "texture": "#texture" }
}
},
{
"__comment": "PlaneX3",
"from": [ 13.5, 0, 2.5 ],
"to": [ 13.501, 10, 18.5 ],
"rotation": { "origin": [ 13.5, 0, 2.5 ], "axis": "y", "angle": -45 },
"shade": false,
"faces": {
"west": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 16, 6, 0, 16 ], "texture": "#texture" }
}
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "betterend:block/crystal_grass_5"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Before After
Before After