diff --git a/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java b/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java index ae32e565..e5fe0ba8 100644 --- a/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java @@ -1,18 +1,34 @@ package ru.betterend.mixin.common; +import java.util.Random; + +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.minecraft.block.BlockState; import net.minecraft.block.ChorusFlowerBlock; +import net.minecraft.block.ChorusPlantBlock; +import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; import net.minecraft.world.WorldView; import ru.betterend.registry.BlockRegistry; +import ru.betterend.registry.BlockTagRegistry; +import ru.betterend.util.BlocksHelper; @Mixin(ChorusFlowerBlock.class) public class ChorusFlowerBlockMixin { + @Shadow + @Final + private ChorusPlantBlock plantBlock; + @Inject(method = "canPlaceAt", at = @At("HEAD"), cancellable = true) private void canPlace(BlockState state, WorldView world, BlockPos pos, CallbackInfoReturnable info) { if (world.getBlockState(pos.down()).isOf(BlockRegistry.CHORUS_NYLIUM)) { @@ -20,4 +36,28 @@ public class ChorusFlowerBlockMixin { info.cancel(); } } + + @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) + private void onTick(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo info) { + if (world.getBlockState(pos.down()).isIn(BlockTagRegistry.END_GROUND)) { + BlockPos up = pos.up(); + if (world.isAir(up) && up.getY() < 256) { + int i = state.get(ChorusFlowerBlock.AGE); + if (i < 5) { + this.grow(world, up, i + 1); + BlocksHelper.setWithoutUpdate(world, pos, plantBlock.getDefaultState().with(ChorusPlantBlock.UP, true).with(ChorusPlantBlock.DOWN, true).with(BlocksHelper.ROOTS, true)); + info.cancel(); + } + } + } + } + + @Shadow + private static boolean isSurroundedByAir(WorldView world, BlockPos pos, @Nullable Direction exceptDirection) { return false; } + + @Shadow + private void grow(World world, BlockPos pos, int age) {} + + @Shadow + private void die(World world, BlockPos pos) {} } diff --git a/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java b/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java index 56d9999d..c649d8c3 100644 --- a/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java @@ -18,14 +18,13 @@ import net.minecraft.world.BlockView; import net.minecraft.world.WorldView; import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.BlockTagRegistry; +import ru.betterend.util.BlocksHelper; @Mixin(ChorusPlantBlock.class) public class ChorusPlantBlockMixin { - private static final BooleanProperty ROOTS = BooleanProperty.of("roots"); - @Inject(method = "appendProperties", at = @At("TAIL")) private void addProperties(StateManager.Builder builder, CallbackInfo info) { - builder.add(ROOTS); + builder.add(BlocksHelper.ROOTS); } @Inject(method = "canPlaceAt", at = @At("HEAD"), cancellable = true) @@ -41,10 +40,10 @@ public class ChorusPlantBlockMixin { BlockState plant = info.getReturnValue(); if (plant.isOf(Blocks.CHORUS_PLANT)) { if (!plant.get(Properties.DOWN) && world.getBlockState(pos.down()).isIn(BlockTagRegistry.END_GROUND)) { - info.setReturnValue(plant.with(Properties.DOWN, true).with(ROOTS, true)); + info.setReturnValue(plant.with(Properties.DOWN, true).with(BlocksHelper.ROOTS, true)); } else { - info.setReturnValue(plant.with(ROOTS, false)); + info.setReturnValue(plant.with(BlocksHelper.ROOTS, false)); } } } diff --git a/src/main/java/ru/betterend/util/BlocksHelper.java b/src/main/java/ru/betterend/util/BlocksHelper.java index 47429d97..97594cac 100644 --- a/src/main/java/ru/betterend/util/BlocksHelper.java +++ b/src/main/java/ru/betterend/util/BlocksHelper.java @@ -1,205 +1,208 @@ -package ru.betterend.util; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.FallingBlock; -import net.minecraft.state.property.Property; -import net.minecraft.tag.BlockTags; -import net.minecraft.util.BlockMirror; -import net.minecraft.util.BlockRotation; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.BlockPos.Mutable; -import net.minecraft.util.math.Direction; -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.registry.BlockTagRegistry; - -public class BlocksHelper { - public static final int FLAG_UPDATE_BLOCK = 1; - public static final int FLAG_SEND_CLIENT_CHANGES = 2; - public static final int FLAG_NO_RERENDER = 4; - public static final int FORSE_RERENDER = 8; - public static final int FLAG_IGNORE_OBSERVERS = 16; - - public static final int SET_SILENT = FLAG_UPDATE_BLOCK | FLAG_IGNORE_OBSERVERS | FLAG_SEND_CLIENT_CHANGES; - public static final Direction[] HORIZONTAL = makeHorizontal(); - - private static final Mutable POS = new Mutable(); - protected static final BlockState AIR = Blocks.AIR.getDefaultState(); - - private static final Vec3i[] OFFSETS = new Vec3i[] { - new Vec3i(-1, -1, -1), new Vec3i(-1, -1, 0), new Vec3i(-1, -1, 1), - new Vec3i(-1, 0, -1), new Vec3i(-1, 0, 0), new Vec3i(-1, 0, 1), - new Vec3i(-1, 1, -1), new Vec3i(-1, 1, 0), new Vec3i(-1, 1, 1), - - new Vec3i(0, -1, -1), new Vec3i(0, -1, 0), new Vec3i(0, -1, 1), - new Vec3i(0, 0, -1), new Vec3i(0, 0, 0), new Vec3i(0, 0, 1), - new Vec3i(0, 1, -1), new Vec3i(0, 1, 0), new Vec3i(0, 1, 1), - - new Vec3i(1, -1, -1), new Vec3i(1, -1, 0), new Vec3i(1, -1, 1), - new Vec3i(1, 0, -1), new Vec3i(1, 0, 0), new Vec3i(1, 0, 1), - new Vec3i(1, 1, -1), new Vec3i(1, 1, 0), new Vec3i(1, 1, 1) - }; - - public static void setWithoutUpdate(WorldAccess world, BlockPos pos, BlockState state) { - world.setBlockState(pos, state, SET_SILENT); - } - - public static void setWithoutUpdate(WorldAccess world, BlockPos pos, Block block) { - world.setBlockState(pos, block.getDefaultState(), SET_SILENT); - } - - public static int upRay(WorldAccess world, BlockPos pos, int maxDist) { - int length = 0; - for (int j = 1; j < maxDist && (world.isAir(pos.up(j))); j++) - length++; - return length; - } - - public static int downRay(WorldAccess world, BlockPos pos, int maxDist) { - int length = 0; - for (int j = 1; j < maxDist && (world.isAir(pos.down(j))); j++) - length++; - return length; - } - - public static int downRayRep(WorldAccess world, BlockPos pos, int maxDist) { - POS.set(pos); - for (int j = 1; j < maxDist && (world.getBlockState(POS)).getMaterial().isReplaceable(); j++) - { - POS.setY(POS.getY() - 1); - } - return pos.getY() - POS.getY(); - } - - public static BlockState rotateHorizontal(BlockState state, BlockRotation rotation, Property facing) { - return (BlockState) state.with(facing, rotation.rotate((Direction) state.get(facing))); - } - - public static BlockState mirrorHorizontal(BlockState state, BlockMirror mirror, Property facing) { - return state.rotate(mirror.getRotation((Direction) state.get(facing))); - } - - public static int getLengthDown(WorldAccess world, BlockPos pos, Block block) { - int count = 1; - while (world.getBlockState(pos.down(count)).getBlock() == block) - count++; - return count; - } - - public static void cover(WorldAccess world, BlockPos center, Block ground, BlockState cover, int radius, Random random) { - HashSet points = new HashSet(); - HashSet points2 = new HashSet(); - if (world.getBlockState(center).getBlock() == ground) { - points.add(center); - points2.add(center); - for (int i = 0; i < radius; i++) { - Iterator iterator = points.iterator(); - while (iterator.hasNext()) { - BlockPos pos = iterator.next(); - for (Vec3i offset : OFFSETS) { - if (random.nextBoolean()) { - BlockPos pos2 = pos.add(offset); - if (random.nextBoolean() && world.getBlockState(pos2).getBlock() == ground - && !points.contains(pos2)) - points2.add(pos2); - } - } - } - points.addAll(points2); - points2.clear(); - } - Iterator iterator = points.iterator(); - while (iterator.hasNext()) { - BlockPos pos = iterator.next(); - BlocksHelper.setWithoutUpdate(world, pos, cover); - } - } - } - - public static void fixBlocks(WorldAccess world, BlockPos start, BlockPos end) { - BlockState state; - for (int x = start.getX(); x <= end.getX(); x++) { - POS.setX(x); - for (int z = start.getZ(); z <= end.getZ(); z++) { - POS.setZ(z); - for (int y = start.getY(); y <= end.getY(); y++) { - POS.setY(y); - state = world.getBlockState(POS); - // Falling blocks - if (state.getBlock() instanceof FallingBlock) { - BlockState falling = state; - - POS.setY(POS.getY() - 1); - state = world.getBlockState(POS); - - int ray = downRayRep(world, POS.toImmutable(), 64); - if (ray > 32) { - BlocksHelper.setWithoutUpdate(world, POS, Blocks.END_STONE.getDefaultState()); - if (world.getRandom().nextBoolean()) { - POS.setY(POS.getY() - 1); - state = world.getBlockState(POS); - BlocksHelper.setWithoutUpdate(world, POS, Blocks.END_STONE.getDefaultState()); - } - } - else { - POS.setY(y); - BlocksHelper.setWithoutUpdate(world, POS, AIR); - - POS.setY(y - ray); - BlocksHelper.setWithoutUpdate(world, POS, falling); - } - } - // Blocks without support - else if (!state.canPlaceAt(world, POS)) { - // Blue Vine - if (state.getBlock() instanceof BlockBlueVine) { - while (!state.canPlaceAt(world, POS)) { - BlocksHelper.setWithoutUpdate(world, POS, AIR); - for (Direction dir : HORIZONTAL) { - BlockPos p = POS.offset(dir).up(); - state = world.getBlockState(p); - if (state.getBlock() instanceof BlockGlowingFur) { - BlocksHelper.setWithoutUpdate(world, p, AIR); - } - } - POS.setY(POS.getY() + 1); - state = world.getBlockState(POS); - } - } - // Double plants - if (state.getBlock() instanceof BlockDoublePlant) { - BlocksHelper.setWithoutUpdate(world, POS, AIR); - POS.setY(POS.getY() + 1); - BlocksHelper.setWithoutUpdate(world, POS, AIR); - } - // Other blocks - else { - BlocksHelper.setWithoutUpdate(world, POS, AIR); - } - } - } - } - } - } - - public static boolean isEndNylium(Block block) { - return block.isIn(BlockTags.NYLIUM) && block.isIn(BlockTagRegistry.END_GROUND); - } - - public static boolean isEndNylium(BlockState state) { - return isEndNylium(state.getBlock()); - } - - public static Direction[] makeHorizontal() { - return new Direction[] { Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST }; - } -} +package ru.betterend.util; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.FallingBlock; +import net.minecraft.state.property.BooleanProperty; +import net.minecraft.state.property.Property; +import net.minecraft.tag.BlockTags; +import net.minecraft.util.BlockMirror; +import net.minecraft.util.BlockRotation; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockPos.Mutable; +import net.minecraft.util.math.Direction; +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.registry.BlockTagRegistry; + +public class BlocksHelper { + public static final BooleanProperty ROOTS = BooleanProperty.of("roots"); + + public static final int FLAG_UPDATE_BLOCK = 1; + public static final int FLAG_SEND_CLIENT_CHANGES = 2; + public static final int FLAG_NO_RERENDER = 4; + public static final int FORSE_RERENDER = 8; + public static final int FLAG_IGNORE_OBSERVERS = 16; + + public static final int SET_SILENT = FLAG_UPDATE_BLOCK | FLAG_IGNORE_OBSERVERS | FLAG_SEND_CLIENT_CHANGES; + public static final Direction[] HORIZONTAL = makeHorizontal(); + + private static final Mutable POS = new Mutable(); + protected static final BlockState AIR = Blocks.AIR.getDefaultState(); + + private static final Vec3i[] OFFSETS = new Vec3i[] { + new Vec3i(-1, -1, -1), new Vec3i(-1, -1, 0), new Vec3i(-1, -1, 1), + new Vec3i(-1, 0, -1), new Vec3i(-1, 0, 0), new Vec3i(-1, 0, 1), + new Vec3i(-1, 1, -1), new Vec3i(-1, 1, 0), new Vec3i(-1, 1, 1), + + new Vec3i(0, -1, -1), new Vec3i(0, -1, 0), new Vec3i(0, -1, 1), + new Vec3i(0, 0, -1), new Vec3i(0, 0, 0), new Vec3i(0, 0, 1), + new Vec3i(0, 1, -1), new Vec3i(0, 1, 0), new Vec3i(0, 1, 1), + + new Vec3i(1, -1, -1), new Vec3i(1, -1, 0), new Vec3i(1, -1, 1), + new Vec3i(1, 0, -1), new Vec3i(1, 0, 0), new Vec3i(1, 0, 1), + new Vec3i(1, 1, -1), new Vec3i(1, 1, 0), new Vec3i(1, 1, 1) + }; + + public static void setWithoutUpdate(WorldAccess world, BlockPos pos, BlockState state) { + world.setBlockState(pos, state, SET_SILENT); + } + + public static void setWithoutUpdate(WorldAccess world, BlockPos pos, Block block) { + world.setBlockState(pos, block.getDefaultState(), SET_SILENT); + } + + public static int upRay(WorldAccess world, BlockPos pos, int maxDist) { + int length = 0; + for (int j = 1; j < maxDist && (world.isAir(pos.up(j))); j++) + length++; + return length; + } + + public static int downRay(WorldAccess world, BlockPos pos, int maxDist) { + int length = 0; + for (int j = 1; j < maxDist && (world.isAir(pos.down(j))); j++) + length++; + return length; + } + + public static int downRayRep(WorldAccess world, BlockPos pos, int maxDist) { + POS.set(pos); + for (int j = 1; j < maxDist && (world.getBlockState(POS)).getMaterial().isReplaceable(); j++) + { + POS.setY(POS.getY() - 1); + } + return pos.getY() - POS.getY(); + } + + public static BlockState rotateHorizontal(BlockState state, BlockRotation rotation, Property facing) { + return (BlockState) state.with(facing, rotation.rotate((Direction) state.get(facing))); + } + + public static BlockState mirrorHorizontal(BlockState state, BlockMirror mirror, Property facing) { + return state.rotate(mirror.getRotation((Direction) state.get(facing))); + } + + public static int getLengthDown(WorldAccess world, BlockPos pos, Block block) { + int count = 1; + while (world.getBlockState(pos.down(count)).getBlock() == block) + count++; + return count; + } + + public static void cover(WorldAccess world, BlockPos center, Block ground, BlockState cover, int radius, Random random) { + HashSet points = new HashSet(); + HashSet points2 = new HashSet(); + if (world.getBlockState(center).getBlock() == ground) { + points.add(center); + points2.add(center); + for (int i = 0; i < radius; i++) { + Iterator iterator = points.iterator(); + while (iterator.hasNext()) { + BlockPos pos = iterator.next(); + for (Vec3i offset : OFFSETS) { + if (random.nextBoolean()) { + BlockPos pos2 = pos.add(offset); + if (random.nextBoolean() && world.getBlockState(pos2).getBlock() == ground + && !points.contains(pos2)) + points2.add(pos2); + } + } + } + points.addAll(points2); + points2.clear(); + } + Iterator iterator = points.iterator(); + while (iterator.hasNext()) { + BlockPos pos = iterator.next(); + BlocksHelper.setWithoutUpdate(world, pos, cover); + } + } + } + + public static void fixBlocks(WorldAccess world, BlockPos start, BlockPos end) { + BlockState state; + for (int x = start.getX(); x <= end.getX(); x++) { + POS.setX(x); + for (int z = start.getZ(); z <= end.getZ(); z++) { + POS.setZ(z); + for (int y = start.getY(); y <= end.getY(); y++) { + POS.setY(y); + state = world.getBlockState(POS); + // Falling blocks + if (state.getBlock() instanceof FallingBlock) { + BlockState falling = state; + + POS.setY(POS.getY() - 1); + state = world.getBlockState(POS); + + int ray = downRayRep(world, POS.toImmutable(), 64); + if (ray > 32) { + BlocksHelper.setWithoutUpdate(world, POS, Blocks.END_STONE.getDefaultState()); + if (world.getRandom().nextBoolean()) { + POS.setY(POS.getY() - 1); + state = world.getBlockState(POS); + BlocksHelper.setWithoutUpdate(world, POS, Blocks.END_STONE.getDefaultState()); + } + } + else { + POS.setY(y); + BlocksHelper.setWithoutUpdate(world, POS, AIR); + + POS.setY(y - ray); + BlocksHelper.setWithoutUpdate(world, POS, falling); + } + } + // Blocks without support + else if (!state.canPlaceAt(world, POS)) { + // Blue Vine + if (state.getBlock() instanceof BlockBlueVine) { + while (!state.canPlaceAt(world, POS)) { + BlocksHelper.setWithoutUpdate(world, POS, AIR); + for (Direction dir : HORIZONTAL) { + BlockPos p = POS.offset(dir).up(); + state = world.getBlockState(p); + if (state.getBlock() instanceof BlockGlowingFur) { + BlocksHelper.setWithoutUpdate(world, p, AIR); + } + } + POS.setY(POS.getY() + 1); + state = world.getBlockState(POS); + } + } + // Double plants + if (state.getBlock() instanceof BlockDoublePlant) { + BlocksHelper.setWithoutUpdate(world, POS, AIR); + POS.setY(POS.getY() + 1); + BlocksHelper.setWithoutUpdate(world, POS, AIR); + } + // Other blocks + else { + BlocksHelper.setWithoutUpdate(world, POS, AIR); + } + } + } + } + } + } + + public static boolean isEndNylium(Block block) { + return block.isIn(BlockTags.NYLIUM) && block.isIn(BlockTagRegistry.END_GROUND); + } + + public static boolean isEndNylium(BlockState state) { + return isEndNylium(state.getBlock()); + } + + public static Direction[] makeHorizontal() { + return new Direction[] { Direction.NORTH, Direction.SOUTH, Direction.EAST, Direction.WEST }; + } +} diff --git a/src/main/resources/assets/betterend/models/block/chorus_plant_flower.json b/src/main/resources/assets/betterend/models/block/chorus_plant_flower.json new file mode 100644 index 00000000..370332e0 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/chorus_plant_flower.json @@ -0,0 +1,50 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/chorus_plant_flower_side", + "side": "betterend:block/chorus_plant_flower_side", + "top": "betterend:block/chorus_plant_flower_top", + "bottom": "betterend:block/chorus_plant_flower_bottom" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 0, 2, 2 ], + "to": [ 16, 14, 14 ], + "faces": { + "down": { "uv": [ 0, 2, 16, 14 ], "texture": "#bottom" }, + "up": { "uv": [ 0, 2, 16, 14 ], "texture": "#top" }, + "north": { "uv": [ 0, 2, 16, 14 ], "texture": "#side" }, + "south": { "uv": [ 0, 2, 16, 14 ], "texture": "#side" }, + "west": { "uv": [ 2, 2, 14, 14 ], "texture": "#side" }, + "east": { "uv": [ 2, 2, 14, 14 ], "texture": "#side" } + } + }, + { + "__comment": "Box1", + "from": [ 2, 2, 0 ], + "to": [ 14, 14, 16 ], + "faces": { + "down": { "uv": [ 2, 0, 14, 16 ], "texture": "#bottom" }, + "up": { "uv": [ 2, 0, 14, 16 ], "texture": "#top" }, + "north": { "uv": [ 2, 2, 14, 14 ], "texture": "#side" }, + "south": { "uv": [ 2, 2, 14, 14 ], "texture": "#side" }, + "west": { "uv": [ 0, 2, 16, 14 ], "texture": "#side" }, + "east": { "uv": [ 0, 2, 16, 14 ], "texture": "#side" } + } + }, + { + "__comment": "Box1", + "from": [ 2, 0, 2 ], + "to": [ 14, 16, 14 ], + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#bottom" }, + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#top" }, + "north": { "uv": [ 2, 0, 14, 16 ], "texture": "#side" }, + "south": { "uv": [ 2, 0, 14, 16 ], "texture": "#side" }, + "west": { "uv": [ 2, 0, 14, 16 ], "texture": "#side" }, + "east": { "uv": [ 2, 0, 14, 16 ], "texture": "#side" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/chorus_plant_flower_open.json b/src/main/resources/assets/betterend/models/block/chorus_plant_flower_open.json new file mode 100644 index 00000000..83fdaf4f --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/chorus_plant_flower_open.json @@ -0,0 +1,175 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/chorus_plant_flower_petal", + "texture": "betterend:block/chorus_plant_flower_petal", + "center": "betterend:block/chorus_plant_flower_center", + "texture1": "betterend:block/chorus_plant_flower_fur" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 4, 0, 4 ], + "to": [ 12, 2, 12 ], + "faces": { + "down": { "uv": [ 0, 8, 8, 16 ], "texture": "#center" }, + "up": { "uv": [ 0, 0, 8, 8 ], "texture": "#center" }, + "north": { "uv": [ 8, 14, 16, 16 ], "texture": "#center" }, + "south": { "uv": [ 8, 14, 16, 16 ], "texture": "#center" }, + "west": { "uv": [ 8, 14, 16, 16 ], "texture": "#center" }, + "east": { "uv": [ 8, 14, 16, 16 ], "texture": "#center" } + } + }, + { + "__comment": "PlaneY2", + "from": [ 4.5, 1.125, 16 ], + "to": [ 20.5, 1.126, 32 ], + "rotation": { "origin": [ 4.5, 1.125, 16 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 180 } + } + }, + { + "__comment": "PlaneY2", + "from": [ 0, 1.25, 4.5 ], + "to": [ 16, 1.251, 20.5 ], + "rotation": { "origin": [ 0, 1.25, 4.5 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 180 } + } + }, + { + "__comment": "PlaneY2", + "from": [ -4.5, 1.375, -16 ], + "to": [ 11.5, 1.376, 0 ], + "rotation": { "origin": [ 11.5, 1.375, 0 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 180 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY2", + "from": [ 0, 1, -4.5 ], + "to": [ 16, 1.001, 11.5 ], + "rotation": { "origin": [ 16, 1, 11.5 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 180 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX6", + "from": [ 11, 0.999, 0.5 ], + "to": [ 20, 0.9999999, 16.5 ], + "rotation": { "origin": [ 11, 1, 0.5 ], "axis": "z", "angle": 22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 7, 16, 16 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 16, 16, 0, 7 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneX6", + "from": [ 19.25, 4.374, 0.5 ], + "to": [ 28.25, 4.375, 16.5 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 9 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 16, 9, 0, 0 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneY11", + "from": [ -3, 0.999, 0 ], + "to": [ 5, 0.9999999, 16 ], + "rotation": { "origin": [ 5, 1, 0 ], "axis": "z", "angle": -22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "rotation": 270 }, + "up": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneY11", + "from": [ -10.375, 3.999, 0 ], + "to": [ -2.375, 4, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture", "rotation": 270 }, + "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneY13", + "from": [ -0.5, 1, 11 ], + "to": [ 15.5, 1.001, 20 ], + "rotation": { "origin": [ -0.5, 1, 11 ], "axis": "x", "angle": -22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 7, 16, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 7, 16, 16 ], "texture": "#texture", "rotation": 180 } + } + }, + { + "__comment": "PlaneY13", + "from": [ -0.5, 4.5, 19.25 ], + "to": [ 15.5, 4.501, 28.25 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 9 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 9 ], "texture": "#texture", "rotation": 180 } + } + }, + { + "__comment": "PlaneY18", + "from": [ 1, 0.999, -4 ], + "to": [ 17, 0.9999999, 5 ], + "rotation": { "origin": [ 1, 1, 5 ], "axis": "x", "angle": 22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "rotation": 180 }, + "up": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY18", + "from": [ 1, 4.374, -12.25 ], + "to": [ 17, 4.375, -3.25 ], + "rotation": { "origin": [ 1, 4.375, -3.25 ], "axis": "x", "angle": 0 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture", "rotation": 180 }, + "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX20", + "from": [ 2, 1, 2 ], + "to": [ 2.001, 8, 18 ], + "rotation": { "origin": [ 2, 1, 2 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture1" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture1" } + } + }, + { + "__comment": "PlaneX20", + "from": [ 14, 1, 2 ], + "to": [ 14.001, 8, 18 ], + "rotation": { "origin": [ 14, 1, 2 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture1" }, + "east": { "uv": [ 0, 9, 16, 16 ], "texture": "#texture1" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_bottom.png b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_bottom.png new file mode 100644 index 00000000..f1113227 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_bottom.png differ diff --git a/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_center.png b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_center.png new file mode 100644 index 00000000..e68e38da Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_center.png differ diff --git a/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_fur.png b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_fur.png new file mode 100644 index 00000000..ed28189f Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_fur.png differ diff --git a/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_petal.png b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_petal.png new file mode 100644 index 00000000..fc17f331 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_petal.png differ diff --git a/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_side.png b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_side.png new file mode 100644 index 00000000..b4d3d4fa Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_side.png differ diff --git a/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_top.png b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_top.png new file mode 100644 index 00000000..5d4f24db Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/chorus_plant_flower_top.png differ diff --git a/src/main/resources/assets/minecraft/blockstates/chorus_flower.json b/src/main/resources/assets/minecraft/blockstates/chorus_flower.json new file mode 100644 index 00000000..45269fb3 --- /dev/null +++ b/src/main/resources/assets/minecraft/blockstates/chorus_flower.json @@ -0,0 +1,22 @@ +{ + "variants": { + "age=0": { + "model": "betterend:block/chorus_plant_flower" + }, + "age=1": { + "model": "betterend:block/chorus_plant_flower" + }, + "age=2": { + "model": "betterend:block/chorus_plant_flower" + }, + "age=3": { + "model": "betterend:block/chorus_plant_flower" + }, + "age=4": { + "model": "betterend:block/chorus_plant_flower" + }, + "age=5": { + "model": "betterend:block/chorus_plant_flower_open" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/minecraft/materialmaps/block/chorus_flower.json b/src/main/resources/assets/minecraft/materialmaps/block/chorus_flower.json new file mode 100644 index 00000000..9ccaf67a --- /dev/null +++ b/src/main/resources/assets/minecraft/materialmaps/block/chorus_flower.json @@ -0,0 +1,14 @@ +{ + "defaultMap": { + "spriteMap": [ + { + "sprite": "betterend:block/chorus_plant_flower_petal", + "material": "betterend:waving_floor" + }, + { + "sprite": "betterend:block/chorus_plant_flower_fur", + "material": "betterend:waving_floor" + } + ] + } +} \ No newline at end of file