From f430e8dd3db22a17c2a4a2c3fea3a18d87ced01a Mon Sep 17 00:00:00 2001 From: Amnet Date: Mon, 15 Apr 2013 01:11:00 +0200 Subject: [PATCH] Compressed Logs and Slabs. Reworked stairs a bit, still need some fixing. --- .../biomesop/blocks/BlockAcaciaLog.java | 1 + .../biomesop/blocks/BlockAcaciaSlab.java | 2 +- .../biomesop/blocks/BlockBOPFlower.java | 11 + .../tdwp_ftw/biomesop/blocks/BlockBOPLog.java | 156 ++++++++++++++ .../biomesop/blocks/BlockBOPSlab.java | 136 +++++++++++-- .../biomesop/blocks/BlockBOPStairs.java | 31 ++- .../biomesop/blocks/BlockCherryLog.java | 1 + .../biomesop/blocks/BlockCherrySlab.java | 1 + .../biomesop/blocks/BlockDarkLog.java | 1 + .../biomesop/blocks/BlockDarkSlab.java | 1 + .../biomesop/blocks/BlockDeadLog.java | 1 + .../tdwp_ftw/biomesop/blocks/BlockFirLog.java | 1 + .../biomesop/blocks/BlockFirSlab.java | 2 +- .../biomesop/blocks/BlockHolyLog.java | 1 + .../biomesop/blocks/BlockHolySlab.java | 1 + .../biomesop/blocks/BlockMagicLog.java | 1 + .../biomesop/blocks/BlockMagicSlab.java | 1 + .../biomesop/blocks/BlockMangroveLog.java | 1 + .../biomesop/blocks/BlockMangroveSlab.java | 1 + .../biomesop/blocks/BlockMudBrickSlab.java | 1 + .../biomesop/blocks/BlockPalmLog.java | 1 + .../biomesop/blocks/BlockPalmSlab.java | 1 + .../blocks/BlockRedRockBrickSlab.java | 1 + .../blocks/BlockRedRockCobbleSlab.java | 1 + .../biomesop/blocks/BlockRedwoodLog.java | 1 + .../biomesop/blocks/BlockRedwoodSlab.java | 1 + .../biomesop/blocks/BlockWillowLog.java | 1 + .../biomesop/blocks/BlockWillowSlab.java | 1 + .../biomesop/configuration/BOPBlocks.java | 190 +++++++++++++----- .../tdwp_ftw/biomesop/items/ItemBOPLog.java | 31 +++ .../tdwp_ftw/biomesop/items/ItemBOPSlab.java | 7 +- 31 files changed, 497 insertions(+), 91 deletions(-) create mode 100644 src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPLog.java create mode 100644 src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLog.java diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaLog.java index e3ebd1f23..fb8a1747d 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockAcaciaLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaSlab.java index 9cf0dd2f7..5462442ec 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockAcaciaSlab.java @@ -12,7 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; - +@Deprecated public class BlockAcaciaSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPFlower.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPFlower.java index f05b05041..7188a3764 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPFlower.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPFlower.java @@ -2,12 +2,14 @@ package tdwp_ftw.biomesop.blocks; import java.util.List; +import net.minecraft.block.Block; import net.minecraft.block.BlockFlower; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import cpw.mods.fml.relauncher.Side; @@ -53,6 +55,15 @@ public class BlockBOPFlower extends BlockFlower return textures[meta]; } + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta == 2) + return 9; + else + return 0; + } + @Override @SideOnly(Side.CLIENT) public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPLog.java new file mode 100644 index 000000000..0354b71da --- /dev/null +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPLog.java @@ -0,0 +1,156 @@ +package tdwp_ftw.biomesop.blocks; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import tdwp_ftw.biomesop.mod_BiomesOPlenty; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBOPLog extends Block +{ + public static enum LogCategory + { + CAT1, CAT2, CAT3; + } + + private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow", "dead"}; + @SideOnly(Side.CLIENT) + private Icon[] textures; + private Icon logHeart; + + private final LogCategory category; + + public BlockBOPLog(int blockID, LogCategory cat) + { + super(blockID, Material.wood); + category = cat; + setBurnProperties(this.blockID, 5, 5); + setHardness(2.0F); + setResistance(5.0F); + setStepSound(Block.soundWoodFootstep); + this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + textures = new Icon[woodTypes.length]; + + logHeart = iconRegister.registerIcon("BiomesOPlenty:logTopBottum"); + + for (int i = 0; i < woodTypes.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"log"); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getBlockTextureFromSideAndMetadata(int side, int meta) + { + int pos = meta & 12; + if (pos == 0 && (side == 1 || side == 0) || pos == 4 && (side == 5 || side == 4) || pos == 8 && (side == 2 || side == 3)) + return logHeart; + return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 4)]; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { + for (int i = 0; i < 4; ++i) + if (category != LogCategory.CAT3 || i < 3) +// return; +// else + list.add(new ItemStack(this, 1, i)); + } + + @Override + public void breakBlock(World world, int x, int y, int z, int par5, int par6) + { + byte radius = 4; + int bounds = radius + 1; + + if (world.checkChunksExist(x - bounds, y - bounds, z - bounds, x + bounds, y + bounds, z + bounds)) + for (int i = -radius; i <= radius; ++i) + for (int j = -radius; j <= radius; ++j) + for (int k = -radius; k <= radius; ++k) + { + int blockID = world.getBlockId(x + i, y + j, z + k); + + if (Block.blocksList[blockID] != null) + Block.blocksList[blockID].beginLeavesDecay(world, x + i, y + j, z + k); + } + } + + @Override + public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) + { + int type = getTypeFromMeta(meta); + byte orientation = 0; + + switch (side) + { + case 0: + case 1: + orientation = 0; + break; + + case 2: + case 3: + orientation = 8; + break; + + case 4: + case 5: + orientation = 4; + } + + return type | orientation; + } + + @Override + public int damageDropped(int meta) + { + return getTypeFromMeta(meta); + } + + @Override + protected ItemStack createStackedBlock(int meta) + { + return new ItemStack(this.blockID, 1, getTypeFromMeta(meta)); + } + + @Override + public int getRenderType() + { + return 31; + } + + @Override + public boolean canSustainLeaves(World world, int x, int y, int z) + { + return true; + } + + @Override + public boolean isWood(World world, int x, int y, int z) + { + return true; + } + + public int getWoodType(int meta) + { + return getTypeFromMeta(meta) + category.ordinal() * 4; + } + + private static int getTypeFromMeta(int meta) + { + return meta & 3; + } +} diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPSlab.java index 34ac63025..5891b215a 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPSlab.java @@ -2,26 +2,46 @@ package tdwp_ftw.biomesop.blocks; import java.util.List; +import net.minecraft.block.Block; import net.minecraft.block.BlockHalfSlab; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; +import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockBOPSlab extends BlockHalfSlab { + public static enum SlabCategory + { + WOOD1, WOOD2, STONE; + } private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow"}; + private static final String[] rockTypes = new String[] {"redbrick", "redcobble", "mudbrick"}; @SideOnly(Side.CLIENT) private Icon[] textures; - public BlockBOPSlab(int par1, boolean par2) + private final SlabCategory category; + + public BlockBOPSlab(int par1, boolean par2, Material material, SlabCategory cat) { - super(par1, par2, Material.wood); - setBurnProperties(this.blockID, 5, 20); + super(par1, par2, material); + category = cat; + if (material == Material.wood) + { + setBurnProperties(this.blockID, 5, 20); + setHardness(2.0F); + setResistance(5.0F); + setStepSound(Block.soundWoodFootstep); + } + else if (material == Material.rock) + setStepSound(Block.soundStoneFootstep); + this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); useNeighborBrightness[blockID] = true; } @@ -30,35 +50,55 @@ public class BlockBOPSlab extends BlockHalfSlab @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { - textures = new Icon[woodTypes.length]; - - for (int i = 0; i < woodTypes.length; ++i) - textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"plank"); + if (category == SlabCategory.STONE) + { + textures = new Icon[rockTypes.length]; + + for (int i = 0; i < rockTypes.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+rockTypes[i]); + } + else + { + textures = new Icon[woodTypes.length]; + + for (int i = 0; i < woodTypes.length; ++i) + textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"plank"); + } } @Override @SideOnly(Side.CLIENT) public Icon getBlockTextureFromSideAndMetadata(int side, int meta) { - if (meta < 0 || meta >= textures.length) - meta = 0; - - return textures[meta]; + if (category == SlabCategory.STONE) + return textures[getTypeFromMeta(meta)]; + else + return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 8)]; } @Override @SideOnly(Side.CLIENT) public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { - for (int i = 0; i < woodTypes.length; ++i) - list.add(new ItemStack(blockID, 1, i)); + int max = 0; + + if (category == SlabCategory.WOOD1) + max = 8; + else if (category == SlabCategory.WOOD2) + max = 2; + else if (category == SlabCategory.STONE) + max = 3; + + for (int i = 0; i < max; ++i) + list.add(new ItemStack(blockID, 1, i)); } @Override public String getFullSlabName(int meta) { - if (meta < 0 || meta >= textures.length) - meta = 0; - return (new StringBuilder()).append(woodTypes[meta]).append("Slab").toString(); + if (category == SlabCategory.STONE) + return (new StringBuilder()).append(rockTypes[getTypeFromMeta(meta)]).append("Slab").toString(); + else + return (new StringBuilder()).append(woodTypes[getWoodType(meta)]).append("Slab").toString(); } @Override @@ -67,8 +107,72 @@ public class BlockBOPSlab extends BlockHalfSlab return meta; } + @Override + public float getBlockHardness(World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + float hardness = this.blockHardness; + + if (category == SlabCategory.STONE) + { + switch (getTypeFromMeta(meta)) + { + case 0: + hardness = 1.1F; + break; + + case 1: + hardness = 1.6F; + break; + + case 2: + hardness = 1.0F; + break; + } + } + + return hardness; + } + + @Override + public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + { + int meta = world.getBlockMetadata(x, y, z); + float resistance = this.blockHardness; + + if (category == SlabCategory.STONE) + { + switch (getTypeFromMeta(meta)) + { + case 0: + resistance = 7.5F; + break; + + case 1: + resistance = 7.0F; + break; + + case 2: + resistance = 2.0F; + break; + } + } + + return resistance / 5.0F; + } + protected ItemStack createStackedBlock(int par1) { return new ItemStack(this.blockID, 2, par1); } + + private int getWoodType(int meta) + { + return getTypeFromMeta(meta) + category.ordinal() * 8; + } + + private static int getTypeFromMeta(int meta) + { + return meta & 7; + } } diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPStairs.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPStairs.java index c8291862b..2f4570873 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPStairs.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockBOPStairs.java @@ -1,26 +1,29 @@ package tdwp_ftw.biomesop.blocks; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import tdwp_ftw.biomesop.mod_BiomesOPlenty; import net.minecraft.block.Block; import net.minecraft.block.BlockStairs; import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; +import tdwp_ftw.biomesop.mod_BiomesOPlenty; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockBOPStairs extends BlockStairs { + public static enum WoodCategory + { + ACACIA, CHERRY, DARK, FIR, HOLY, MAGIC, MANGROVE, PALM, REDWOOD, WILLOW; + } + private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow"}; @SideOnly(Side.CLIENT) private Icon[] textures; + private final WoodCategory category; - public BlockBOPStairs(int blockID, Block model) + public BlockBOPStairs(int blockID, Block model, WoodCategory cat) { super(blockID, model, 0); + category = cat; setBurnProperties(this.blockID, 5, 20); this.setLightOpacity(0); this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); @@ -40,17 +43,7 @@ public class BlockBOPStairs extends BlockStairs @SideOnly(Side.CLIENT) public Icon getBlockTextureFromSideAndMetadata(int side, int meta) { - if (meta < 0 || meta >= textures.length) - meta = 0; - - return textures[meta]; - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { - for (int i = 0; i < woodTypes.length; ++i) - list.add(new ItemStack(blockID, 1, i)); + return textures[category.ordinal()]; } @Override diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherryLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherryLog.java index 40b64847f..b7f5d5b41 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherryLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherryLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockCherryLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherrySlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherrySlab.java index e942f0569..f689d5ef9 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherrySlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockCherrySlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockCherrySlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkLog.java index a1aa00a89..aaa60c006 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockDarkLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkSlab.java index 1c53214a5..29c44ebd7 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDarkSlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockDarkSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDeadLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDeadLog.java index 9aa988420..ede6a586d 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDeadLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockDeadLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockDeadLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirLog.java index afc6eed54..f4947ee59 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockFirLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirSlab.java index c7580b934..62eb9143c 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockFirSlab.java @@ -12,7 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; - +@Deprecated public class BlockFirSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolyLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolyLog.java index 6b52db0cb..24a686cf7 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolyLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolyLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockHolyLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySlab.java index 74f6465a7..5056b4038 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockHolySlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockHolySlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicLog.java index 9cc9c6d88..6fa4386ed 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockMagicLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSlab.java index 9013f5200..213766377 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMagicSlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockMagicSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveLog.java index 1043cb6c9..a797a2de8 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockMangroveLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveSlab.java index 8dd529c72..87a553129 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMangroveSlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockMangroveSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMudBrickSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMudBrickSlab.java index 2867da7bc..11e979a1f 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMudBrickSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockMudBrickSlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockMudBrickSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmLog.java index 3cd85dd52..6b61dd38a 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockPalmLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmSlab.java index 4e8324dc8..5dd033b34 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockPalmSlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockPalmSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockBrickSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockBrickSlab.java index b6208aae3..d0453c68a 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockBrickSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockBrickSlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockRedRockBrickSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockCobbleSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockCobbleSlab.java index aed85c697..7e03c8174 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockCobbleSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedRockCobbleSlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockRedRockCobbleSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodLog.java index f0a4159c5..b1f8b8ddb 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockRedwoodLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodSlab.java index 5b5a7e8c6..35714c5e3 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockRedwoodSlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockRedwoodSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowLog.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowLog.java index 95522230a..c6e65655b 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowLog.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowLog.java @@ -11,6 +11,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockWillowLog extends Block { /** The type of tree this log came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowSlab.java b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowSlab.java index 1f8d669c9..5fb11e972 100644 --- a/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/blocks/BlockWillowSlab.java @@ -12,6 +12,7 @@ import net.minecraft.world.World; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.configuration.BOPBlocks; +@Deprecated public class BlockWillowSlab extends BlockHalfSlab { /** The type of tree this slab came from. */ diff --git a/src/minecraft/tdwp_ftw/biomesop/configuration/BOPBlocks.java b/src/minecraft/tdwp_ftw/biomesop/configuration/BOPBlocks.java index 097980ca0..53cdb86c3 100644 --- a/src/minecraft/tdwp_ftw/biomesop/configuration/BOPBlocks.java +++ b/src/minecraft/tdwp_ftw/biomesop/configuration/BOPBlocks.java @@ -2,15 +2,20 @@ package tdwp_ftw.biomesop.configuration; import net.minecraft.block.Block; import net.minecraft.block.BlockHalfSlab; +import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.oredict.OreDictionary; import tdwp_ftw.biomesop.blocks.*; +import tdwp_ftw.biomesop.blocks.BlockBOPLog.LogCategory; +import tdwp_ftw.biomesop.blocks.BlockBOPSlab.SlabCategory; +import tdwp_ftw.biomesop.blocks.BlockBOPStairs.WoodCategory; import tdwp_ftw.biomesop.items.ItemBOPFlower; import tdwp_ftw.biomesop.items.ItemBOPPlank; import tdwp_ftw.biomesop.items.ItemBOPSlab; import tdwp_ftw.biomesop.items.ItemBOPLeaves; +import tdwp_ftw.biomesop.items.ItemBOPLog; import tdwp_ftw.biomesop.items.ItemBOPColorizedLeaves; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @@ -192,13 +197,31 @@ public class BOPBlocks { public static Block holyStairs; // New definitions -// public static Block planks; -// public static Block stairs; -// public static BlockHalfSlab singleSlab; -// public static BlockHalfSlab doubleSlab; + public static Block planks; + public static Block acaciaStairs1; + public static Block cherryStairs1; + public static Block darkStairs1; + public static Block firStairs1; + public static Block holyStairs1; + public static Block magicStairs1; + public static Block mangroveStairs1; + public static Block palmStairs1; + public static Block redwoodStairs1; + public static Block willowStairs1; + public static Block stairs; + + public static BlockHalfSlab woodenSingleSlab1; + public static BlockHalfSlab woodenDoubleSlab1; + public static BlockHalfSlab woodenSingleSlab2; + public static BlockHalfSlab woodenDoubleSlab2; + public static BlockHalfSlab stoneSingleSlab; + public static BlockHalfSlab stoneDoubleSlab; public static Block flowers; public static Block leaves; public static Block leavesColorized; + public static Block logs1; + public static Block logs2; + public static Block logs3; public static void init() { @@ -375,9 +398,10 @@ public class BOPBlocks { holyDoubleSlab = (BlockHalfSlab)(new BlockHolySlab(BOPConfiguration.holyDoubleSlabID, true)).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("holySlab"); holySingleSlab = (BlockHalfSlab)(new BlockHolySlab(BOPConfiguration.holySingleSlabID, false)).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("holySlab"); holyStairs = (new BlockHolyStairs(BOPConfiguration.holyStairsID, holyPlank)).setUnlocalizedName("holyStairs"); - /* -// Planks condensed into one block - planks = (new BlockBOPPlank(2000)).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("planks"); + +/* + // Planks - WORKING! + planks = (new BlockBOPPlank(1989)).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("planks"); GameRegistry.registerBlock(planks, ItemBOPPlank.class, "planks"); LanguageRegistry.addName(new ItemStack(planks,1,0), "Acacia Wood Planks"); @@ -391,52 +415,95 @@ public class BOPBlocks { LanguageRegistry.addName(new ItemStack(planks,1,8), "Redwood Wood Planks"); LanguageRegistry.addName(new ItemStack(planks,1,9), "Willow Wood Planks"); - doubleSlab = (BlockHalfSlab)(new BlockBOPSlab(2003, true)).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("slab"); - singleSlab = (BlockHalfSlab)(new BlockBOPSlab(2002, false)).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("slab"); - ItemBOPSlab.setSlabs(singleSlab, doubleSlab); + // Stairs - Almost working - need to fix displayed name. Stairs can't be compressed + acaciaStairs1 = (new BlockBOPStairs(1990, planks, WoodCategory.ACACIA)).setUnlocalizedName("acaciaStairs"); + cherryStairs1 = (new BlockBOPStairs(1991, planks, WoodCategory.CHERRY)).setUnlocalizedName("cherryStairs"); + darkStairs1 = (new BlockBOPStairs(1992, planks, WoodCategory.DARK)).setUnlocalizedName("darkStairs"); + firStairs1 = (new BlockBOPStairs(1993, planks, WoodCategory.FIR)).setUnlocalizedName("firStairs"); + holyStairs1 = (new BlockBOPStairs(1994, planks, WoodCategory.HOLY)).setUnlocalizedName("holyStairs"); + magicStairs1 = (new BlockBOPStairs(1995, planks, WoodCategory.MAGIC)).setUnlocalizedName("magicStairs"); + mangroveStairs1 = (new BlockBOPStairs(1996, planks, WoodCategory.MANGROVE)).setUnlocalizedName("mangroveStairs"); + palmStairs1 = (new BlockBOPStairs(1997, planks, WoodCategory.PALM)).setUnlocalizedName("palmStairs"); + redwoodStairs1 = (new BlockBOPStairs(1998, planks, WoodCategory.REDWOOD)).setUnlocalizedName("redwoodStairs"); + willowStairs1 = (new BlockBOPStairs(1999, planks, WoodCategory.WILLOW)).setUnlocalizedName("willowStairs"); -// Slabs condensed - almost working, need to divide - GameRegistry.registerBlock(doubleSlab, ItemBOPSlab.class, "doubleSlab"); - GameRegistry.registerBlock(singleSlab, ItemBOPSlab.class, "singleSlab"); + GameRegistry.registerBlock(acaciaStairs1, ItemBOPPlank.class, "acaciaStairs1"); + GameRegistry.registerBlock(cherryStairs1, ItemBOPPlank.class, "cherryStairs1"); + GameRegistry.registerBlock(darkStairs1, ItemBOPPlank.class, "darkStairs1"); + GameRegistry.registerBlock(firStairs1, ItemBOPPlank.class, "firStairs1"); + GameRegistry.registerBlock(holyStairs1, ItemBOPPlank.class, "holyStairs1"); + GameRegistry.registerBlock(magicStairs1, ItemBOPPlank.class, "magicStairs1"); + GameRegistry.registerBlock(mangroveStairs1, ItemBOPPlank.class, "mangroveStairs1"); + GameRegistry.registerBlock(palmStairs1, ItemBOPPlank.class, "palmStairs1"); + GameRegistry.registerBlock(redwoodStairs1, ItemBOPPlank.class, "redwoodStairs1"); + GameRegistry.registerBlock(willowStairs1, ItemBOPPlank.class, "stairs1"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,0), "Acacia Wood Slab"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,1), "Cherry Wood Slab"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,2), "Dark Wood Slab"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,3), "Fir Wood Slab"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,4), "Holy Wood Slab"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,5), "Magic Wood Slab"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,6), "Mangrove Wood Slab"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,7), "Palm Wood Slab"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,8), "Redwood Wood Slab"); - LanguageRegistry.addName(new ItemStack(doubleSlab,1,9), "Willow Wood Slab"); - - LanguageRegistry.addName(new ItemStack(singleSlab,1,0), "Acacia Wood Slab"); - LanguageRegistry.addName(new ItemStack(singleSlab,1,1), "Cherry Wood Slab"); - LanguageRegistry.addName(new ItemStack(singleSlab,1,2), "Dark Wood Slab"); - LanguageRegistry.addName(new ItemStack(singleSlab,1,3), "Fir Wood Slab"); - LanguageRegistry.addName(new ItemStack(singleSlab,1,4), "Holy Wood Slab"); - LanguageRegistry.addName(new ItemStack(singleSlab,1,5), "Magic Wood Slab"); - LanguageRegistry.addName(new ItemStack(singleSlab,1,6), "Mangrove Wood Slab"); - LanguageRegistry.addName(new ItemStack(singleSlab,1,7), "Palm Wood Slab"); - LanguageRegistry.addName(new ItemStack(singleSlab,1,8), "Redwood Wood Slab"); - LanguageRegistry.addName(new ItemStack(singleSlab,1,9), "Willow Wood Slab"); - - /*Stairs condensed into one block - NOT WORKING - stairs = (new BlockBOPStairs(2001, planks)).setUnlocalizedName("stairs"); - - GameRegistry.registerBlock(stairs, ItemBOPPlank.class, "stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,0), "Acacia Wood Stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,1), "Cherry Wood Stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,2), "Dark Wood Stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,3), "Fir Wood Stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,4), "Holy Wood Stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,5), "Magic Wood Stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,6), "Mangrove Wood Stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,7), "Palm Wood Stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,8), "Redwood Wood Stairs"); - LanguageRegistry.addName(new ItemStack(stairs,1,9), "Willow Wood Stairs"); + LanguageRegistry.addName(acaciaStairs1, "Acacia Wood Stairs"); + LanguageRegistry.addName(cherryStairs1, "Cherry Wood Stairs"); + LanguageRegistry.addName(darkStairs1, "Dark Wood Stairs"); + LanguageRegistry.addName(firStairs1, "Fir Wood Stairs"); + LanguageRegistry.addName(holyStairs1, "Holy Wood Stairs"); + LanguageRegistry.addName(magicStairs1, "Magic Wood Stairs"); + LanguageRegistry.addName(mangroveStairs1, "Mangrove Wood Stairs"); + LanguageRegistry.addName(palmStairs1, "Palm Wood Stairs"); + LanguageRegistry.addName(redwoodStairs1, "Redwood Wood Stairs"); + LanguageRegistry.addName(willowStairs1, "Willow Wood Stairs"); - // Flowers - mostly working, missing glow on Glowflower + woodenDoubleSlab1 = (BlockHalfSlab)(new BlockBOPSlab(2007, true, Material.wood, SlabCategory.WOOD1)).setUnlocalizedName("woodenDoubleSlab1"); + woodenSingleSlab1 = (BlockHalfSlab)(new BlockBOPSlab(2006, false, Material.wood, SlabCategory.WOOD1)).setUnlocalizedName("woodenSingleSlab1"); + ItemBOPSlab.setSlabs(woodenSingleSlab1, woodenDoubleSlab1); + + // Slabs - WORKING! + GameRegistry.registerBlock(woodenDoubleSlab1, ItemBOPSlab.class, "woodenDoubleSlab1"); + GameRegistry.registerBlock(woodenSingleSlab1, ItemBOPSlab.class, "woodenSingleSlab1"); + + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,0), "Acacia Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,1), "Cherry Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,2), "Dark Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,3), "Fir Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,4), "Holy Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,5), "Magic Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,6), "Mangrove Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,7), "Palm Wood Slab"); + + LanguageRegistry.addName(new ItemStack(woodenSingleSlab1,1,0), "Acacia Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenSingleSlab1,1,1), "Cherry Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenSingleSlab1,1,2), "Dark Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenSingleSlab1,1,3), "Fir Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenSingleSlab1,1,4), "Holy Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenSingleSlab1,1,5), "Magic Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenSingleSlab1,1,6), "Mangrove Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenSingleSlab1,1,7), "Palm Wood Slab"); + + woodenDoubleSlab2 = (BlockHalfSlab)(new BlockBOPSlab(2009, true, Material.wood, SlabCategory.WOOD2)).setUnlocalizedName("woodenDoubleSlab2"); + woodenSingleSlab2 = (BlockHalfSlab)(new BlockBOPSlab(2008, false, Material.wood, SlabCategory.WOOD2)).setUnlocalizedName("woodenSingleSlab2"); + ItemBOPSlab.setSlabs(woodenSingleSlab2, woodenDoubleSlab2); + + GameRegistry.registerBlock(woodenDoubleSlab2, ItemBOPSlab.class, "woodenDoubleSlab2"); + GameRegistry.registerBlock(woodenSingleSlab2, ItemBOPSlab.class, "woodenSingleSlab2"); + + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab2,1,0), "Redwood Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenDoubleSlab2,1,1), "Willow Wood Slab"); + + LanguageRegistry.addName(new ItemStack(woodenSingleSlab2,1,0), "Redwood Wood Slab"); + LanguageRegistry.addName(new ItemStack(woodenSingleSlab2,1,1), "Willow Wood Slab"); + + stoneDoubleSlab = (BlockHalfSlab)(new BlockBOPSlab(2011, true, Material.rock, SlabCategory.STONE)).setUnlocalizedName("stoneDoubleSlab"); + stoneSingleSlab = (BlockHalfSlab)(new BlockBOPSlab(2010, false, Material.rock, SlabCategory.STONE)).setUnlocalizedName("stoneSingleSlab"); + ItemBOPSlab.setSlabs(stoneSingleSlab, stoneDoubleSlab); + + GameRegistry.registerBlock(stoneDoubleSlab, ItemBOPSlab.class, "stoneDoubleSlab2"); + GameRegistry.registerBlock(stoneSingleSlab, ItemBOPSlab.class, "stoneSingleSlab"); + + LanguageRegistry.addName(new ItemStack(stoneDoubleSlab,1,0), "Red Rock Bricks Slab"); + LanguageRegistry.addName(new ItemStack(stoneDoubleSlab,1,1), "Red Rock Cobblestone Slab"); + LanguageRegistry.addName(new ItemStack(stoneDoubleSlab,1,2), "Mud Bricks Slab"); + + LanguageRegistry.addName(new ItemStack(stoneSingleSlab,1,0), "Red Rock Bricks Slab"); + LanguageRegistry.addName(new ItemStack(stoneSingleSlab,1,1), "Red Rock Cobblestone Slab"); + LanguageRegistry.addName(new ItemStack(stoneSingleSlab,1,2), "Mud Bricks Slab"); + + // Flowers - WORKING! flowers = (new BlockBOPFlower(2002)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("flowers"); GameRegistry.registerBlock(flowers, ItemBOPFlower.class, "flowers"); @@ -476,8 +543,29 @@ public class BOPBlocks { LanguageRegistry.addName(new ItemStack(leavesColorized,1,2), "Palm Leaves"); LanguageRegistry.addName(new ItemStack(leavesColorized,1,3), "Redwood Leaves"); LanguageRegistry.addName(new ItemStack(leavesColorized,1,4), "Willow Leaves"); - */ + // Logs - WORKING! + logs1 = (new BlockBOPLog(2003,LogCategory.CAT1)).setUnlocalizedName("wood1"); + logs2 = (new BlockBOPLog(2004,LogCategory.CAT2)).setUnlocalizedName("wood2"); + logs3 = (new BlockBOPLog(2005,LogCategory.CAT3)).setUnlocalizedName("wood3"); + GameRegistry.registerBlock(logs1, ItemBOPLog.class, "wood1"); + GameRegistry.registerBlock(logs2, ItemBOPLog.class, "wood2"); + GameRegistry.registerBlock(logs3, ItemBOPLog.class, "wood3"); + + LanguageRegistry.addName(new ItemStack(logs1,1,0), "Acacia Woods"); + LanguageRegistry.addName(new ItemStack(logs1,1,1), "Cherry Wood"); + LanguageRegistry.addName(new ItemStack(logs1,1,2), "Dark Wood"); + LanguageRegistry.addName(new ItemStack(logs1,1,3), "Fir Wood"); + + LanguageRegistry.addName(new ItemStack(logs2,1,0), "Holy Wood"); + LanguageRegistry.addName(new ItemStack(logs2,1,1), "Magic Wood"); + LanguageRegistry.addName(new ItemStack(logs2,1,2), "Mangrove Wood"); + LanguageRegistry.addName(new ItemStack(logs2,1,3), "Palm Wood"); + + LanguageRegistry.addName(new ItemStack(logs3,1,0), "Redwood Wood"); + LanguageRegistry.addName(new ItemStack(logs3,1,1), "Willow Wood"); + LanguageRegistry.addName(new ItemStack(logs3,1,2), "Dead Wood"); +*/ // Add block registration GameRegistry.registerBlock(mud, "mud"); diff --git a/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLog.java b/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLog.java new file mode 100644 index 000000000..e71eab338 --- /dev/null +++ b/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPLog.java @@ -0,0 +1,31 @@ +package tdwp_ftw.biomesop.items; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import tdwp_ftw.biomesop.blocks.BlockBOPLog; + +public class ItemBOPLog extends ItemBlock +{ + private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow", "dead"}; + + public ItemBOPLog(int par1) + { + super(par1); + setMaxDamage(0); + setHasSubtypes(true); + } + + @Override + public int getMetadata(int meta) + { + return meta; + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + BlockBOPLog wood = (BlockBOPLog)Block.blocksList[itemStack.itemID]; + return (new StringBuilder()).append(woodTypes[wood.getWoodType(itemStack.getItemDamage())]).append("Wood").toString(); + } +} diff --git a/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPSlab.java b/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPSlab.java index bf2eef802..1f5f63d5a 100644 --- a/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPSlab.java +++ b/src/minecraft/tdwp_ftw/biomesop/items/ItemBOPSlab.java @@ -1,14 +1,15 @@ package tdwp_ftw.biomesop.items; +import net.minecraft.block.Block; import net.minecraft.block.BlockHalfSlab; import net.minecraft.item.ItemSlab; import net.minecraft.item.ItemStack; +import tdwp_ftw.biomesop.blocks.BlockBOPSlab; import com.google.common.base.Optional; public class ItemBOPSlab extends ItemSlab { - private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow"}; private static Optional singleSlab = Optional.absent(); private static Optional doubleSlab = Optional.absent(); @@ -30,7 +31,7 @@ public class ItemBOPSlab extends ItemSlab @Override public String getUnlocalizedName(ItemStack itemStack) { - return itemStack.getItem().getUnlocalizedName(); -// return (new StringBuilder()).append(woodTypes[itemStack.getItemDamage()]).append("Slab").toString(); + BlockBOPSlab slab = (BlockBOPSlab)Block.blocksList[itemStack.itemID]; + return (new StringBuilder()).append(slab.getFullSlabName(itemStack.getItemDamage())).toString(); } }