introduction of cherry fence gates

This commit is contained in:
Justin Parsell 2021-03-18 00:08:48 -04:00
parent 754e9020c2
commit 4d37a62a34
7 changed files with 114 additions and 0 deletions

View File

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

View File

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

View File

@ -0,0 +1,80 @@
{
"variants": {
"facing=east,in_wall=false,open=false": {
"uvlock": true,
"y": 270,
"model": "minecraft:block/acacia_fence_gate"
},
"facing=east,in_wall=false,open=true": {
"uvlock": true,
"y": 270,
"model": "minecraft:block/acacia_fence_gate_open"
},
"facing=east,in_wall=true,open=false": {
"uvlock": true,
"y": 270,
"model": "minecraft:block/acacia_fence_gate_wall"
},
"facing=east,in_wall=true,open=true": {
"uvlock": true,
"y": 270,
"model": "minecraft:block/acacia_fence_gate_wall_open"
},
"facing=north,in_wall=false,open=false": {
"uvlock": true,
"y": 180,
"model": "minecraft:block/acacia_fence_gate"
},
"facing=north,in_wall=false,open=true": {
"uvlock": true,
"y": 180,
"model": "minecraft:block/acacia_fence_gate_open"
},
"facing=north,in_wall=true,open=false": {
"uvlock": true,
"y": 180,
"model": "minecraft:block/acacia_fence_gate_wall"
},
"facing=north,in_wall=true,open=true": {
"uvlock": true,
"y": 180,
"model": "minecraft:block/acacia_fence_gate_wall_open"
},
"facing=south,in_wall=false,open=false": {
"uvlock": true,
"model": "minecraft:block/acacia_fence_gate"
},
"facing=south,in_wall=false,open=true": {
"uvlock": true,
"model": "minecraft:block/acacia_fence_gate_open"
},
"facing=south,in_wall=true,open=false": {
"uvlock": true,
"model": "minecraft:block/acacia_fence_gate_wall"
},
"facing=south,in_wall=true,open=true": {
"uvlock": true,
"model": "minecraft:block/acacia_fence_gate_wall_open"
},
"facing=west,in_wall=false,open=false": {
"uvlock": true,
"y": 90,
"model": "minecraft:block/acacia_fence_gate"
},
"facing=west,in_wall=false,open=true": {
"uvlock": true,
"y": 90,
"model": "minecraft:block/acacia_fence_gate_open"
},
"facing=west,in_wall=true,open=false": {
"uvlock": true,
"y": 90,
"model": "minecraft:block/acacia_fence_gate_wall"
},
"facing=west,in_wall=true,open=true": {
"uvlock": true,
"y": 90,
"model": "minecraft:block/acacia_fence_gate_wall_open"
}
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/template_fence_gate",
"textures": {
"texture": "minecraft:block/oak_planks"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/template_fence_gate_open",
"textures": {
"texture": "minecraft:block/oak_planks"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/template_fence_gate_wall",
"textures": {
"texture": "minecraft:block/oak_planks"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:block/template_fence_gate_wall_open",
"textures": {
"texture": "minecraft:block/oak_planks"
}
}