GenericWood: add stairs

This commit is contained in:
Matthias Schiffer 2014-05-26 04:08:45 +02:00
parent d8288f071f
commit 6e184e4012
2 changed files with 19 additions and 3 deletions

View file

@ -11,6 +11,7 @@ import net.minecraft.block.BlockLeaves;
import net.minecraft.block.BlockLog; import net.minecraft.block.BlockLog;
import net.minecraft.block.BlockSapling; import net.minecraft.block.BlockSapling;
import net.minecraft.block.BlockSlab; import net.minecraft.block.BlockSlab;
import net.minecraft.block.BlockStairs;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@ -35,6 +36,7 @@ public class GenericWood {
public final BlockSapling sapling; public final BlockSapling sapling;
public final BlockSlab slab; public final BlockSlab slab;
public final BlockSlab double_slab; public final BlockSlab double_slab;
public final BlockStairs stairs;
public GenericWood(Info info) { public GenericWood(Info info) {
this.info = info; this.info = info;
@ -45,6 +47,7 @@ public class GenericWood {
sapling = new Sapling(); sapling = new Sapling();
slab = new Slab(false); slab = new Slab(false);
double_slab = new Slab(true); double_slab = new Slab(true);
stairs = new Stairs();
} }
public void register() { public void register() {
@ -59,8 +62,11 @@ public class GenericWood {
GameRegistry.registerBlock(double_slab, null, "double_wooden_slab_" + info.getName().toLowerCase()); 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.registerItem(new ItemSlab(double_slab, slab, double_slab, true), "double_wooden_slab_" + info.getName().toLowerCase());
GameRegistry.addRecipe(new ItemStack(planks, 4, 0), "#", '#', log); GameRegistry.registerBlock(stairs, "stairs_wood_" + info.getName().toLowerCase());
GameRegistry.addRecipe(new ItemStack(slab, 6, 0), "###", '#', planks);
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 { 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 static abstract class Info {
public abstract String getName(); public abstract String getName();

View file

@ -2,4 +2,5 @@ tile.woodCherry.name=Cherry Tree Wood Planks
tile.logCherry.name=Cherry Tree Wood tile.logCherry.name=Cherry Tree Wood
tile.leavesCherry.name=Cherry Tree Leaves tile.leavesCherry.name=Cherry Tree Leaves
tile.saplingCherry.name=Cherry Tree Sapling tile.saplingCherry.name=Cherry Tree Sapling
tile.woodSlabCherry.name=Cherry Tree Wood Slab tile.woodSlabCherry.name=Cherry Tree Wood Slab
tile.stairsWoodCherry.name=Cherry Tree Wood Stairs