introduction of cherry fence
This commit is contained in:
@@ -7,6 +7,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.registry.FlammableBlockRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.FenceBlock;
|
||||
import net.minecraft.block.LeavesBlock;
|
||||
import net.minecraft.block.PillarBlock;
|
||||
import net.minecraft.util.Identifier;
|
||||
@@ -20,14 +21,22 @@ public class CherryBlocks {
|
||||
public static final Block CHERRYWOODSTRIPPED = registerPillar("stripped_cherry_wood", FabricBlockSettings.copyOf(Blocks.STRIPPED_OAK_WOOD), 5, 5);
|
||||
public static final Block CHERRYLEAVES = registerLeaves("cherry_leaves", FabricBlockSettings.copyOf(Blocks.OAK_LEAVES), 30, 60, 6649929);
|
||||
public static final Block CHERRYPLANKS = registerBlock("cherry_planks", FabricBlockSettings.copyOf(Blocks.OAK_PLANKS), 5, 20);
|
||||
public static final Block CHERRYFENCE = registerFence("cherry_fence", FabricBlockSettings.copyOf(Blocks.OAK_FENCE), 5, 20);
|
||||
|
||||
private static Block registerBlock(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread){
|
||||
private static Block registerBlock(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
|
||||
Block block = new Block(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);
|
||||
FlammableBlockRegistry.getDefaultInstance().add(block, burnChance, burnSpread);
|
||||
return block;
|
||||
}
|
||||
|
||||
private static Block registerPillar(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread){
|
||||
Block block = new PillarBlock(settings);
|
||||
Registry.register(Registry.BLOCK, new Identifier("cherry", blockID), block);
|
||||
|
||||
@@ -16,6 +16,7 @@ public class CherryItems {
|
||||
registerBlockItem("stripped_cherry_wood", CherryBlocks.CHERRYWOODSTRIPPED, ItemGroup.BUILDING_BLOCKS);
|
||||
registerBlockItem("cherry_leaves", CherryBlocks.CHERRYLEAVES, ItemGroup.BUILDING_BLOCKS, 6649929);
|
||||
registerBlockItem("cherry_planks", CherryBlocks.CHERRYPLANKS, ItemGroup.BUILDING_BLOCKS);
|
||||
registerBlockItem("cherry_fence", CherryBlocks.CHERRYFENCE, ItemGroup.BUILDING_BLOCKS);
|
||||
}
|
||||
|
||||
// Register a standard blockItem
|
||||
|
||||
Reference in New Issue
Block a user