introduction of slab
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user