Bulb vine lantern

This commit is contained in:
paulevsGitch 2020-11-27 00:02:03 +03:00
parent 513bbaa1b6
commit c3ab9d26f3
8 changed files with 123 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -16,6 +16,7 @@ import ru.betterend.blocks.BlockBlueVineLantern;
import ru.betterend.blocks.BlockBlueVineSeed; import ru.betterend.blocks.BlockBlueVineSeed;
import ru.betterend.blocks.BlockBubbleCoral; import ru.betterend.blocks.BlockBubbleCoral;
import ru.betterend.blocks.BlockBulbVine; import ru.betterend.blocks.BlockBulbVine;
import ru.betterend.blocks.BlockBulbVineLantern;
import ru.betterend.blocks.BlockBulbVineSeed; import ru.betterend.blocks.BlockBulbVineSeed;
import ru.betterend.blocks.BlockChorusGrass; import ru.betterend.blocks.BlockChorusGrass;
import ru.betterend.blocks.BlockDragonTreeSapling; 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 AURORA_CRYSTAL = registerBlock("aurora_crystal", new AuroraCrystalBlock());
public static final Block AMBER_BLOCK = registerBlock("amber_block", new BlockAmber()); 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 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 DIORITE_LANTERN = registerBlock("diorite_lantern", new BlockStoneLantern(Blocks.DIORITE));
public static final Block GRANITE_LANTERN = registerBlock("granite_lantern", new BlockStoneLantern(Blocks.GRANITE)); 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 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 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 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 // // Blocks With Entity //
public static final Block END_STONE_SMELTER = registerBlock("end_stone_smelter", new EndStoneSmelter()); 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()); public static final Block INFUSION_PEDESTAL = registerBlock("infusion_pedestal", new InfusionPedestal());
//Technical //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() {} public static void register() {}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": [
{ "model": "betterend:block/bulb_vine_lantern" }
]
}
}

View file

@ -0,0 +1,3 @@
{
"defaultMaterial": "betterend:glow_inc"
}

View file

@ -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" }
}
}
]
}

View file

@ -0,0 +1,3 @@
{
"parent": "betterend:block/bulb_vine_lantern"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB