diff --git a/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java b/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java index ba5edf0c..d8b08fa2 100644 --- a/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java +++ b/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java @@ -29,6 +29,8 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp public static final Vec3i[] COLORS; private static final int MIN_DROP = 1; private static final int MAX_DROP = 4; + private static final BlockColorProvider BLOCK_PROVIDER; + private static final ItemColorProvider ITEM_PROVIDER; public AuroraCrystalBlock() { super(FabricBlockSettings.of(Material.GLASS) @@ -43,30 +45,12 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp @Override public BlockColorProvider getProvider() { - return (state, world, pos, tintIndex) -> { - long i = (long) pos.getX() + (long) pos.getY() + (long) pos.getZ(); - double delta = i * 0.1; - int index = MHelper.floor(delta); - int index2 = (index + 1) & 3; - delta -= index; - index &= 3; - - Vec3i color1 = COLORS[index]; - Vec3i color2 = COLORS[index2]; - - int r = MHelper.floor(MathHelper.lerp(delta, color1.getX(), color2.getX())); - int g = MHelper.floor(MathHelper.lerp(delta, color1.getY(), color2.getY())); - int b = MHelper.floor(MathHelper.lerp(delta, color1.getZ(), color2.getZ())); - - return MHelper.color(r, g, b); - }; + return BLOCK_PROVIDER; } @Override public ItemColorProvider getItemProvider() { - return (stack, tintIndex) -> { - return MHelper.color(COLORS[3].getX(), COLORS[3].getY(), COLORS[3].getZ()); - }; + return ITEM_PROVIDER; } @Override @@ -106,5 +90,27 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp new Vec3i(120, 255, 168), new Vec3i(243, 58, 255) }; + + BLOCK_PROVIDER = (state, world, pos, tintIndex) -> { + long i = (long) pos.getX() + (long) pos.getY() + (long) pos.getZ(); + double delta = i * 0.1; + int index = MHelper.floor(delta); + int index2 = (index + 1) & 3; + delta -= index; + index &= 3; + + Vec3i color1 = COLORS[index]; + Vec3i color2 = COLORS[index2]; + + int r = MHelper.floor(MathHelper.lerp(delta, color1.getX(), color2.getX())); + int g = MHelper.floor(MathHelper.lerp(delta, color1.getY(), color2.getY())); + int b = MHelper.floor(MathHelper.lerp(delta, color1.getZ(), color2.getZ())); + + return MHelper.color(r, g, b); + }; + + ITEM_PROVIDER = (stack, tintIndex) -> { + return MHelper.color(COLORS[3].getX(), COLORS[3].getY(), COLORS[3].getZ()); + }; } } diff --git a/src/main/java/ru/betterend/blocks/BlockBlueVineSeed.java b/src/main/java/ru/betterend/blocks/BlockBlueVineSeed.java index 3c7ae9d2..feaedc89 100644 --- a/src/main/java/ru/betterend/blocks/BlockBlueVineSeed.java +++ b/src/main/java/ru/betterend/blocks/BlockBlueVineSeed.java @@ -7,7 +7,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.StructureWorldAccess; import ru.betterend.blocks.BlockProperties.TripleShape; -import ru.betterend.blocks.basis.BlockGlowingFur; +import ru.betterend.blocks.basis.BlockFur; import ru.betterend.blocks.basis.BlockPlantWithAge; import ru.betterend.registry.EndBlocks; import ru.betterend.util.BlocksHelper; @@ -34,11 +34,11 @@ public class BlockBlueVineSeed extends BlockPlantWithAge { for (Direction dir: BlocksHelper.HORIZONTAL) { BlockPos p = pos.offset(dir); if (world.isAir(p)) { - BlocksHelper.setWithoutUpdate(world, p, EndBlocks.BLUE_VINE_FUR.getDefaultState().with(BlockGlowingFur.FACING, dir)); + BlocksHelper.setWithoutUpdate(world, p, EndBlocks.BLUE_VINE_FUR.getDefaultState().with(BlockFur.FACING, dir)); } } if (world.isAir(pos.up())) { - BlocksHelper.setWithoutUpdate(world, pos.up(), EndBlocks.BLUE_VINE_FUR.getDefaultState().with(BlockGlowingFur.FACING, Direction.UP)); + BlocksHelper.setWithoutUpdate(world, pos.up(), EndBlocks.BLUE_VINE_FUR.getDefaultState().with(BlockFur.FACING, Direction.UP)); } } diff --git a/src/main/java/ru/betterend/blocks/BlockTenaneaFlowers.java b/src/main/java/ru/betterend/blocks/BlockTenaneaFlowers.java new file mode 100644 index 00000000..d78a91ef --- /dev/null +++ b/src/main/java/ru/betterend/blocks/BlockTenaneaFlowers.java @@ -0,0 +1,60 @@ +package ru.betterend.blocks; + +import net.minecraft.client.color.block.BlockColorProvider; +import net.minecraft.client.color.item.ItemColorProvider; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3i; +import ru.betterend.blocks.basis.BlockVine; +import ru.betterend.interfaces.IColorProvider; +import ru.betterend.util.MHelper; + +public class BlockTenaneaFlowers extends BlockVine implements IColorProvider { + private static final BlockColorProvider BLOCK_PROVIDER; + private static final ItemColorProvider ITEM_PROVIDER; + public static final Vec3i[] COLORS; + + public BlockTenaneaFlowers() { + super(15); + } + + @Override + public BlockColorProvider getProvider() { + return BLOCK_PROVIDER; + } + + @Override + public ItemColorProvider getItemProvider() { + return ITEM_PROVIDER; + } + + static { + COLORS = new Vec3i[] { + new Vec3i(250, 111, 222), + new Vec3i(167, 89, 255), + new Vec3i(120, 207, 239), + new Vec3i(255, 87, 182) + }; + + BLOCK_PROVIDER = (state, world, pos, tintIndex) -> { + long i = (MHelper.getRandom(pos.getX(), pos.getZ()) & 63) + pos.getY(); + double delta = i * 0.1; + int index = MHelper.floor(delta); + int index2 = (index + 1) & 3; + delta -= index; + index &= 3; + + Vec3i color1 = COLORS[index]; + Vec3i color2 = COLORS[index2]; + + int r = MHelper.floor(MathHelper.lerp(delta, color1.getX(), color2.getX())); + int g = MHelper.floor(MathHelper.lerp(delta, color1.getY(), color2.getY())); + int b = MHelper.floor(MathHelper.lerp(delta, color1.getZ(), color2.getZ())); + + return MHelper.color(r, g, b); + }; + + ITEM_PROVIDER = (stack, tintIndex) -> { + return MHelper.color(COLORS[0].getX(), COLORS[0].getY(), COLORS[0].getZ()); + }; + } +} diff --git a/src/main/java/ru/betterend/blocks/basis/BlockGlowingFur.java b/src/main/java/ru/betterend/blocks/basis/BlockFur.java similarity index 86% rename from src/main/java/ru/betterend/blocks/basis/BlockGlowingFur.java rename to src/main/java/ru/betterend/blocks/basis/BlockFur.java index 5d7ce3d5..cb2b6c2c 100644 --- a/src/main/java/ru/betterend/blocks/basis/BlockGlowingFur.java +++ b/src/main/java/ru/betterend/blocks/basis/BlockFur.java @@ -24,6 +24,7 @@ import net.minecraft.sound.BlockSoundGroup; import net.minecraft.state.StateManager; import net.minecraft.state.property.DirectionProperty; import net.minecraft.state.property.Properties; +import net.minecraft.tag.BlockTags; import net.minecraft.util.BlockMirror; import net.minecraft.util.BlockRotation; import net.minecraft.util.math.BlockPos; @@ -38,13 +39,24 @@ import ru.betterend.interfaces.IRenderTypeable; import ru.betterend.util.BlocksHelper; import ru.betterend.util.MHelper; -public class BlockGlowingFur extends BlockBaseNotFull implements IRenderTypeable { +public class BlockFur extends BlockBaseNotFull implements IRenderTypeable { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); public static final DirectionProperty FACING = Properties.FACING; private final ItemConvertible drop; private final int dropChance; - public BlockGlowingFur(ItemConvertible drop, int dropChance) { + public BlockFur(ItemConvertible drop, int light, int dropChance) { + super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT) + .breakByTool(FabricToolTags.SHEARS) + .sounds(BlockSoundGroup.WET_GRASS) + .luminance(light) + .breakByHand(true) + .noCollision()); + this.drop = drop; + this.dropChance = dropChance; + } + + public BlockFur(ItemConvertible drop, int dropChance) { super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT) .breakByTool(FabricToolTags.SHEARS) .sounds(BlockSoundGroup.WET_GRASS) @@ -86,7 +98,7 @@ public class BlockGlowingFur extends BlockBaseNotFull implements IRenderTypeable public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { Direction direction = (Direction) state.get(FACING); BlockPos blockPos = pos.offset(direction.getOpposite()); - return sideCoversSmallSquare(world, blockPos, direction); + return sideCoversSmallSquare(world, blockPos, direction) || world.getBlockState(pos).isIn(BlockTags.LEAVES); } @Override diff --git a/src/main/java/ru/betterend/blocks/basis/BlockWallMushroom.java b/src/main/java/ru/betterend/blocks/basis/BlockWallMushroom.java index 07768c22..b2580ad7 100644 --- a/src/main/java/ru/betterend/blocks/basis/BlockWallMushroom.java +++ b/src/main/java/ru/betterend/blocks/basis/BlockWallMushroom.java @@ -11,6 +11,9 @@ import net.minecraft.block.Material; import net.minecraft.item.ItemStack; import net.minecraft.loot.context.LootContext; import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.WorldView; public class BlockWallMushroom extends BlockWallPlant { public BlockWallMushroom(int light) { @@ -28,4 +31,9 @@ public class BlockWallMushroom extends BlockWallPlant { public List getDroppedStacks(BlockState state, LootContext.Builder builder) { return Lists.newArrayList(new ItemStack(this)); } + + @Override + public boolean isSupport(WorldView world, BlockPos pos, BlockState blockState, Direction direction) { + return blockState.getMaterial().isSolid() && blockState.isSideSolidFullSquare(world, pos, direction); + } } diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index a76f17e5..2a78aec3 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -35,6 +35,7 @@ import ru.betterend.blocks.BlockPath; import ru.betterend.blocks.BlockPythadendronSapling; import ru.betterend.blocks.BlockShadowBerry; import ru.betterend.blocks.BlockShadowGrass; +import ru.betterend.blocks.BlockTenaneaFlowers; import ru.betterend.blocks.BlockTenaneaSapling; import ru.betterend.blocks.BlockTerrain; import ru.betterend.blocks.BlockTerrainPlant; @@ -49,7 +50,7 @@ import ru.betterend.blocks.InfusionPedestal; import ru.betterend.blocks.PedestalVanilla; import ru.betterend.blocks.RunedFlavolite; import ru.betterend.blocks.TerminiteBlock; -import ru.betterend.blocks.basis.BlockGlowingFur; +import ru.betterend.blocks.basis.BlockFur; import ru.betterend.blocks.basis.BlockLeaves; import ru.betterend.blocks.basis.BlockOre; import ru.betterend.blocks.basis.BlockSimpleLeaves; @@ -95,11 +96,11 @@ public class EndBlocks { public static final Block QUARTZ_PEDESTAL = registerBlock("quartz_pedestal", new PedestalVanilla(Blocks.QUARTZ_BLOCK)); public static final Block PURPUR_PEDESTAL = registerBlock("purpur_pedestal", new PedestalVanilla(Blocks.PURPUR_BLOCK)); - // Wooden Materials // + // Wooden Materials And Trees // public static final Block MOSSY_GLOWSHROOM_SAPLING = registerBlock("mossy_glowshroom_sapling", new BlockMossyGlowshroomSapling()); public static final Block MOSSY_GLOWSHROOM_CAP = registerBlock("mossy_glowshroom_cap", new BlockMossyGlowshroomCap()); public static final Block MOSSY_GLOWSHROOM_HYMENOPHORE = registerBlock("mossy_glowshroom_hymenophore", new BlockMossyGlowshroomHymenophore()); - public static final Block MOSSY_GLOWSHROOM_FUR = registerBlock("mossy_glowshroom_fur", new BlockGlowingFur(MOSSY_GLOWSHROOM_SAPLING, 16)); + public static final Block MOSSY_GLOWSHROOM_FUR = registerBlock("mossy_glowshroom_fur", new BlockFur(MOSSY_GLOWSHROOM_SAPLING, 15, 16)); public static final WoodenMaterial MOSSY_GLOWSHROOM = new WoodenMaterial("mossy_glowshroom", MaterialColor.GRAY, MaterialColor.WOOD); public static final Block PYTHADENDRON_SAPLING = registerBlock("pythadendron_sapling", new BlockPythadendronSapling()); @@ -122,7 +123,8 @@ public class EndBlocks { public static final Block TENANEA_SAPLING = registerBlock("tenanea_sapling", new BlockTenaneaSapling()); public static final Block TENANEA_LEAVES = registerBlock("tenanea_leaves", new BlockLeaves(TENANEA_SAPLING, MaterialColor.PINK)); - public static final Block TENANEA_FLOWERS = registerBlock("tenanea_flowers", new BlockVine(15)); + public static final Block TENANEA_FLOWERS = registerBlock("tenanea_flowers", new BlockTenaneaFlowers()); + public static final Block TENANEA_OUTER_LEAVES = registerBlock("tenanea_outer_leaves", new BlockFur(TENANEA_SAPLING, 32)); public static final WoodenMaterial TENANEA = new WoodenMaterial("tenanea", MaterialColor.PINK, MaterialColor.PINK); // Small Plants // @@ -137,7 +139,7 @@ public class EndBlocks { public static final Block BLUE_VINE_SEED = registerBlock("blue_vine_seed", new BlockBlueVineSeed()); public static final Block BLUE_VINE = registerBlockNI("blue_vine", new BlockBlueVine()); public static final Block BLUE_VINE_LANTERN = registerBlock("blue_vine_lantern", new BlockBlueVineLantern()); - public static final Block BLUE_VINE_FUR = registerBlock("blue_vine_fur", new BlockGlowingFur(BLUE_VINE_SEED, 3)); + public static final Block BLUE_VINE_FUR = registerBlock("blue_vine_fur", new BlockFur(BLUE_VINE_SEED, 15, 3)); public static final Block BUBBLE_CORAL = registerBlock("bubble_coral", new BlockBubbleCoral()); public static final Block END_LILY = registerBlockNI("end_lily", new BlockEndLily()); diff --git a/src/main/java/ru/betterend/util/BlocksHelper.java b/src/main/java/ru/betterend/util/BlocksHelper.java index dda412c2..d2ee0f20 100644 --- a/src/main/java/ru/betterend/util/BlocksHelper.java +++ b/src/main/java/ru/betterend/util/BlocksHelper.java @@ -23,7 +23,7 @@ import net.minecraft.util.math.Vec3i; import net.minecraft.world.WorldAccess; import ru.betterend.blocks.BlockBlueVine; import ru.betterend.blocks.basis.BlockDoublePlant; -import ru.betterend.blocks.basis.BlockGlowingFur; +import ru.betterend.blocks.basis.BlockFur; import ru.betterend.blocks.basis.BlockVine; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndTags; @@ -153,7 +153,7 @@ public class BlocksHelper { POS.setY(y); state = world.getBlockState(POS); - if (state.getBlock() instanceof BlockGlowingFur) { + if (state.getBlock() instanceof BlockFur) { doubleCheck.add(POS.toImmutable()); } // Liquids diff --git a/src/main/java/ru/betterend/util/MHelper.java b/src/main/java/ru/betterend/util/MHelper.java index bf08ac41..e8dcf52c 100644 --- a/src/main/java/ru/betterend/util/MHelper.java +++ b/src/main/java/ru/betterend/util/MHelper.java @@ -113,6 +113,12 @@ public class MHelper { return x1 * x2 + y1 * y2; } + public static int getRandom(int x, int z) { + int h = x * 374761393 + z * 668265263; + h = (h ^ (h >> 13)) * 1274126177; + return h ^ (h >> 16); + } + public static int getSeed(int seed, int x, int y) { int h = seed + x * 374761393 + y * 668265263; h = (h ^ (h >> 13)) * 1274126177; diff --git a/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java b/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java index fff59d02..040d73f7 100644 --- a/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java @@ -13,7 +13,7 @@ import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.feature.DefaultFeatureConfig; import ru.betterend.blocks.BlockMossyGlowshroomCap; -import ru.betterend.blocks.basis.BlockGlowingFur; +import ru.betterend.blocks.basis.BlockFur; import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndTags; @@ -103,12 +103,12 @@ public class MossyGlowshroomFeature extends DefaultFeature { else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { for (Direction dir: BlocksHelper.HORIZONTAL) { if (info.getState(dir) == AIR) { - info.setBlockPos(info.getPos().offset(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, dir)); + info.setBlockPos(info.getPos().offset(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockFur.FACING, dir)); } } if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { - info.setBlockPos(info.getPos().down(), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, Direction.DOWN)); + info.setBlockPos(info.getPos().down(), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockFur.FACING, Direction.DOWN)); } } return info.getState(); diff --git a/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java b/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java index a9670faf..474fcf72 100644 --- a/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java @@ -18,6 +18,7 @@ import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.feature.DefaultFeatureConfig; import ru.betterend.blocks.BlockProperties; import ru.betterend.blocks.BlockProperties.TripleShape; +import ru.betterend.blocks.basis.BlockFur; import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndTags; @@ -54,7 +55,7 @@ public class TenaneaFeature extends DefaultFeature { SplineHelper.offsetParts(spline, random, 1F, 0, 1F); SplineHelper.fillSpline(spline, world, EndBlocks.TENANEA.bark.getDefaultState(), pos, REPLACE); Vector3f last = spline.get(spline.size() - 1); - float leavesRadius = (size * 0.3F + MHelper.randRange(0.8F, 1.5F, random)); + float leavesRadius = (size * 0.3F + MHelper.randRange(0.8F, 1.5F, random)) * 1.4F; OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); leavesBall(world, pos.add(last.getX(), last.getY(), last.getZ()), leavesRadius, random, noise); } @@ -67,14 +68,30 @@ public class TenaneaFeature extends DefaultFeature { SDF sub = new SDFScale().setScale(5).setSource(sphere); sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); - 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) * 1F; }).setSource(sphere); - sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere); + sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere); + sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 2F; }).setSource(sphere); + sphere = new SDFDisplacement().setFunction((vec) -> { return MHelper.randRange(-1.5F, 1.5F, random); }).setSource(sphere); + Mutable mut = new Mutable(); + for (Direction d1: BlocksHelper.HORIZONTAL) { + BlockPos p = mut.set(pos).move(Direction.UP).move(d1).toImmutable(); + BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TENANEA.bark.getDefaultState()); + for (Direction d2: BlocksHelper.HORIZONTAL) { + mut.set(p).move(Direction.UP).move(d2); + BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TENANEA.bark.getDefaultState()); + } + } + + BlockState outer = EndBlocks.TENANEA_OUTER_LEAVES.getDefaultState(); List support = Lists.newArrayList(); sphere.setPostProcess((info) -> { - if (random.nextBoolean() && info.getStateDown().isAir()) { - support.add(info.getPos().toImmutable()); + if (info.getStateDown().isAir()) { + if (random.nextBoolean()) { + support.add(info.getPos().toImmutable()); + } + else { + info.setState(info.getPos().down(), outer.with(BlockFur.FACING, Direction.DOWN)); + } } if (random.nextInt(5) == 0) { for (Direction dir: Direction.values()) { @@ -84,6 +101,16 @@ public class TenaneaFeature extends DefaultFeature { } } info.setState(EndBlocks.TENANEA.bark.getDefaultState()); + } + + if (info.getState().isOf(EndBlocks.TENANEA_LEAVES)) { + for (Direction d: BlocksHelper.HORIZONTAL) { + if (info.getState(d).isAir()) { + info.setState(info.getPos().offset(d), outer.with(BlockFur.FACING, Direction.DOWN)); + } + } + } + else if (EndBlocks.TENANEA.isTreeLog(info.getState())) { for (int x = -6; x < 7; x++) { int ax = Math.abs(x); mut.setX(x + info.getPos().getX()); diff --git a/src/main/java/ru/betterend/world/structures/features/StructureGiantMossyGlowshroom.java b/src/main/java/ru/betterend/world/structures/features/StructureGiantMossyGlowshroom.java index 3b9aa9e3..b4ca3c4b 100644 --- a/src/main/java/ru/betterend/world/structures/features/StructureGiantMossyGlowshroom.java +++ b/src/main/java/ru/betterend/world/structures/features/StructureGiantMossyGlowshroom.java @@ -7,7 +7,7 @@ import net.minecraft.client.util.math.Vector3f; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import ru.betterend.blocks.BlockMossyGlowshroomCap; -import ru.betterend.blocks.basis.BlockGlowingFur; +import ru.betterend.blocks.basis.BlockFur; import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.registry.EndBlocks; import ru.betterend.util.BlocksHelper; @@ -111,12 +111,12 @@ public class StructureGiantMossyGlowshroom extends SDFStructureFeature { else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { for (Direction dir: BlocksHelper.HORIZONTAL) { if (info.getState(dir) == AIR) { - info.setBlockPos(info.getPos().offset(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, dir)); + info.setBlockPos(info.getPos().offset(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockFur.FACING, dir)); } } if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { - info.setBlockPos(info.getPos().down(), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, Direction.DOWN)); + info.setBlockPos(info.getPos().down(), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockFur.FACING, Direction.DOWN)); } } return info.getState(); diff --git a/src/main/resources/assets/betterend/blockstates/tenanea_outer_leaves.json b/src/main/resources/assets/betterend/blockstates/tenanea_outer_leaves.json new file mode 100644 index 00000000..f3072b5c --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/tenanea_outer_leaves.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=up": { "model": "betterend:block/tenanea_outer_leaves" }, + "facing=down": { "model": "betterend:block/tenanea_outer_leaves", "x": 180 }, + "facing=north": { "model": "betterend:block/tenanea_outer_leaves", "x": 90 }, + "facing=south": { "model": "betterend:block/tenanea_outer_leaves", "x": 90, "y": 180 }, + "facing=east": { "model": "betterend:block/tenanea_outer_leaves", "x": 90, "y": 90 }, + "facing=west": { "model": "betterend:block/tenanea_outer_leaves", "x": 90, "y": 270 } + } +} diff --git a/src/main/resources/assets/betterend/models/block/cross_no_distortion_inverted_tinted.json b/src/main/resources/assets/betterend/models/block/cross_no_distortion_inverted_tinted.json new file mode 100644 index 00000000..aad66117 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/cross_no_distortion_inverted_tinted.json @@ -0,0 +1,29 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 16, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "tintindex": 0 } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 16, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "tintindex": 0 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/cross_no_distortion_tinted.json b/src/main/resources/assets/betterend/models/block/cross_no_distortion_tinted.json new file mode 100644 index 00000000..a1957e01 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/cross_no_distortion_tinted.json @@ -0,0 +1,29 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 16, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 16, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/tenanea_flowers_bottom_1.json b/src/main/resources/assets/betterend/models/block/tenanea_flowers_bottom_1.json index e0bd69bc..bde5c2bb 100644 --- a/src/main/resources/assets/betterend/models/block/tenanea_flowers_bottom_1.json +++ b/src/main/resources/assets/betterend/models/block/tenanea_flowers_bottom_1.json @@ -1,5 +1,5 @@ { - "parent": "betterend:block/cross_no_distortion", + "parent": "betterend:block/cross_no_distortion_tinted", "textures": { "texture": "betterend:block/tenanea_flowers_bottom" } diff --git a/src/main/resources/assets/betterend/models/block/tenanea_flowers_bottom_2.json b/src/main/resources/assets/betterend/models/block/tenanea_flowers_bottom_2.json index ce711252..c2d080db 100644 --- a/src/main/resources/assets/betterend/models/block/tenanea_flowers_bottom_2.json +++ b/src/main/resources/assets/betterend/models/block/tenanea_flowers_bottom_2.json @@ -1,5 +1,5 @@ { - "parent": "betterend:block/cross_no_distortion_inverted", + "parent": "betterend:block/cross_no_distortion_inverted_tinted", "textures": { "texture": "betterend:block/tenanea_flowers_bottom" } diff --git a/src/main/resources/assets/betterend/models/block/tenanea_flowers_middle_1.json b/src/main/resources/assets/betterend/models/block/tenanea_flowers_middle_1.json index 487cf87e..ef39aa4b 100644 --- a/src/main/resources/assets/betterend/models/block/tenanea_flowers_middle_1.json +++ b/src/main/resources/assets/betterend/models/block/tenanea_flowers_middle_1.json @@ -1,5 +1,5 @@ { - "parent": "betterend:block/cross_no_distortion", + "parent": "betterend:block/cross_no_distortion_tinted", "textures": { "texture": "betterend:block/tenanea_flowers" } diff --git a/src/main/resources/assets/betterend/models/block/tenanea_flowers_middle_2.json b/src/main/resources/assets/betterend/models/block/tenanea_flowers_middle_2.json index fd254807..07d18bb0 100644 --- a/src/main/resources/assets/betterend/models/block/tenanea_flowers_middle_2.json +++ b/src/main/resources/assets/betterend/models/block/tenanea_flowers_middle_2.json @@ -1,5 +1,5 @@ { - "parent": "betterend:block/cross_no_distortion_inverted", + "parent": "betterend:block/cross_no_distortion_inverted_tinted", "textures": { "texture": "betterend:block/tenanea_flowers" } diff --git a/src/main/resources/assets/betterend/models/block/tenanea_flowers_top_1.json b/src/main/resources/assets/betterend/models/block/tenanea_flowers_top_1.json index 2cfede97..1999fc19 100644 --- a/src/main/resources/assets/betterend/models/block/tenanea_flowers_top_1.json +++ b/src/main/resources/assets/betterend/models/block/tenanea_flowers_top_1.json @@ -1,6 +1,53 @@ { - "parent": "betterend:block/cross_no_distortion", "textures": { - "texture": "betterend:block/tenanea_flowers_top" - } -} + "texture": "betterend:block/tenanea_flowers_top", + "stem": "betterend:block/tenanea_flowers_top_stem", + "particle": "#texture" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 16, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 16, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 } + } + }, + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 16, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#stem" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#stem" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 16, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#stem" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#stem" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/tenanea_flowers_top_2.json b/src/main/resources/assets/betterend/models/block/tenanea_flowers_top_2.json index 6b4754e1..fba0332e 100644 --- a/src/main/resources/assets/betterend/models/block/tenanea_flowers_top_2.json +++ b/src/main/resources/assets/betterend/models/block/tenanea_flowers_top_2.json @@ -1,6 +1,59 @@ { - "parent": "betterend:block/cross_no_distortion_inverted", + "parent": "betterend:block/cross_no_distortion_inverted_tinted", "textures": { "texture": "betterend:block/tenanea_flowers_top" } } +{ + "textures": { + "texture": "betterend:block/tenanea_flowers_top", + "stem": "betterend:block/tenanea_flowers_top_stem", + "particle": "#texture" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 16, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "tintindex": 0 } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 16, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "tintindex": 0 } + } + }, + { + "__comment": "PlaneX1", + "from": [ 2.375, 0, 2.25 ], + "to": [ 2.376, 16, 18.25 ], + "rotation": { "origin": [ 2.375, 0, 2.25 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#stem" }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#stem" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 13.75, 0, 2.25 ], + "to": [ 13.751, 16, 18.25 ], + "rotation": { "origin": [ 13.75, 0, 2.25 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 16, 0, 0, 16 ], "texture": "#stem" }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#stem" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/tenanea_outer_leaves.json b/src/main/resources/assets/betterend/models/block/tenanea_outer_leaves.json new file mode 100644 index 00000000..2e376e45 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/tenanea_outer_leaves.json @@ -0,0 +1,120 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/tenanea_outer_leaves", + "texture": "betterend:block/tenanea_outer_leaves", + "spore": "betterend:block/tenanea_outer_leaves" + }, + "elements": [ + { + "__comment": "PlaneY1", + "from": [ 0, -0.001, -10 ], + "to": [ 16, 0, 6 ], + "rotation": { "origin": [ 0, 0, 6 ], "axis": "x", "angle": 22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 180 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY1", + "from": [ 0, 0, 10 ], + "to": [ 16, 0.001, 26 ], + "rotation": { "origin": [ 0, 0, 10 ], "axis": "x", "angle": -22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 180 } + } + }, + { + "__comment": "PlaneY4", + "from": [ 10, -0.001, 0 ], + "to": [ 26, 0, 16 ], + "rotation": { "origin": [ 10, 0, 16 ], "axis": "z", "angle": 22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 16, 16, 0 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneY4", + "from": [ -10, 0, 2 ], + "to": [ 6, 0.001, 18 ], + "rotation": { "origin": [ 6, 0, 18 ], "axis": "z", "angle": -22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 270 }, + "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneX6", + "from": [ 0, 0, -6.5 ], + "to": [ 0.001, 16, 16 ], + "rotation": { "origin": [ 0, 16, 16 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#spore" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#spore" } + } + }, + { + "__comment": "PlaneX6", + "from": [ -6.5, 0, 15.999 ], + "to": [ 16, 16, 16 ], + "rotation": { "origin": [ 16, 16, 16 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#spore" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#spore" } + } + }, + { + "__comment": "PlaneY1", + "from": [ 0, -0.001, -9 ], + "to": [ 16, 0, 7 ], + "rotation": { "origin": [ 0, 0, 7 ], "axis": "x", "angle": 45 }, + "shade": false, + "faces": { + "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "rotation": 180 }, + "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY1", + "from": [ 0, 0, 9 ], + "to": [ 16, 0.001, 25 ], + "rotation": { "origin": [ 0, 0, 9 ], "axis": "x", "angle": -45 }, + "shade": false, + "faces": { + "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" }, + "up": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "rotation": 180 } + } + }, + { + "__comment": "PlaneY4", + "from": [ 9, -0.001, 0 ], + "to": [ 25, 0, 16 ], + "rotation": { "origin": [ 9, 0, 16 ], "axis": "z", "angle": 45 }, + "shade": false, + "faces": { + "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 16, 16, 0, 0 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneY4", + "from": [ -9, 0, 2 ], + "to": [ 7, 0.001, 18 ], + "rotation": { "origin": [ 7, 0, 18 ], "axis": "z", "angle": -45 }, + "shade": false, + "faces": { + "down": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture", "rotation": 270 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 270 } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/item/tenanea_outer_leaves.json b/src/main/resources/assets/betterend/models/item/tenanea_outer_leaves.json new file mode 100644 index 00000000..7abbe6c1 --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/tenanea_outer_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betterend:block/tenanea_outer_leaves" + } +} diff --git a/src/main/resources/assets/betterend/textures/block/tenanea_flowers.png b/src/main/resources/assets/betterend/textures/block/tenanea_flowers.png index bd8ea393..c7bbf8c1 100644 Binary files a/src/main/resources/assets/betterend/textures/block/tenanea_flowers.png and b/src/main/resources/assets/betterend/textures/block/tenanea_flowers.png differ diff --git a/src/main/resources/assets/betterend/textures/block/tenanea_flowers_bottom.png b/src/main/resources/assets/betterend/textures/block/tenanea_flowers_bottom.png index a7e013b6..23fe7dbf 100644 Binary files a/src/main/resources/assets/betterend/textures/block/tenanea_flowers_bottom.png and b/src/main/resources/assets/betterend/textures/block/tenanea_flowers_bottom.png differ diff --git a/src/main/resources/assets/betterend/textures/block/tenanea_flowers_top.png b/src/main/resources/assets/betterend/textures/block/tenanea_flowers_top.png index 7bdf495a..07b6a7c3 100644 Binary files a/src/main/resources/assets/betterend/textures/block/tenanea_flowers_top.png and b/src/main/resources/assets/betterend/textures/block/tenanea_flowers_top.png differ diff --git a/src/main/resources/assets/betterend/textures/block/tenanea_flowers_top_stem.png b/src/main/resources/assets/betterend/textures/block/tenanea_flowers_top_stem.png new file mode 100644 index 00000000..6df6a37f Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/tenanea_flowers_top_stem.png differ diff --git a/src/main/resources/assets/betterend/textures/block/tenanea_leaves.png b/src/main/resources/assets/betterend/textures/block/tenanea_leaves.png index bcc87a62..6ed37b32 100644 Binary files a/src/main/resources/assets/betterend/textures/block/tenanea_leaves.png and b/src/main/resources/assets/betterend/textures/block/tenanea_leaves.png differ diff --git a/src/main/resources/assets/betterend/textures/block/tenanea_outer_leaves.png b/src/main/resources/assets/betterend/textures/block/tenanea_outer_leaves.png new file mode 100644 index 00000000..78a92360 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/tenanea_outer_leaves.png differ