introduction of cherry fence gates

This commit is contained in:
2021-03-18 00:08:48 -04:00
parent 754e9020c2
commit 4d37a62a34
7 changed files with 114 additions and 0 deletions
@@ -9,6 +9,7 @@ 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.FenceGateBlock;
import net.minecraft.block.LeavesBlock;
import net.minecraft.block.PillarBlock;
import net.minecraft.client.render.RenderLayer;
@@ -27,6 +28,7 @@ public class CherryBlocks {
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); // TODO: Textures, tags (as required)
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: Textures, recipe, loot_tables, tags (as required)
private static Block registerBlock(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
@@ -43,6 +45,13 @@ public class CherryBlocks {
return block;
}
private static Block registerFenceGate(String blockID, FabricBlockSettings settings, int burnChance, int burnSpread) {
Block block = new FenceGateBlock(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);
@@ -17,6 +17,7 @@ public class CherryItems {
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);
registerBlockItem("cherry_fence_gate", CherryBlocks.CHERRYFENCEGATE, ItemGroup.BUILDING_BLOCKS);
registerBlockItem("cherry_door", CherryBlocks.CHERRYDOOR, ItemGroup.BUILDING_BLOCKS);
}