diff --git a/src/main/java/ru/betterend/blocks/AmaranitaHyphaeBlock.java b/src/main/java/ru/betterend/blocks/AmaranitaHyphaeBlock.java new file mode 100644 index 00000000..c8063000 --- /dev/null +++ b/src/main/java/ru/betterend/blocks/AmaranitaHyphaeBlock.java @@ -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)); + } +} diff --git a/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java b/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java index 4b2f6563..10c6e631 100644 --- a/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java +++ b/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java @@ -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); + } } diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index 4835bf46..b3fd0614 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -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()); diff --git a/src/main/java/ru/betterend/registry/EndFeatures.java b/src/main/java/ru/betterend/registry/EndFeatures.java index 6ce1e508..6e1e5b3b 100644 --- a/src/main/java/ru/betterend/registry/EndFeatures.java +++ b/src/main/java/ru/betterend/registry/EndFeatures.java @@ -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); diff --git a/src/main/java/ru/betterend/world/biome/DragonGraveyardsBiome.java b/src/main/java/ru/betterend/world/biome/DragonGraveyardsBiome.java index 41500b94..7535e700 100644 --- a/src/main/java/ru/betterend/world/biome/DragonGraveyardsBiome.java +++ b/src/main/java/ru/betterend/world/biome/DragonGraveyardsBiome.java @@ -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)); } } diff --git a/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java b/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java new file mode 100644 index 00000000..58990979 --- /dev/null +++ b/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java @@ -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; + } +} diff --git a/src/main/resources/assets/betterend/blockstates/amaranita_hyphae.json b/src/main/resources/assets/betterend/blockstates/amaranita_hyphae.json new file mode 100644 index 00000000..c49368de --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/amaranita_hyphae.json @@ -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 } + } +} diff --git a/src/main/resources/assets/betterend/blockstates/clawfern.json b/src/main/resources/assets/betterend/blockstates/clawfern.json new file mode 100644 index 00000000..043b6ae0 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/clawfern.json @@ -0,0 +1,8 @@ +{ + "variants": { + "": [ + { "model": "betterend:block/clawfern_01" }, + { "model": "betterend:block/clawfern_02" } + ] + } +} diff --git a/src/main/resources/assets/betterend/blockstates/globulagus.json b/src/main/resources/assets/betterend/blockstates/globulagus.json new file mode 100644 index 00000000..f818fddc --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/globulagus.json @@ -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" } + ] + } +} diff --git a/src/main/resources/assets/betterend/materialmaps/block/clawfern.json b/src/main/resources/assets/betterend/materialmaps/block/clawfern.json new file mode 100644 index 00000000..de846edf --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/block/clawfern.json @@ -0,0 +1,3 @@ +{ + "defaultMaterial": "betterend:waving_floor_glow_green" +} diff --git a/src/main/resources/assets/betterend/materialmaps/block/globulagus.json b/src/main/resources/assets/betterend/materialmaps/block/globulagus.json new file mode 100644 index 00000000..de846edf --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/block/globulagus.json @@ -0,0 +1,3 @@ +{ + "defaultMaterial": "betterend:waving_floor_glow_green" +} diff --git a/src/main/resources/assets/betterend/materialmaps/item/aeridium.json b/src/main/resources/assets/betterend/materialmaps/item/aeridium.json new file mode 100644 index 00000000..69a88e3b --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/item/aeridium.json @@ -0,0 +1 @@ +{} diff --git a/src/main/resources/assets/betterend/materialmaps/item/clawfern.json b/src/main/resources/assets/betterend/materialmaps/item/clawfern.json new file mode 100644 index 00000000..69a88e3b --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/item/clawfern.json @@ -0,0 +1 @@ +{} diff --git a/src/main/resources/assets/betterend/materialmaps/item/globulagus.json b/src/main/resources/assets/betterend/materialmaps/item/globulagus.json new file mode 100644 index 00000000..69a88e3b --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/item/globulagus.json @@ -0,0 +1 @@ +{} diff --git a/src/main/resources/assets/betterend/materialmaps/item/lamellarium.json b/src/main/resources/assets/betterend/materialmaps/item/lamellarium.json new file mode 100644 index 00000000..69a88e3b --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/item/lamellarium.json @@ -0,0 +1 @@ +{} diff --git a/src/main/resources/assets/betterend/materialmaps/item/lutebus.json b/src/main/resources/assets/betterend/materialmaps/item/lutebus.json new file mode 100644 index 00000000..69a88e3b --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/item/lutebus.json @@ -0,0 +1 @@ +{} diff --git a/src/main/resources/assets/betterend/materialmaps/item/orango.json b/src/main/resources/assets/betterend/materialmaps/item/orango.json new file mode 100644 index 00000000..69a88e3b --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/item/orango.json @@ -0,0 +1 @@ +{} diff --git a/src/main/resources/assets/betterend/materialmaps/item/small_amaranita.json b/src/main/resources/assets/betterend/materialmaps/item/small_amaranita.json new file mode 100644 index 00000000..69a88e3b --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/item/small_amaranita.json @@ -0,0 +1 @@ +{} diff --git a/src/main/resources/assets/betterend/materials/waving_floor_glow_green.json b/src/main/resources/assets/betterend/materials/waving_floor_glow_green.json new file mode 100644 index 00000000..25d1427b --- /dev/null +++ b/src/main/resources/assets/betterend/materials/waving_floor_glow_green.json @@ -0,0 +1,10 @@ +{ + "layers": [ + { + "vertexSource": "betterend:shaders/material/wave_floor.vert", + "fragmentSource": "betterend:shaders/material/glow_green_2.frag", + "disableAo": true, + "disableDiffuse": true + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/amaranita_hyphae.json b/src/main/resources/assets/betterend/models/block/amaranita_hyphae.json new file mode 100644 index 00000000..ddef4114 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/amaranita_hyphae.json @@ -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" + } +} diff --git a/src/main/resources/assets/betterend/models/block/clawfern_01.json b/src/main/resources/assets/betterend/models/block/clawfern_01.json new file mode 100644 index 00000000..99c9d784 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/clawfern_01.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/clawfern" + } +} diff --git a/src/main/resources/assets/betterend/models/block/clawfern_02.json b/src/main/resources/assets/betterend/models/block/clawfern_02.json new file mode 100644 index 00000000..d8ea43a5 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/clawfern_02.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/cross_inverted", + "textures": { + "cross": "betterend:block/clawfern" + } +} diff --git a/src/main/resources/assets/betterend/models/block/globulagus_01.json b/src/main/resources/assets/betterend/models/block/globulagus_01.json new file mode 100644 index 00000000..8b7eac5b --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/globulagus_01.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/globulagus" + } +} diff --git a/src/main/resources/assets/betterend/models/block/globulagus_02.json b/src/main/resources/assets/betterend/models/block/globulagus_02.json new file mode 100644 index 00000000..cc5ff783 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/globulagus_02.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/crop_block", + "textures": { + "texture": "betterend:block/globulagus" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/globulagus_03.json b/src/main/resources/assets/betterend/models/block/globulagus_03.json new file mode 100644 index 00000000..db3512a7 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/globulagus_03.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/cross_inverted", + "textures": { + "cross": "betterend:block/globulagus" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/globulagus_04.json b/src/main/resources/assets/betterend/models/block/globulagus_04.json new file mode 100644 index 00000000..65d297b6 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/globulagus_04.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/crop_block_inverted", + "textures": { + "texture": "betterend:block/globulagus" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/item/amaranita_hyphae.json b/src/main/resources/assets/betterend/models/item/amaranita_hyphae.json new file mode 100644 index 00000000..0277110e --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/amaranita_hyphae.json @@ -0,0 +1,3 @@ +{ + "parent": "betterend:block/amaranita_hyphae" +} diff --git a/src/main/resources/assets/betterend/models/item/clawfern.json b/src/main/resources/assets/betterend/models/item/clawfern.json new file mode 100644 index 00000000..973dafb8 --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/clawfern.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betterend:block/clawfern" + } +} diff --git a/src/main/resources/assets/betterend/models/item/globulagus.json b/src/main/resources/assets/betterend/models/item/globulagus.json new file mode 100644 index 00000000..0fd492a6 --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/globulagus.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betterend:block/globulagus" + } +} diff --git a/src/main/resources/assets/betterend/shaders/material/glow_25_blue_half.frag b/src/main/resources/assets/betterend/shaders/material/glow_25_blue_half.frag new file mode 100644 index 00000000..a40e0424 --- /dev/null +++ b/src/main/resources/assets/betterend/shaders/material/glow_25_blue_half.frag @@ -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; +} diff --git a/src/main/resources/assets/betterend/shaders/material/glow_green_2.frag b/src/main/resources/assets/betterend/shaders/material/glow_green_2.frag new file mode 100644 index 00000000..8a3c3722 --- /dev/null +++ b/src/main/resources/assets/betterend/shaders/material/glow_green_2.frag @@ -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; +} diff --git a/src/main/resources/assets/betterend/textures/block/clawfern.png b/src/main/resources/assets/betterend/textures/block/clawfern.png new file mode 100644 index 00000000..edb93e21 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/clawfern.png differ diff --git a/src/main/resources/assets/betterend/textures/block/globulagus.png b/src/main/resources/assets/betterend/textures/block/globulagus.png new file mode 100644 index 00000000..2a3026ef Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/globulagus.png differ