From 87337e4f727d9984fdc97f0894856dc69706b874 Mon Sep 17 00:00:00 2001 From: Cheeserolls Date: Sat, 23 May 2015 16:47:31 +0100 Subject: [PATCH] Add mud brick stairs --- .../biomesoplenty/api/block/BOPBlocks.java | 2 + .../biomesoplenty/common/init/ModBlocks.java | 10 +++-- .../common/init/ModCrafting.java | 6 +-- .../blockstates/mud_brick_stairs.json | 44 +++++++++++++++++++ .../models/block/mud_brick_inner_stairs.json | 8 ++++ .../models/block/mud_brick_outer_stairs.json | 8 ++++ .../models/block/mud_brick_stairs.json | 8 ++++ .../models/item/mud_brick_stairs.json | 13 ++++++ 8 files changed, 92 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/assets/biomesoplenty/blockstates/mud_brick_stairs.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/mud_brick_inner_stairs.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/mud_brick_outer_stairs.json create mode 100644 src/main/resources/assets/biomesoplenty/models/block/mud_brick_stairs.json create mode 100644 src/main/resources/assets/biomesoplenty/models/item/mud_brick_stairs.json diff --git a/src/main/java/biomesoplenty/api/block/BOPBlocks.java b/src/main/java/biomesoplenty/api/block/BOPBlocks.java index 1983d531d..f33a48c1c 100644 --- a/src/main/java/biomesoplenty/api/block/BOPBlocks.java +++ b/src/main/java/biomesoplenty/api/block/BOPBlocks.java @@ -122,6 +122,8 @@ public class BOPBlocks public static Block other_slab; public static Block double_other_slab; + public static Block mud_brick_stairs; + public static Block flower_vine; public static Block ivy; public static Block moss; diff --git a/src/main/java/biomesoplenty/common/init/ModBlocks.java b/src/main/java/biomesoplenty/common/init/ModBlocks.java index b6d80e16b..a55f4756c 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/common/init/ModBlocks.java @@ -9,8 +9,10 @@ package biomesoplenty.common.init; import static biomesoplenty.api.block.BOPBlocks.*; + import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStairs; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; @@ -29,6 +31,7 @@ import biomesoplenty.common.block.*; import biomesoplenty.common.command.BOPCommand; import biomesoplenty.common.enums.*; import biomesoplenty.common.fluids.blocks.*; +import biomesoplenty.common.util.BOPReflectionHelper; import biomesoplenty.common.util.block.BlockStateUtils; import biomesoplenty.common.util.inventory.CreativeTabBOP; import biomesoplenty.core.BiomesOPlenty; @@ -74,6 +77,8 @@ public class ModBlocks hard_ice = registerBlock( (new BlockBOPGeneric()).setHardness(0.75F), "hard_ice" ); hard_sand = registerBlock( (new BlockBOPGeneric(Material.sand)).setHardness(0.9F).setStepSound(Block.soundTypeSand), "hard_sand" ); mud_brick_block = registerBlock( (new BlockBOPGeneric()).setResistance(2.0F), "mud_brick_block" ); + + mud_brick_stairs = registerBlock( BOPReflectionHelper.construct(BlockStairs.class, (IBlockState)mud_brick_block.getDefaultState()), "mud_brick_stairs"); // stone and brick slabs // need to register items at the same time really so that they can be mapped to each other - bit messy this @@ -110,8 +115,7 @@ public class ModBlocks double_wood_slab_1 = registerBlock( BlockBOPDoubleWoodSlab.paging.getBlock(1), "double_wood_slab_1", null ); // no creative tab for double slab BOPItems.wood_slab_1 = ModItems.registerItem( new ItemSlab(wood_slab_1, (BlockSlab)wood_slab_1, (BlockSlab)double_wood_slab_1), "wood_slab_1"); GameData.getBlockItemMap().put(wood_slab_1, BOPItems.wood_slab_1); - GameData.getBlockItemMap().put(double_wood_slab_1, BOPItems.wood_slab_1); - + GameData.getBlockItemMap().put(double_wood_slab_1, BOPItems.wood_slab_1); // 16 wood types, 16 per BlockBOPPlanks instance, needs 1 'pages' BlockBOPPlanks.createAllPages(); @@ -195,8 +199,6 @@ public class ModBlocks hellbark_door = registerDoor( new BlockBOPDoor(BOPWoods.HELLBARK), "hellbark_door", BOPItems.hellbark_door ); jacaranda_door = registerDoor( new BlockBOPDoor(BOPWoods.JACARANDA), "jacaranda_door", BOPItems.jacaranda_door ); mahogany_door = registerDoor( new BlockBOPDoor(BOPWoods.MAHOGANY), "mahogany_door", BOPItems.mahogany_door ); - - // TODO: stone/mud brick stairs and slabs //vines diff --git a/src/main/java/biomesoplenty/common/init/ModCrafting.java b/src/main/java/biomesoplenty/common/init/ModCrafting.java index 34a2456c9..a5d44df5d 100644 --- a/src/main/java/biomesoplenty/common/init/ModCrafting.java +++ b/src/main/java/biomesoplenty/common/init/ModCrafting.java @@ -88,9 +88,9 @@ public class ModCrafting GameRegistry.addShapedRecipe(otherSlab.getVariantItem(slabType, 6), new Object[] {"RRR", 'R', otherSlab.getFullBlockVariantItem(slabType)}); } - // TODO: implement these blocks - // GameRegistry.addShapedRecipe(new ItemStack(BOPCBlocks.mudBricksStairs, 4), new Object[] {" R", " RR", "RRR", 'R', BOPCBlocks.mudBricks}); - // GameRegistry.addShapedRecipe(new ItemStack(BOPCBlocks.mudBricksStairs, 4), new Object[] {"R ", "RR ", "RRR", 'R', BOPCBlocks.mudBricks}); + GameRegistry.addShapedRecipe(new ItemStack(BOPBlocks.mud_brick_stairs, 4), new Object[] {" R", " RR", "RRR", 'R', BOPBlocks.mud_brick_block}); + GameRegistry.addShapedRecipe(new ItemStack(BOPBlocks.mud_brick_stairs, 4), new Object[] {"R ", "RR ", "RRR", 'R', BOPBlocks.mud_brick_block}); + /*** Wood stairs and slabs ***/ diff --git a/src/main/resources/assets/biomesoplenty/blockstates/mud_brick_stairs.json b/src/main/resources/assets/biomesoplenty/blockstates/mud_brick_stairs.json new file mode 100644 index 000000000..e85a21dc3 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/blockstates/mud_brick_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "biomesoplenty:mud_brick_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "biomesoplenty:mud_brick_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "biomesoplenty:mud_brick_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "biomesoplenty:mud_brick_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "biomesoplenty:mud_brick_outer_stairs" }, + "facing=west,half=bottom,shape=outer_right": { "model": "biomesoplenty:mud_brick_outer_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "biomesoplenty:mud_brick_outer_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "biomesoplenty:mud_brick_outer_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "biomesoplenty:mud_brick_outer_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "biomesoplenty:mud_brick_outer_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "biomesoplenty:mud_brick_outer_stairs" }, + "facing=north,half=bottom,shape=outer_left": { "model": "biomesoplenty:mud_brick_outer_stairs", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "biomesoplenty:mud_brick_inner_stairs" }, + "facing=west,half=bottom,shape=inner_right": { "model": "biomesoplenty:mud_brick_inner_stairs", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "biomesoplenty:mud_brick_inner_stairs", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "biomesoplenty:mud_brick_inner_stairs", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "biomesoplenty:mud_brick_inner_stairs", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "biomesoplenty:mud_brick_inner_stairs", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "biomesoplenty:mud_brick_inner_stairs" }, + "facing=north,half=bottom,shape=inner_left": { "model": "biomesoplenty:mud_brick_inner_stairs", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "biomesoplenty:mud_brick_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "biomesoplenty:mud_brick_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "biomesoplenty:mud_brick_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "biomesoplenty:mud_brick_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "biomesoplenty:mud_brick_outer_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "biomesoplenty:mud_brick_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "biomesoplenty:mud_brick_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "biomesoplenty:mud_brick_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "biomesoplenty:mud_brick_outer_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "biomesoplenty:mud_brick_outer_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "biomesoplenty:mud_brick_outer_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "biomesoplenty:mud_brick_outer_stairs", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "biomesoplenty:mud_brick_inner_stairs", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "biomesoplenty:mud_brick_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "biomesoplenty:mud_brick_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "biomesoplenty:mud_brick_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "biomesoplenty:mud_brick_inner_stairs", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "biomesoplenty:mud_brick_inner_stairs", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "biomesoplenty:mud_brick_inner_stairs", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "biomesoplenty:mud_brick_inner_stairs", "x": 180, "uvlock": true } + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/mud_brick_inner_stairs.json b/src/main/resources/assets/biomesoplenty/models/block/mud_brick_inner_stairs.json new file mode 100644 index 000000000..4345873ca --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/mud_brick_inner_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "biomesoplenty:blocks/mud_brick_block", + "top": "biomesoplenty:blocks/mud_brick_block", + "side": "biomesoplenty:blocks/mud_brick_block" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/mud_brick_outer_stairs.json b/src/main/resources/assets/biomesoplenty/models/block/mud_brick_outer_stairs.json new file mode 100644 index 000000000..1f5719f69 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/mud_brick_outer_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "biomesoplenty:blocks/mud_brick_block", + "top": "biomesoplenty:blocks/mud_brick_block", + "side": "biomesoplenty:blocks/mud_brick_block" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/block/mud_brick_stairs.json b/src/main/resources/assets/biomesoplenty/models/block/mud_brick_stairs.json new file mode 100644 index 000000000..166655284 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/block/mud_brick_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "biomesoplenty:blocks/mud_brick_block", + "top": "biomesoplenty:blocks/mud_brick_block", + "side": "biomesoplenty:blocks/mud_brick_block" + } +} diff --git a/src/main/resources/assets/biomesoplenty/models/item/mud_brick_stairs.json b/src/main/resources/assets/biomesoplenty/models/item/mud_brick_stairs.json new file mode 100644 index 000000000..c5744b491 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/mud_brick_stairs.json @@ -0,0 +1,13 @@ +{ + "parent": "biomesoplenty:block/mud_brick_stairs", + "display": { + "thirdperson": { + "rotation": [ 10, -45, 170 ], + "translation": [ 0, 1.5, -2.75 ], + "scale": [ 0.375, 0.375, 0.375 ] + }, + "gui": { + "rotation": [ 0, 180, 0 ] + } + } +}