introduction of slab

This commit is contained in:
Justin Parsell 2021-03-18 21:39:26 -04:00
parent 832b9cb1aa
commit 9feddf72c2
8 changed files with 46 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import net.minecraft.block.FenceBlock;
import net.minecraft.block.FenceGateBlock;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.PillarBlock;
import net.minecraft.block.SlabBlock;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
@ -32,6 +33,7 @@ public class CherryBlocks {
public static final Block CHERRYFENCEGATE = registerFenceGate("cherry_fence_gate", FabricBlockSettings.copyOf(Blocks.OAK_FENCE_GATE), 5, 20); // Textures, recipe, loot_tables, tags (as required)
public static final Block CHERRYDOOR = registerDoor("cherry_door", FabricBlockSettings.copyOf(Blocks.OAK_DOOR), 5, 20); // TODO: recipe, loot_tables, tags (as required)
public static final Block CHERRYTRAPDOOR = registerTrapDoor("cherry_trapdoor", FabricBlockSettings.copyOf(Blocks.OAK_TRAPDOOR), 5, 20); //TODO: recipe, loot_tables, tags (as required)
public static final Block CHERRYSLAB = registerSlab("cherry_slab", FabricBlockSettings.copyOf(Blocks.OAK_SLAB), 5, 20); // TODO: recipe, loot tables, tags (as required)
private static Block registerBlock(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
Block block = new Block(settings);
@ -40,6 +42,13 @@ public class CherryBlocks {
return block;
}
private static Block registerSlab(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
Block block = new SlabBlock(settings);
Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);
FlammableBlockRegistry.getDefaultInstance().add(block, burnChance, burnSpread);
return block;
}
private static Block registerFence(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
Block block = new FenceBlock(settings);
Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);

View File

@ -20,6 +20,7 @@ public class CherryItems {
registerBlockItem("cherry_fence_gate", CherryBlocks.CHERRYFENCEGATE, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_door", CherryBlocks.CHERRYDOOR, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_trapdoor", CherryBlocks.CHERRYTRAPDOOR, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_slab", CherryBlocks.CHERRYSLAB, ItemGroup.BUILDING_BLOCKS);
}
// Register a standard blockItem

View File

@ -0,0 +1,13 @@
{
"variants": {
"type=bottom": {
"model": "cherry:block/cherry_slab"
},
"type=double": {
"model": "cherry:block/cherry_planks"
},
"type=top": {
"model": "cherry:block/cherry_slab_top"
}
}
}

View File

@ -8,5 +8,6 @@
"block.cherry.cherry_fence": "Cherry Fence",
"block.cherry.cherry_fence_gate": "Cherry Fence Gate",
"block.cherry.cherry_door": "Cherry Door",
"block.cherry.cherry_trapdoor": "Cherry Trapdoor"
"block.cherry.cherry_trapdoor": "Cherry Trapdoor",
"block.cherry.cherry_slab": "Cherry Slab"
}

View File

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/slab",
"textures": {
"bottom": "cherry:block/cherry_planks",
"top": "cherry:block/cherry_planks",
"side": "cherry:block/cherry_planks"
}
}

View File

@ -0,0 +1,8 @@
{
"parent": "minecraft:block/slab_top",
"textures": {
"bottom": "cherry:block/cherry_planks",
"top": "cherry:block/cherry_planks",
"side": "cherry:block/cherry_planks"
}
}

View File

@ -0,0 +1,4 @@
{
"parent": "cherry:block/cherry_slab"
}

View File

@ -1,3 +1,3 @@
{
"parent": "cherry:block/cherry_trapdoor"
"parent": "cherry:block/cherry_trapdoor_bottom"
}