introduction of cherry fence
This commit is contained in:
parent
44800b5ff3
commit
78eaec1b10
|
@ -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,6 +21,7 @@ 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) {
|
||||
Block block = new Block(settings);
|
||||
|
@ -28,6 +30,13 @@ public class CherryBlocks {
|
|||
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
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"apply": {
|
||||
"model": "minecraft:block/acacia_fence_post"
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"north": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "minecraft:block/acacia_fence_side",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"east": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "minecraft:block/acacia_fence_side",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"south": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "minecraft:block/acacia_fence_side",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"west": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "minecraft:block/acacia_fence_side",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -4,5 +4,6 @@
|
|||
"block.cherry.stripped_cherry_log": "Stripped Cherry Log",
|
||||
"block.cherry.stripped_cherry_wood": "Stripped Cherry Wood",
|
||||
"block.cherry.cherry_leaves": "Cherry Leaves",
|
||||
"block.cherry.cherry_planks": "Cherry Planks"
|
||||
"block.cherry.cherry_planks": "Cherry Planks",
|
||||
"block.cherry.cherry_fence": "Cherry Fence"
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "cherry:cherry_fence"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"group": "wooden_fence",
|
||||
"pattern": [
|
||||
"W#W",
|
||||
"W#W"
|
||||
],
|
||||
"key": {
|
||||
"#": {
|
||||
"item": "minecraft:stick"
|
||||
},
|
||||
"W": {
|
||||
"item": "cherry:cherry_planks"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "cherry:cherry_fence",
|
||||
"count": 3
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"cherry:cherry_fence"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"cherry:cherry_fence"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue