GenericWood: add stairs
This commit is contained in:
parent
d8288f071f
commit
6e184e4012
2 changed files with 19 additions and 3 deletions
|
@ -11,6 +11,7 @@ import net.minecraft.block.BlockLeaves;
|
|||
import net.minecraft.block.BlockLog;
|
||||
import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -35,6 +36,7 @@ public class GenericWood {
|
|||
public final BlockSapling sapling;
|
||||
public final BlockSlab slab;
|
||||
public final BlockSlab double_slab;
|
||||
public final BlockStairs stairs;
|
||||
|
||||
public GenericWood(Info info) {
|
||||
this.info = info;
|
||||
|
@ -45,6 +47,7 @@ public class GenericWood {
|
|||
sapling = new Sapling();
|
||||
slab = new Slab(false);
|
||||
double_slab = new Slab(true);
|
||||
stairs = new Stairs();
|
||||
}
|
||||
|
||||
public void register() {
|
||||
|
@ -59,8 +62,11 @@ public class GenericWood {
|
|||
GameRegistry.registerBlock(double_slab, null, "double_wooden_slab_" + info.getName().toLowerCase());
|
||||
GameRegistry.registerItem(new ItemSlab(double_slab, slab, double_slab, true), "double_wooden_slab_" + info.getName().toLowerCase());
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(planks, 4, 0), "#", '#', log);
|
||||
GameRegistry.addRecipe(new ItemStack(slab, 6, 0), "###", '#', planks);
|
||||
GameRegistry.registerBlock(stairs, "stairs_wood_" + info.getName().toLowerCase());
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(planks, 4), "#", '#', log);
|
||||
GameRegistry.addRecipe(new ItemStack(slab, 6), "###", '#', planks);
|
||||
GameRegistry.addRecipe(new ItemStack(stairs, 4), "# ", "## ", "###", '#', planks);
|
||||
}
|
||||
|
||||
private class Planks extends Block {
|
||||
|
@ -247,6 +253,15 @@ public class GenericWood {
|
|||
}
|
||||
}
|
||||
|
||||
private class Stairs extends BlockStairs {
|
||||
public Stairs() {
|
||||
super(planks, 0);
|
||||
|
||||
setBlockName("stairsWood" + info.getName());
|
||||
setLightOpacity(0);
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class Info {
|
||||
public abstract String getName();
|
||||
|
||||
|
|
|
@ -3,3 +3,4 @@ tile.logCherry.name=Cherry Tree Wood
|
|||
tile.leavesCherry.name=Cherry Tree Leaves
|
||||
tile.saplingCherry.name=Cherry Tree Sapling
|
||||
tile.woodSlabCherry.name=Cherry Tree Wood Slab
|
||||
tile.stairsWoodCherry.name=Cherry Tree Wood Stairs
|
||||
|
|
Reference in a new issue