Introduction of stairs
This commit is contained in:
parent
daf7b7c836
commit
490ca48c80
|
@ -0,0 +1,15 @@
|
|||
package net.parsell.cherry.common.blocks;
|
||||
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.StairsBlock;
|
||||
|
||||
public class CherryStairsBlock extends StairsBlock{
|
||||
private Block baseBlock;
|
||||
|
||||
public CherryStairsBlock(BlockState baseBlockState, AbstractBlock.Settings settings) {
|
||||
super(baseBlockState, settings);
|
||||
this.baseBlock = baseBlockState.getBlock();
|
||||
}
|
||||
}
|
|
@ -7,17 +7,18 @@ import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
|
|||
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.BlockState;
|
||||
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.block.SlabBlock;
|
||||
import net.minecraft.block.StairsBlock;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.parsell.cherry.common.blocks.CherryDoorBlock;
|
||||
import net.parsell.cherry.common.blocks.CherryTrapdoorBlock;
|
||||
import net.parsell.cherry.common.blocks.*;
|
||||
import net.parsell.cherry.mixin.AxeItemAccessor;
|
||||
|
||||
public class CherryBlocks {
|
||||
|
@ -34,6 +35,7 @@ public class CherryBlocks {
|
|||
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)
|
||||
public static final Block CHERRYSTAIRS = registerStair("cherry_stairs", CHERRYPLANKS.getDefaultState(), FabricBlockSettings.copyOf(Blocks.OAK_STAIRS), 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);
|
||||
|
@ -49,6 +51,13 @@ public class CherryBlocks {
|
|||
return block;
|
||||
}
|
||||
|
||||
private static Block registerStair(String blockID, BlockState baseBlockState, FabricBlockSettings settings, int burnChance, int burnSpread) {
|
||||
Block block = new CherryStairsBlock(baseBlockState, 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);
|
||||
|
|
|
@ -21,6 +21,7 @@ public class CherryItems {
|
|||
registerBlockItem("cherry_door", CherryBlocks.CHERRYDOOR, ItemGroup.BUILDING_BLOCKS);
|
||||
registerBlockItem("cherry_trapdoor", CherryBlocks.CHERRYTRAPDOOR, ItemGroup.BUILDING_BLOCKS);
|
||||
registerBlockItem("cherry_slab", CherryBlocks.CHERRYSLAB, ItemGroup.BUILDING_BLOCKS);
|
||||
//registerBlockItem("cherry_stairs", CherryBlocks.CHERRYSTAIRS, ItemGroup.BUILDING_BLOCKS);
|
||||
}
|
||||
|
||||
// Register a standard blockItem
|
||||
|
|
|
@ -0,0 +1,209 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=east,half=bottom,shape=inner_left": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=east,half=bottom,shape=inner_right": {
|
||||
"model": "cherry:block/cherry_stairs_inner"
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_left": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_right": {
|
||||
"model": "cherry:block/cherry_stairs_outer"
|
||||
},
|
||||
"facing=east,half=bottom,shape=straight": {
|
||||
"model": "cherry:block/cherry_stairs"
|
||||
},
|
||||
"facing=east,half=top,shape=inner_left": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"x": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=east,half=top,shape=inner_right": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"x": 180,
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=east,half=top,shape=outer_left": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"x": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=east,half=top,shape=outer_right": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"x": 180,
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=east,half=top,shape=straight": {
|
||||
"model": "cherry:block/cherry_stairs",
|
||||
"x": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_left": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_right": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_left": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_right": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=bottom,shape=straight": {
|
||||
"model": "cherry:block/cherry_stairs",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=top,shape=inner_left": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"x": 180,
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=top,shape=inner_right": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"x": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=top,shape=outer_left": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"x": 180,
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=top,shape=outer_right": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"x": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=north,half=top,shape=straight": {
|
||||
"model": "cherry:block/cherry_stairs",
|
||||
"x": 180,
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_left": {
|
||||
"model": "cherry:block/cherry_stairs_inner"
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_right": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_left": {
|
||||
"model": "cherry:block/cherry_stairs_outer"
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_right": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=south,half=bottom,shape=straight": {
|
||||
"model": "cherry:block/cherry_stairs",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=south,half=top,shape=inner_left": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"x": 180,
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=south,half=top,shape=inner_right": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"x": 180,
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=south,half=top,shape=outer_left": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"x": 180,
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=south,half=top,shape=outer_right": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"x": 180,
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=south,half=top,shape=straight": {
|
||||
"model": "cherry:block/cherry_stairs",
|
||||
"x": 180,
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_left": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_right": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_left": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_right": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=bottom,shape=straight": {
|
||||
"model": "cherry:block/cherry_stairs",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=top,shape=inner_left": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"x": 180,
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=top,shape=inner_right": {
|
||||
"model": "cherry:block/cherry_stairs_inner",
|
||||
"x": 180,
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=top,shape=outer_left": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"x": 180,
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=top,shape=outer_right": {
|
||||
"model": "cherry:block/cherry_stairs_outer",
|
||||
"x": 180,
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
},
|
||||
"facing=west,half=top,shape=straight": {
|
||||
"model": "cherry:block/cherry_stairs",
|
||||
"x": 180,
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,5 +9,6 @@
|
|||
"block.cherry.cherry_fence_gate": "Cherry Fence Gate",
|
||||
"block.cherry.cherry_door": "Cherry Door",
|
||||
"block.cherry.cherry_trapdoor": "Cherry Trapdoor",
|
||||
"block.cherry.cherry_slab": "Cherry Slab"
|
||||
"block.cherry.cherry_slab": "Cherry Slab",
|
||||
"block.cherry.cherry_stairs": "Cherry Stairs"
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "minecraft:block/stairs",
|
||||
"textures": {
|
||||
"bottom": "cherry:block/cherry_planks",
|
||||
"top": "cherry:block/cherry_planks",
|
||||
"side": "cherry:block/cherry_planks"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "minecraft:block/inner_stairs",
|
||||
"textures": {
|
||||
"bottom": "cherry:block/cherry_planks",
|
||||
"top": "cherry:block/cherry_planks",
|
||||
"side": "cherry:block/cherry_planks"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"parent": "minecraft:block/outer_stairs",
|
||||
"textures": {
|
||||
"bottom": "cherry:block/cherry_planks",
|
||||
"top": "cherry:block/cherry_planks",
|
||||
"side": "cherry:block/cherry_planks"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "cherry:block/cherry_stairs"
|
||||
}
|
Loading…
Reference in New Issue