Introduction of stairs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user