Amaranita mushroom blocks (WIP), shaders for new plants
This commit is contained in:
parent
5e3a3ef6cd
commit
4aec8487fa
33 changed files with 229 additions and 1 deletions
12
src/main/java/ru/betterend/blocks/AmaranitaHyphaeBlock.java
Normal file
12
src/main/java/ru/betterend/blocks/AmaranitaHyphaeBlock.java
Normal file
|
@ -0,0 +1,12 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.MaterialColor;
|
||||
import ru.betterend.blocks.basis.EndPillarBlock;
|
||||
|
||||
public class AmaranitaHyphaeBlock extends EndPillarBlock {
|
||||
public AmaranitaHyphaeBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).materialColor(MaterialColor.LIME));
|
||||
}
|
||||
}
|
|
@ -1,12 +1,45 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import ru.betterend.blocks.basis.EndPlantBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
public class SmallAmaranitaBlock extends EndPlantBlock {
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.getBlock() == EndBlocks.SANGNUM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) {
|
||||
BlockPos bigPos = growBig(world, pos);
|
||||
if (bigPos != null) {
|
||||
return;
|
||||
}
|
||||
EndFeatures.LARGE_AMARANITA.getFeature().generate(world, null, random, pos, null);
|
||||
}
|
||||
|
||||
private BlockPos growBig(ServerWorld world, BlockPos pos) {
|
||||
for (int x = -1; x < 2; x++) {
|
||||
for (int z = -1; z < 2; z++) {
|
||||
BlockPos p = pos.add(x, 0, z);
|
||||
if (checkFrame(world, p)) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean checkFrame(ServerWorld world, BlockPos pos) {
|
||||
return world.getBlockState(pos).isOf(this) ||
|
||||
world.getBlockState(pos.south()).isOf(this) ||
|
||||
world.getBlockState(pos.east()).isOf(this) ||
|
||||
world.getBlockState(pos.south().east()).isOf(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import ru.betterend.blocks.AeterniumAnvil;
|
|||
import ru.betterend.blocks.AeterniumBlock;
|
||||
import ru.betterend.blocks.AmaranitaCapBlock;
|
||||
import ru.betterend.blocks.AmaranitaHymenophoreBlock;
|
||||
import ru.betterend.blocks.AmaranitaHyphaeBlock;
|
||||
import ru.betterend.blocks.AmberBlock;
|
||||
import ru.betterend.blocks.AncientEmeraldIceBlock;
|
||||
import ru.betterend.blocks.AuroraCrystalBlock;
|
||||
|
@ -230,6 +231,8 @@ public class EndBlocks {
|
|||
public static final Block SALTEAGO = registerBlock("salteago", new TerrainPlantBlock(END_MOSS));
|
||||
public static final Block VAIOLUSH_FERN = registerBlock("vaiolush_fern", new TerrainPlantBlock(END_MOSS));
|
||||
public static final Block FRACTURN = registerBlock("fracturn", new TerrainPlantBlock(END_MOSS));
|
||||
public static final Block CLAWFERN = registerBlock("clawfern", new TerrainPlantBlock(SANGNUM));
|
||||
public static final Block GLOBULAGUS = registerBlock("globulagus", new TerrainPlantBlock(SANGNUM));
|
||||
public static final Block ORANGO = registerBlock("orango", new TerrainPlantBlock(RUTISCUS));
|
||||
public static final Block AERIDIUM = registerBlock("aeridium", new TerrainPlantBlock(RUTISCUS));
|
||||
public static final Block LUTEBUS = registerBlock("lutebus", new TerrainPlantBlock(RUTISCUS));
|
||||
|
@ -255,7 +258,7 @@ public class EndBlocks {
|
|||
|
||||
public static final Block SMALL_AMARANITA_MUSHROOM = registerBlock("small_amaranita_mushroom", new SmallAmaranitaBlock());
|
||||
public static final Block LARGE_AMARANITA_MUSHROOM = registerBlockNI("large_amaranita_mushroom", new LargeAmaranitaBlock());
|
||||
public static final Block AMARANITA_HYPHAE = registerBlock("amaranita_hyphae", new AmaranitaCapBlock());
|
||||
public static final Block AMARANITA_HYPHAE = registerBlock("amaranita_hyphae", new AmaranitaHyphaeBlock());
|
||||
public static final Block AMARANITA_HYMENOPHORE = registerBlock("amaranita_hymenophore", new AmaranitaHymenophoreBlock());
|
||||
public static final Block AMARANITA_FUR = registerBlock("amaranita_fur", new FurBlock(MOSSY_GLOWSHROOM_SAPLING, 15, 4));
|
||||
public static final Block AMARANITA_CAP = registerBlock("amaranita_cap", new AmaranitaCapBlock());
|
||||
|
|
|
@ -34,6 +34,7 @@ import ru.betterend.world.features.VineFeature;
|
|||
import ru.betterend.world.features.WallPlantFeature;
|
||||
import ru.betterend.world.features.WallPlantOnLogFeature;
|
||||
import ru.betterend.world.features.bushes.BushFeature;
|
||||
import ru.betterend.world.features.bushes.LargeAmaranitaFeature;
|
||||
import ru.betterend.world.features.bushes.Lumecorn;
|
||||
import ru.betterend.world.features.bushes.TenaneaBushFeature;
|
||||
import ru.betterend.world.features.terrain.EndLakeFeature;
|
||||
|
@ -75,6 +76,7 @@ public class EndFeatures {
|
|||
public static final EndFeature DRAGON_TREE_BUSH = new EndFeature("dragon_tree_bush", new BushFeature(EndBlocks.DRAGON_TREE_LEAVES, EndBlocks.DRAGON_TREE.bark), 15);
|
||||
public static final EndFeature TENANEA_BUSH = new EndFeature("tenanea_bush", new TenaneaBushFeature(), 10);
|
||||
public static final EndFeature LUMECORN = new EndFeature("lumecorn", new Lumecorn(), 5);
|
||||
public static final EndFeature LARGE_AMARANITA = new EndFeature("large_amaranita", new LargeAmaranitaFeature(), 5);
|
||||
|
||||
// Plants //
|
||||
public static final EndFeature UMBRELLA_MOSS = new EndFeature("umbrella_moss", new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS, EndBlocks.UMBRELLA_MOSS_TALL, 5), 5);
|
||||
|
@ -107,6 +109,9 @@ public class EndFeatures {
|
|||
public static final EndFeature AERIDIUM = new EndFeature("aeridium", new SinglePlantFeature(EndBlocks.AERIDIUM, 5, 4), 5);
|
||||
public static final EndFeature LUTEBUS = new EndFeature("lutebus", new SinglePlantFeature(EndBlocks.LUTEBUS, 5, 2), 5);
|
||||
public static final EndFeature LAMELLARIUM = new EndFeature("lamellarium", new SinglePlantFeature(EndBlocks.LAMELLARIUM, 5), 6);
|
||||
public static final EndFeature SMALL_AMARANITA = new EndFeature("small_amaranita", new SinglePlantFeature(EndBlocks.SMALL_AMARANITA_MUSHROOM, 5, 5), 4);
|
||||
public static final EndFeature GLOBULAGUS = new EndFeature("globulagus", new SinglePlantFeature(EndBlocks.GLOBULAGUS, 5, 3), 6);
|
||||
public static final EndFeature CLAWFERN = new EndFeature("clawfern", new SinglePlantFeature(EndBlocks.CLAWFERN, 5, 4), 5);
|
||||
|
||||
// Vines //
|
||||
public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3);
|
||||
|
|
|
@ -19,6 +19,10 @@ public class DragonGraveyardsBiome extends EndBiome {
|
|||
.addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT)
|
||||
.addFeature(EndFeatures.FALLEN_PILLAR)
|
||||
.addFeature(EndFeatures.OBSIDIAN_BOULDER)
|
||||
.addFeature(EndFeatures.LARGE_AMARANITA)
|
||||
.addFeature(EndFeatures.SMALL_AMARANITA)
|
||||
.addFeature(EndFeatures.GLOBULAGUS)
|
||||
.addFeature(EndFeatures.CLAWFERN)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package ru.betterend.world.features.bushes;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos.Mutable;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.util.MHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class LargeAmaranitaFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||
if (!world.getBlockState(pos.down()).getBlock().isIn(EndTags.END_GROUND)) return false;
|
||||
|
||||
Mutable mut = new Mutable().set(pos);
|
||||
int height = MHelper.randRange(2, 3, random);
|
||||
for (int i = 1; i < height; i++) {
|
||||
mut.setY(mut.getY() + 1);
|
||||
if (!world.isAir(mut)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
mut.set(pos);
|
||||
|
||||
BlockState state = EndBlocks.LARGE_AMARANITA_MUSHROOM.getDefaultState();
|
||||
BlocksHelper.setWithUpdate(world, mut, state.with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
|
||||
if (height > 2) {
|
||||
BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), state.with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
|
||||
}
|
||||
BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), state.with(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"axis=x": { "model": "betterend:block/amaranita_hyphae", "x": 90, "y": 90 },
|
||||
"axis=y": { "model": "betterend:block/amaranita_hyphae" },
|
||||
"axis=z": { "model": "betterend:block/amaranita_hyphae", "x": 90 }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"variants": {
|
||||
"": [
|
||||
{ "model": "betterend:block/clawfern_01" },
|
||||
{ "model": "betterend:block/clawfern_02" }
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"variants": {
|
||||
"": [
|
||||
{ "model": "betterend:block/globulagus_01" },
|
||||
{ "model": "betterend:block/globulagus_02" },
|
||||
{ "model": "betterend:block/globulagus_03" },
|
||||
{ "model": "betterend:block/globulagus_04" }
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"defaultMaterial": "betterend:waving_floor_glow_green"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"defaultMaterial": "betterend:waving_floor_glow_green"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"layers": [
|
||||
{
|
||||
"vertexSource": "betterend:shaders/material/wave_floor.vert",
|
||||
"fragmentSource": "betterend:shaders/material/glow_green_2.frag",
|
||||
"disableAo": true,
|
||||
"disableDiffuse": true
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"parent": "block/cube",
|
||||
"textures": {
|
||||
"down": "betterend:block/amaranita_hyphae_top",
|
||||
"east": "betterend:block/amaranita_hyphae_side",
|
||||
"north": "betterend:block/amaranita_hyphae_side",
|
||||
"particle": "betterend:block/amaranita_hyphae_side",
|
||||
"south": "betterend:block/amaranita_hyphae_side",
|
||||
"up": "betterend:block/amaranita_hyphae_top",
|
||||
"west": "betterend:block/amaranita_hyphae_side"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "block/cross",
|
||||
"textures": {
|
||||
"cross": "betterend:block/clawfern"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "betterend:block/cross_inverted",
|
||||
"textures": {
|
||||
"cross": "betterend:block/clawfern"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "block/cross",
|
||||
"textures": {
|
||||
"cross": "betterend:block/globulagus"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "betterend:block/crop_block",
|
||||
"textures": {
|
||||
"texture": "betterend:block/globulagus"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "betterend:block/cross_inverted",
|
||||
"textures": {
|
||||
"cross": "betterend:block/globulagus"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "betterend:block/crop_block_inverted",
|
||||
"textures": {
|
||||
"texture": "betterend:block/globulagus"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "betterend:block/amaranita_hyphae"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "betterend:block/clawfern"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "betterend:block/globulagus"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#include frex:shaders/api/fragment.glsl
|
||||
#include frex:shaders/lib/math.glsl
|
||||
|
||||
void frx_startFragment(inout frx_FragmentData fragData) {
|
||||
float a = abs(fragData.spriteColor.b - fragData.spriteColor.r);
|
||||
float b = abs(fragData.spriteColor.b - fragData.spriteColor.g);
|
||||
fragData.emissivity = (a > 0.1 && b > 0.1 && fragData.spriteColor.b > 0.1) ? 0.5 : 0;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#include frex:shaders/api/fragment.glsl
|
||||
#include frex:shaders/lib/math.glsl
|
||||
|
||||
void frx_startFragment(inout frx_FragmentData fragData) {
|
||||
float a = abs(fragData.spriteColor.g - fragData.spriteColor.r);
|
||||
float b = abs(fragData.spriteColor.g - fragData.spriteColor.b);
|
||||
fragData.emissivity = (fragData.spriteColor.g > 0.3) ? 0.3 : 0;
|
||||
}
|
BIN
src/main/resources/assets/betterend/textures/block/clawfern.png
Normal file
BIN
src/main/resources/assets/betterend/textures/block/clawfern.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 248 B |
Binary file not shown.
After Width: | Height: | Size: 250 B |
Loading…
Add table
Add a link
Reference in a new issue