Compressed Logs and Slabs.

Reworked stairs a bit, still need some fixing.
This commit is contained in:
Amnet 2013-04-15 01:11:00 +02:00
parent 0337edec5e
commit f430e8dd3d
31 changed files with 497 additions and 91 deletions

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockAcaciaLog extends Block public class BlockAcaciaLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,7 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockAcaciaSlab extends BlockHalfSlab public class BlockAcaciaSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -2,12 +2,14 @@ package tdwp_ftw.biomesop.blocks;
import java.util.List; import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower; import net.minecraft.block.BlockFlower;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@ -53,6 +55,15 @@ public class BlockBOPFlower extends BlockFlower
return textures[meta]; 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 @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {

View file

@ -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;
}
}

View file

@ -2,26 +2,46 @@ package tdwp_ftw.biomesop.blocks;
import java.util.List; import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHalfSlab; import net.minecraft.block.BlockHalfSlab;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
public class BlockBOPSlab extends BlockHalfSlab 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[] 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) @SideOnly(Side.CLIENT)
private Icon[] textures; 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);
category = cat;
if (material == Material.wood)
{ {
super(par1, par2, Material.wood);
setBurnProperties(this.blockID, 5, 20); 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); this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty);
useNeighborBrightness[blockID] = true; useNeighborBrightness[blockID] = true;
} }
@ -29,36 +49,56 @@ public class BlockBOPSlab extends BlockHalfSlab
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) public void registerIcons(IconRegister iconRegister)
{
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]; textures = new Icon[woodTypes.length];
for (int i = 0; i < woodTypes.length; ++i) for (int i = 0; i < woodTypes.length; ++i)
textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"plank"); textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+woodTypes[i]+"plank");
} }
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getBlockTextureFromSideAndMetadata(int side, int meta)
{ {
if (meta < 0 || meta >= textures.length) if (category == SlabCategory.STONE)
meta = 0; return textures[getTypeFromMeta(meta)];
else
return textures[meta]; return textures[(getTypeFromMeta(meta) + this.category.ordinal() * 8)];
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) { public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {
for (int i = 0; i < woodTypes.length; ++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)); list.add(new ItemStack(blockID, 1, i));
} }
@Override @Override
public String getFullSlabName(int meta) public String getFullSlabName(int meta)
{ {
if (meta < 0 || meta >= textures.length) if (category == SlabCategory.STONE)
meta = 0; return (new StringBuilder()).append(rockTypes[getTypeFromMeta(meta)]).append("Slab").toString();
return (new StringBuilder()).append(woodTypes[meta]).append("Slab").toString(); else
return (new StringBuilder()).append(woodTypes[getWoodType(meta)]).append("Slab").toString();
} }
@Override @Override
@ -67,8 +107,72 @@ public class BlockBOPSlab extends BlockHalfSlab
return meta; 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) protected ItemStack createStackedBlock(int par1)
{ {
return new ItemStack(this.blockID, 2, 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;
}
} }

View file

@ -1,26 +1,29 @@
package tdwp_ftw.biomesop.blocks; 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.Block;
import net.minecraft.block.BlockStairs; import net.minecraft.block.BlockStairs;
import net.minecraft.client.renderer.texture.IconRegister; 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.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 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"}; private static final String[] woodTypes = new String[] {"acacia", "cherry", "dark", "fir", "holy", "magic", "mangrove", "palm", "redwood", "willow"};
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private Icon[] textures; 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); super(blockID, model, 0);
category = cat;
setBurnProperties(this.blockID, 5, 20); setBurnProperties(this.blockID, 5, 20);
this.setLightOpacity(0); this.setLightOpacity(0);
this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty); this.setCreativeTab(mod_BiomesOPlenty.tabBiomesOPlenty);
@ -40,17 +43,7 @@ public class BlockBOPStairs extends BlockStairs
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int side, int meta) public Icon getBlockTextureFromSideAndMetadata(int side, int meta)
{ {
if (meta < 0 || meta >= textures.length) return textures[category.ordinal()];
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));
} }
@Override @Override

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockCherryLog extends Block public class BlockCherryLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockCherrySlab extends BlockHalfSlab public class BlockCherrySlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockDarkLog extends Block public class BlockDarkLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockDarkSlab extends BlockHalfSlab public class BlockDarkSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockDeadLog extends Block public class BlockDeadLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockFirLog extends Block public class BlockFirLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,7 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockFirSlab extends BlockHalfSlab public class BlockFirSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockHolyLog extends Block public class BlockHolyLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockHolySlab extends BlockHalfSlab public class BlockHolySlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockMagicLog extends Block public class BlockMagicLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockMagicSlab extends BlockHalfSlab public class BlockMagicSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockMangroveLog extends Block public class BlockMangroveLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockMangroveSlab extends BlockHalfSlab public class BlockMangroveSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockMudBrickSlab extends BlockHalfSlab public class BlockMudBrickSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockPalmLog extends Block public class BlockPalmLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockPalmSlab extends BlockHalfSlab public class BlockPalmSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockRedRockBrickSlab extends BlockHalfSlab public class BlockRedRockBrickSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockRedRockCobbleSlab extends BlockHalfSlab public class BlockRedRockCobbleSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockRedwoodLog extends Block public class BlockRedwoodLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockRedwoodSlab extends BlockHalfSlab public class BlockRedwoodSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -11,6 +11,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockWillowLog extends Block public class BlockWillowLog extends Block
{ {
/** The type of tree this log came from. */ /** The type of tree this log came from. */

View file

@ -12,6 +12,7 @@ import net.minecraft.world.World;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.configuration.BOPBlocks; import tdwp_ftw.biomesop.configuration.BOPBlocks;
@Deprecated
public class BlockWillowSlab extends BlockHalfSlab public class BlockWillowSlab extends BlockHalfSlab
{ {
/** The type of tree this slab came from. */ /** The type of tree this slab came from. */

View file

@ -2,15 +2,20 @@ package tdwp_ftw.biomesop.configuration;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockHalfSlab; import net.minecraft.block.BlockHalfSlab;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import tdwp_ftw.biomesop.blocks.*; 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.ItemBOPFlower;
import tdwp_ftw.biomesop.items.ItemBOPPlank; import tdwp_ftw.biomesop.items.ItemBOPPlank;
import tdwp_ftw.biomesop.items.ItemBOPSlab; import tdwp_ftw.biomesop.items.ItemBOPSlab;
import tdwp_ftw.biomesop.items.ItemBOPLeaves; import tdwp_ftw.biomesop.items.ItemBOPLeaves;
import tdwp_ftw.biomesop.items.ItemBOPLog;
import tdwp_ftw.biomesop.items.ItemBOPColorizedLeaves; import tdwp_ftw.biomesop.items.ItemBOPColorizedLeaves;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.common.registry.LanguageRegistry;
@ -192,13 +197,31 @@ public class BOPBlocks {
public static Block holyStairs; public static Block holyStairs;
// New definitions // New definitions
// public static Block planks; public static Block planks;
// public static Block stairs; public static Block acaciaStairs1;
// public static BlockHalfSlab singleSlab; public static Block cherryStairs1;
// public static BlockHalfSlab doubleSlab; 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 flowers;
public static Block leaves; public static Block leaves;
public static Block leavesColorized; public static Block leavesColorized;
public static Block logs1;
public static Block logs2;
public static Block logs3;
public static void init() 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"); 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"); 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"); holyStairs = (new BlockHolyStairs(BOPConfiguration.holyStairsID, holyPlank)).setUnlocalizedName("holyStairs");
/* /*
// Planks condensed into one block // Planks - WORKING!
planks = (new BlockBOPPlank(2000)).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("planks"); planks = (new BlockBOPPlank(1989)).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("planks");
GameRegistry.registerBlock(planks, ItemBOPPlank.class, "planks"); GameRegistry.registerBlock(planks, ItemBOPPlank.class, "planks");
LanguageRegistry.addName(new ItemStack(planks,1,0), "Acacia Wood 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,8), "Redwood Wood Planks");
LanguageRegistry.addName(new ItemStack(planks,1,9), "Willow 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"); // Stairs - Almost working - need to fix displayed name. Stairs can't be compressed
singleSlab = (BlockHalfSlab)(new BlockBOPSlab(2002, false)).setHardness(2.0F).setResistance(5.0F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("slab"); acaciaStairs1 = (new BlockBOPStairs(1990, planks, WoodCategory.ACACIA)).setUnlocalizedName("acaciaStairs");
ItemBOPSlab.setSlabs(singleSlab, doubleSlab); 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(acaciaStairs1, ItemBOPPlank.class, "acaciaStairs1");
GameRegistry.registerBlock(doubleSlab, ItemBOPSlab.class, "doubleSlab"); GameRegistry.registerBlock(cherryStairs1, ItemBOPPlank.class, "cherryStairs1");
GameRegistry.registerBlock(singleSlab, ItemBOPSlab.class, "singleSlab"); 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(acaciaStairs1, "Acacia Wood Stairs");
LanguageRegistry.addName(new ItemStack(doubleSlab,1,1), "Cherry Wood Slab"); LanguageRegistry.addName(cherryStairs1, "Cherry Wood Stairs");
LanguageRegistry.addName(new ItemStack(doubleSlab,1,2), "Dark Wood Slab"); LanguageRegistry.addName(darkStairs1, "Dark Wood Stairs");
LanguageRegistry.addName(new ItemStack(doubleSlab,1,3), "Fir Wood Slab"); LanguageRegistry.addName(firStairs1, "Fir Wood Stairs");
LanguageRegistry.addName(new ItemStack(doubleSlab,1,4), "Holy Wood Slab"); LanguageRegistry.addName(holyStairs1, "Holy Wood Stairs");
LanguageRegistry.addName(new ItemStack(doubleSlab,1,5), "Magic Wood Slab"); LanguageRegistry.addName(magicStairs1, "Magic Wood Stairs");
LanguageRegistry.addName(new ItemStack(doubleSlab,1,6), "Mangrove Wood Slab"); LanguageRegistry.addName(mangroveStairs1, "Mangrove Wood Stairs");
LanguageRegistry.addName(new ItemStack(doubleSlab,1,7), "Palm Wood Slab"); LanguageRegistry.addName(palmStairs1, "Palm Wood Stairs");
LanguageRegistry.addName(new ItemStack(doubleSlab,1,8), "Redwood Wood Slab"); LanguageRegistry.addName(redwoodStairs1, "Redwood Wood Stairs");
LanguageRegistry.addName(new ItemStack(doubleSlab,1,9), "Willow Wood Slab"); LanguageRegistry.addName(willowStairs1, "Willow Wood Stairs");
LanguageRegistry.addName(new ItemStack(singleSlab,1,0), "Acacia Wood Slab"); woodenDoubleSlab1 = (BlockHalfSlab)(new BlockBOPSlab(2007, true, Material.wood, SlabCategory.WOOD1)).setUnlocalizedName("woodenDoubleSlab1");
LanguageRegistry.addName(new ItemStack(singleSlab,1,1), "Cherry Wood Slab"); woodenSingleSlab1 = (BlockHalfSlab)(new BlockBOPSlab(2006, false, Material.wood, SlabCategory.WOOD1)).setUnlocalizedName("woodenSingleSlab1");
LanguageRegistry.addName(new ItemStack(singleSlab,1,2), "Dark Wood Slab"); ItemBOPSlab.setSlabs(woodenSingleSlab1, woodenDoubleSlab1);
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 // Slabs - WORKING!
stairs = (new BlockBOPStairs(2001, planks)).setUnlocalizedName("stairs"); GameRegistry.registerBlock(woodenDoubleSlab1, ItemBOPSlab.class, "woodenDoubleSlab1");
GameRegistry.registerBlock(woodenSingleSlab1, ItemBOPSlab.class, "woodenSingleSlab1");
GameRegistry.registerBlock(stairs, ItemBOPPlank.class, "stairs"); LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,0), "Acacia Wood Slab");
LanguageRegistry.addName(new ItemStack(stairs,1,0), "Acacia Wood Stairs"); LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,1), "Cherry Wood Slab");
LanguageRegistry.addName(new ItemStack(stairs,1,1), "Cherry Wood Stairs"); LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,2), "Dark Wood Slab");
LanguageRegistry.addName(new ItemStack(stairs,1,2), "Dark Wood Stairs"); LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,3), "Fir Wood Slab");
LanguageRegistry.addName(new ItemStack(stairs,1,3), "Fir Wood Stairs"); LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,4), "Holy Wood Slab");
LanguageRegistry.addName(new ItemStack(stairs,1,4), "Holy Wood Stairs"); LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,5), "Magic Wood Slab");
LanguageRegistry.addName(new ItemStack(stairs,1,5), "Magic Wood Stairs"); LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,6), "Mangrove Wood Slab");
LanguageRegistry.addName(new ItemStack(stairs,1,6), "Mangrove Wood Stairs"); LanguageRegistry.addName(new ItemStack(woodenDoubleSlab1,1,7), "Palm Wood Slab");
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");
// Flowers - mostly working, missing glow on Glowflower 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"); flowers = (new BlockBOPFlower(2002)).setHardness(0.0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("flowers");
GameRegistry.registerBlock(flowers, ItemBOPFlower.class, "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,2), "Palm Leaves");
LanguageRegistry.addName(new ItemStack(leavesColorized,1,3), "Redwood Leaves"); LanguageRegistry.addName(new ItemStack(leavesColorized,1,3), "Redwood Leaves");
LanguageRegistry.addName(new ItemStack(leavesColorized,1,4), "Willow 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 // Add block registration
GameRegistry.registerBlock(mud, "mud"); GameRegistry.registerBlock(mud, "mud");

View file

@ -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();
}
}

View file

@ -1,14 +1,15 @@
package tdwp_ftw.biomesop.items; package tdwp_ftw.biomesop.items;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHalfSlab; import net.minecraft.block.BlockHalfSlab;
import net.minecraft.item.ItemSlab; import net.minecraft.item.ItemSlab;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import tdwp_ftw.biomesop.blocks.BlockBOPSlab;
import com.google.common.base.Optional; import com.google.common.base.Optional;
public class ItemBOPSlab extends ItemSlab 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<BlockHalfSlab> singleSlab = Optional.absent(); private static Optional<BlockHalfSlab> singleSlab = Optional.absent();
private static Optional<BlockHalfSlab> doubleSlab = Optional.absent(); private static Optional<BlockHalfSlab> doubleSlab = Optional.absent();
@ -30,7 +31,7 @@ public class ItemBOPSlab extends ItemSlab
@Override @Override
public String getUnlocalizedName(ItemStack itemStack) { public String getUnlocalizedName(ItemStack itemStack) {
return itemStack.getItem().getUnlocalizedName(); BlockBOPSlab slab = (BlockBOPSlab)Block.blocksList[itemStack.itemID];
// return (new StringBuilder()).append(woodTypes[itemStack.getItemDamage()]).append("Slab").toString(); return (new StringBuilder()).append(slab.getFullSlabName(itemStack.getItemDamage())).toString();
} }
} }