diff --git a/src/main/java/ru/betterend/blocks/BlockBulbVineLantern.java b/src/main/java/ru/betterend/blocks/BlockBulbVineLantern.java new file mode 100644 index 00000000..4ab209a1 --- /dev/null +++ b/src/main/java/ru/betterend/blocks/BlockBulbVineLantern.java @@ -0,0 +1,48 @@ +package ru.betterend.blocks; + +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Material; +import net.minecraft.block.MaterialColor; +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.world.BlockView; +import net.minecraft.world.WorldView; +import ru.betterend.blocks.basis.BlockBaseNotFull; +import ru.betterend.client.render.ERenderLayer; +import ru.betterend.interfaces.IRenderTypeable; + +public class BlockBulbVineLantern extends BlockBaseNotFull implements IRenderTypeable { + private static final VoxelShape SHAPE_CEIL = Block.createCuboidShape(4, 4, 4, 12, 16, 12); + + public BlockBulbVineLantern() { + super(FabricBlockSettings.of(Material.METAL) + .sounds(BlockSoundGroup.LANTERN) + .hardness(1) + .resistance(1) + .breakByTool(FabricToolTags.PICKAXES) + .materialColor(MaterialColor.LIGHT_GRAY) + .requiresTool() + .luminance(15)); + } + + @Override + public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { + return sideCoversSmallSquare(world, pos.up(), Direction.DOWN); + } + + @Override + public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) { + return SHAPE_CEIL; + } + + @Override + public ERenderLayer getRenderLayer() { + return ERenderLayer.CUTOUT; + } +} diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index 23c0dacc..a4a944a1 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -16,6 +16,7 @@ import ru.betterend.blocks.BlockBlueVineLantern; import ru.betterend.blocks.BlockBlueVineSeed; import ru.betterend.blocks.BlockBubbleCoral; import ru.betterend.blocks.BlockBulbVine; +import ru.betterend.blocks.BlockBulbVineLantern; import ru.betterend.blocks.BlockBulbVineSeed; import ru.betterend.blocks.BlockChorusGrass; import ru.betterend.blocks.BlockDragonTreeSapling; @@ -180,6 +181,7 @@ public class EndBlocks { public static final Block AURORA_CRYSTAL = registerBlock("aurora_crystal", new AuroraCrystalBlock()); public static final Block AMBER_BLOCK = registerBlock("amber_block", new BlockAmber()); + // Lanterns public static final Block ANDESITE_LANTERN = registerBlock("andesite_lantern", new BlockStoneLantern(Blocks.ANDESITE)); public static final Block DIORITE_LANTERN = registerBlock("diorite_lantern", new BlockStoneLantern(Blocks.DIORITE)); public static final Block GRANITE_LANTERN = registerBlock("granite_lantern", new BlockStoneLantern(Blocks.GRANITE)); @@ -187,6 +189,7 @@ public class EndBlocks { public static final Block PURPUR_LANTERN = registerBlock("purpur_lantern", new BlockStoneLantern(Blocks.PURPUR_BLOCK)); public static final Block END_STONE_LANTERN = registerBlock("end_stone_lantern", new BlockStoneLantern(Blocks.END_STONE)); public static final Block BLACKSTONE_LANTERN = registerBlock("blackstone_lantern", new BlockStoneLantern(Blocks.BLACKSTONE)); + public static final Block BULB_VINE_LANTERN = registerBlock("bulb_vine_lantern", new BlockBulbVineLantern()); // Blocks With Entity // public static final Block END_STONE_SMELTER = registerBlock("end_stone_smelter", new EndStoneSmelter()); @@ -194,7 +197,7 @@ public class EndBlocks { public static final Block INFUSION_PEDESTAL = registerBlock("infusion_pedestal", new InfusionPedestal()); //Technical - public static final Block END_PORTAL_BLOCK = registerBlock("end_portal_block", new EndPortalBlock()); + public static final Block END_PORTAL_BLOCK = registerBlockNI("end_portal_block", new EndPortalBlock()); public static void register() {} diff --git a/src/main/resources/assets/betterend/blockstates/bulb_vine_lantern.json b/src/main/resources/assets/betterend/blockstates/bulb_vine_lantern.json new file mode 100644 index 00000000..dd2043d2 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/bulb_vine_lantern.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": [ + { "model": "betterend:block/bulb_vine_lantern" } + ] + } +} diff --git a/src/main/resources/assets/betterend/materialmaps/block/bulb_vine_lantern.json b/src/main/resources/assets/betterend/materialmaps/block/bulb_vine_lantern.json new file mode 100644 index 00000000..2163812f --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/block/bulb_vine_lantern.json @@ -0,0 +1,3 @@ +{ + "defaultMaterial": "betterend:glow_inc" +} diff --git a/src/main/resources/assets/betterend/models/block/bulb_vine_lantern.json b/src/main/resources/assets/betterend/models/block/bulb_vine_lantern.json new file mode 100644 index 00000000..cac5d4b2 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/bulb_vine_lantern.json @@ -0,0 +1,58 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "parent": "block/block", + "textures": { + "particle": "betterend:block/bulb_vine_lantern", + "texture": "betterend:block/bulb_vine_lantern" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 4, 4, 4 ], + "to": [ 12, 12, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 8, 0, 16, 8 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 8, 8 ], "texture": "#texture" }, + "north": { "uv": [ 0, 8, 8, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 8, 8, 16 ], "texture": "#texture" }, + "west": { "uv": [ 0, 8, 8, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 8, 8, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box11", + "from": [ 6, 12, 6 ], + "to": [ 10, 13, 10 ], + "faces": { + "up": { "uv": [ 10, 8, 14, 12 ], "texture": "#texture" }, + "north": { "uv": [ 10, 12, 14, 13 ], "texture": "#texture" }, + "south": { "uv": [ 10, 12, 14, 13 ], "texture": "#texture" }, + "west": { "uv": [ 10, 12, 14, 13 ], "texture": "#texture" }, + "east": { "uv": [ 10, 12, 14, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX15", + "from": [ 7, 13, 7 ], + "to": [ 7.001, 16, 10 ], + "rotation": { "origin": [ 7, 13, 7 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 10, 13, 13, 16 ], "texture": "#texture" }, + "east": { "uv": [ 10, 13, 13, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX15", + "from": [ 9, 13, 7 ], + "to": [ 9.001, 16, 10 ], + "rotation": { "origin": [ 9, 13, 7 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 10, 13, 13, 16 ], "texture": "#texture" }, + "east": { "uv": [ 10, 13, 13, 16 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/item/bulb_vine_lantern.json b/src/main/resources/assets/betterend/models/item/bulb_vine_lantern.json new file mode 100644 index 00000000..a111ff2a --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/bulb_vine_lantern.json @@ -0,0 +1,3 @@ +{ + "parent": "betterend:block/bulb_vine_lantern" +} diff --git a/src/main/resources/assets/betterend/textures/block/bulb_vine.png b/src/main/resources/assets/betterend/textures/block/bulb_vine.png index 2c9f8ee8..8cb95297 100644 Binary files a/src/main/resources/assets/betterend/textures/block/bulb_vine.png and b/src/main/resources/assets/betterend/textures/block/bulb_vine.png differ diff --git a/src/main/resources/assets/betterend/textures/block/bulb_vine_lantern.png b/src/main/resources/assets/betterend/textures/block/bulb_vine_lantern.png new file mode 100644 index 00000000..8f733b70 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/bulb_vine_lantern.png differ