diff --git a/src/main/java/ru/betterend/blocks/basis/FurBlock.java b/src/main/java/ru/betterend/blocks/basis/FurBlock.java index 4ccd3462..5c83224f 100644 --- a/src/main/java/ru/betterend/blocks/basis/FurBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/FurBlock.java @@ -64,7 +64,7 @@ public class FurBlock extends AttachedBlock implements IRenderTypeable { if (tool != null && tool.getItem().isIn(FabricToolTags.SHEARS) || EnchantmentHelper.getLevel(Enchantments.SILK_TOUCH, tool) > 0) { return Lists.newArrayList(new ItemStack(this)); } - else if (MHelper.RANDOM.nextInt(dropChance) == 0) { + else if (dropChance < 1 || MHelper.RANDOM.nextInt(dropChance) == 0) { return Lists.newArrayList(new ItemStack(drop)); } else { diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index b0a4cc23..37c254c3 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -337,6 +337,7 @@ public class EndBlocks { public static final Block JUNGLE_VINE = registerBlock("jungle_vine", new VineBlock()); public static final Block RUBINEA = registerBlock("rubinea", new VineBlock()); public static final Block FILALUX = registerBlock("filalux", new FilaluxBlock()); + public static final Block FILALUX_WINGS = registerBlock("filalux_wings", new FilaluxWingsBlock()); public static final Block FILALUX_LANTERN = registerBlock("filalux_lantern", new FilaluxLanternBlock()); // Mob-Related diff --git a/src/main/java/ru/betterend/registry/FilaluxWingsBlock.java b/src/main/java/ru/betterend/registry/FilaluxWingsBlock.java new file mode 100644 index 00000000..6ec82a17 --- /dev/null +++ b/src/main/java/ru/betterend/registry/FilaluxWingsBlock.java @@ -0,0 +1,47 @@ +package ru.betterend.registry; + +import java.util.EnumMap; + +import com.google.common.collect.Maps; + +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; +import net.minecraft.block.BlockState; +import net.minecraft.block.Material; +import net.minecraft.block.ShapeContext; +import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.shape.VoxelShape; +import net.minecraft.util.shape.VoxelShapes; +import net.minecraft.world.BlockView; +import ru.betterend.blocks.basis.AttachedBlock; +import ru.betterend.client.render.ERenderLayer; +import ru.betterend.interfaces.IRenderTypeable; + +public class FilaluxWingsBlock extends AttachedBlock implements IRenderTypeable { + private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); + + public FilaluxWingsBlock() { + super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).sounds(BlockSoundGroup.WET_GRASS).noCollision()); + } + + @Override + public ERenderLayer getRenderLayer() { + return ERenderLayer.CUTOUT; + } + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) { + return BOUNDING_SHAPES.get(state.get(FACING)); + } + + static { + BOUNDING_SHAPES.put(Direction.UP, VoxelShapes.cuboid(0.0, 0.0, 0.0, 1.0, 0.5, 1.0)); + BOUNDING_SHAPES.put(Direction.DOWN, VoxelShapes.cuboid(0.0, 0.5, 0.0, 1.0, 1.0, 1.0)); + BOUNDING_SHAPES.put(Direction.NORTH, VoxelShapes.cuboid(0.0, 0.0, 0.5, 1.0, 1.0, 1.0)); + BOUNDING_SHAPES.put(Direction.SOUTH, VoxelShapes.cuboid(0.0, 0.0, 0.0, 1.0, 1.0, 0.5)); + BOUNDING_SHAPES.put(Direction.WEST, VoxelShapes.cuboid(0.5, 0.0, 0.0, 1.0, 1.0, 1.0)); + BOUNDING_SHAPES.put(Direction.EAST, VoxelShapes.cuboid(0.0, 0.0, 0.0, 0.5, 1.0, 1.0)); + } +} diff --git a/src/main/resources/assets/betterend/blockstates/filalux_wings.json b/src/main/resources/assets/betterend/blockstates/filalux_wings.json new file mode 100644 index 00000000..06920a33 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/filalux_wings.json @@ -0,0 +1,10 @@ +{ + "variants": { + "facing=north": { "model": "betterend:block/filalux_wings", "y": 180 }, + "facing=south": { "model": "betterend:block/filalux_wings" }, + "facing=east": { "model": "betterend:block/filalux_wings", "y": 270 }, + "facing=west": { "model": "betterend:block/filalux_wings", "y": 90 }, + "facing=up": { "model": "betterend:block/filalux_wings_top" }, + "facing=down": { "model": "betterend:block/filalux_wings_bottom", "x": 180 } + } +} diff --git a/src/main/resources/assets/betterend/models/block/filalux_wings.json b/src/main/resources/assets/betterend/models/block/filalux_wings.json new file mode 100644 index 00000000..3eedc4e4 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/filalux_wings.json @@ -0,0 +1,42 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/filalux_wings", + "texture": "betterend:block/filalux_wings", + "large": "betterend:block/filalux_wings_large" + }, + "elements": [ + { + "__comment": "PlaneY1", + "from": [ 0, 8, 0 ], + "to": [ 16, 8.001, 8 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 8, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY1", + "from": [ 0, 6, 0 ], + "to": [ 16, 6.001, 8 ], + "rotation": { "origin": [ 0, 6, 0 ], "axis": "x", "angle": 22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 16, 16, 8 ], "texture": "#texture" }, + "up": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY1", + "from": [ 0, 10, 0 ], + "to": [ 16, 10.001, 16 ], + "rotation": { "origin": [ 0, 10, 0 ], "axis": "x", "angle": -22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 16, 16, 0 ], "texture": "#large" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#large" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/filalux_wings_bottom.json b/src/main/resources/assets/betterend/models/block/filalux_wings_bottom.json new file mode 100644 index 00000000..9d2b6fb3 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/filalux_wings_bottom.json @@ -0,0 +1,97 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/filalux_wings", + "texture": "betterend:block/filalux_wings" + }, + "elements": [ + { + "__comment": "PlaneY2", + "from": [ 9, 0, 0 ], + "to": [ 17, 0.001, 16 ], + "rotation": { "origin": [ 9, 0, 0 ], "axis": "z", "angle": 45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture", "rotation": 270 }, + "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneY2", + "from": [ 13, 0, 0 ], + "to": [ 21, 0.001, 16 ], + "rotation": { "origin": [ 13, 0, 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": "PlaneY2", + "from": [ -1, -0.001, 0 ], + "to": [ 7, 0, 16 ], + "rotation": { "origin": [ 7, 0, 0 ], "axis": "z", "angle": -45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture", "rotation": 90 } + } + }, + { + "__comment": "PlaneY2", + "from": [ -5, -0.001, 0 ], + "to": [ 3, 0, 16 ], + "rotation": { "origin": [ 3, 0, 0 ], "axis": "z", "angle": -22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "rotation": 90 } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, 0, 9 ], + "to": [ 16, 0.001, 17 ], + "rotation": { "origin": [ 0, 0, 9 ], "axis": "x", "angle": -45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 8, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, 0, 13 ], + "to": [ 16, 0.001, 21 ], + "rotation": { "origin": [ 0, 0, 13 ], "axis": "x", "angle": -22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 16, 16, 8 ], "texture": "#texture" }, + "up": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, -0.001, -1 ], + "to": [ 16, 0, 7 ], + "rotation": { "origin": [ 0, 0, 7 ], "axis": "x", "angle": 45 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture" }, + "up": { "uv": [ 0, 8, 16, 0 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY5", + "from": [ 0, -0.001, -5 ], + "to": [ 16, 0, 3 ], + "rotation": { "origin": [ 0, 0, 3 ], "axis": "x", "angle": 22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 16, 16, 8 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/filalux_wings_top.json b/src/main/resources/assets/betterend/models/block/filalux_wings_top.json new file mode 100644 index 00000000..829f573a --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/filalux_wings_top.json @@ -0,0 +1,77 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/filalux_wings_large", + "texture": "betterend:block/filalux_wings_large", + "top": "betterend:block/filalux_wings_top", + "side": "betterend:block/filalux_wings_top_side" + }, + "elements": [ + { + "__comment": "PlaneY9", + "from": [ -8, 0.125, -8 ], + "to": [ 24, 0.126, 24 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" } + } + }, + { + "__comment": "PlaneY10", + "from": [ 10, 0, 0 ], + "to": [ 26, 0.001, 16 ], + "rotation": { "origin": [ 10, 0, 0 ], "axis": "z", "angle": 22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 270 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 270 } + } + }, + { + "__comment": "PlaneY10", + "from": [ -10, -0.001, 0 ], + "to": [ 6, 0, 16 ], + "rotation": { "origin": [ 6, 0, 0 ], "axis": "z", "angle": -22.5 }, + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 90 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "rotation": 90 } + } + }, + { + "__comment": "PlaneY12", + "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, 16, 16, 0 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY12", + "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" }, + "up": { "uv": [ 0, 16, 16, 0 ], "texture": "#texture" } + } + }, + { + "__comment": "Box14", + "from": [ -0.5, -16, -0.5 ], + "to": [ 16.5, 0, 16.5 ], + "shade": false, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/item/filalux_wings.json b/src/main/resources/assets/betterend/models/item/filalux_wings.json new file mode 100644 index 00000000..a0fa8b85 --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/filalux_wings.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "betterend:item/filalux_wings" + } +} diff --git a/src/main/resources/assets/betterend/textures/block/filalux_lantern.png b/src/main/resources/assets/betterend/textures/block/filalux_lantern.png index 824b97f5..6382a934 100644 Binary files a/src/main/resources/assets/betterend/textures/block/filalux_lantern.png and b/src/main/resources/assets/betterend/textures/block/filalux_lantern.png differ diff --git a/src/main/resources/assets/betterend/textures/block/filalux_wings.png b/src/main/resources/assets/betterend/textures/block/filalux_wings.png new file mode 100644 index 00000000..580e1ab2 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/filalux_wings.png differ diff --git a/src/main/resources/assets/betterend/textures/block/filalux_wings_large.png b/src/main/resources/assets/betterend/textures/block/filalux_wings_large.png new file mode 100644 index 00000000..98489441 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/filalux_wings_large.png differ diff --git a/src/main/resources/assets/betterend/textures/block/filalux_wings_top.png b/src/main/resources/assets/betterend/textures/block/filalux_wings_top.png new file mode 100644 index 00000000..0ba4a1ab Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/filalux_wings_top.png differ diff --git a/src/main/resources/assets/betterend/textures/block/filalux_wings_top_bottom.png b/src/main/resources/assets/betterend/textures/block/filalux_wings_top_bottom.png new file mode 100644 index 00000000..1c31559a Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/filalux_wings_top_bottom.png differ diff --git a/src/main/resources/assets/betterend/textures/block/filalux_wings_top_side.png b/src/main/resources/assets/betterend/textures/block/filalux_wings_top_side.png new file mode 100644 index 00000000..e42dbde7 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/filalux_wings_top_side.png differ diff --git a/src/main/resources/assets/betterend/textures/item/filalux_wings.aseprite b/src/main/resources/assets/betterend/textures/item/filalux_wings.aseprite new file mode 100644 index 00000000..ecf307bf Binary files /dev/null and b/src/main/resources/assets/betterend/textures/item/filalux_wings.aseprite differ