Clearing up some items (Bamboo, Moss)

This commit is contained in:
Amnet 2013-04-21 17:20:28 +02:00
parent dcdd216e63
commit 904181c734
19 changed files with 221 additions and 138 deletions

View File

@ -1,14 +1,13 @@
package biomesoplenty.api;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import com.google.common.base.Optional;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHalfSlab;
import com.google.common.base.Optional;
public class Blocks
{
// Worldgen Blocks

View File

@ -15,7 +15,7 @@ public class BlockBamboo extends Block
{
super(par1, Material.plants);
float var3 = 0.15F;
this.setBurnProperties(this.blockID, 5, 5);
setBurnProperties(this.blockID, 5, 5);
this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 1.0F, 0.5F + var3);
this.setTickRandomly(true);
}
@ -106,10 +106,10 @@ public class BlockBamboo extends Block
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return BOPItems.bambooItem.itemID;
}
// public int idDropped(int par1, Random par2Random, int par3)
// {
// return BOPItems.bambooItem.itemID;
// }
/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
@ -139,10 +139,10 @@ public class BlockBamboo extends Block
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return BOPItems.bambooItem.itemID;
}
// public int idPicked(World par1World, int par2, int par3, int par4)
// {
// return BOPItems.bambooItem.itemID;
// }
@Override
public boolean canSustainLeaves(World world, int x, int y, int z)

View File

@ -2,10 +2,6 @@ package biomesoplenty.blocks;
import java.util.Random;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import biomesoplenty.configuration.BOPItems;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
@ -14,14 +10,18 @@ import net.minecraft.util.Direction;
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPItems;
public class BlockMoss extends Block
{
public BlockMoss(int par1)
{
super(par1, Material.vine);
this.setBurnProperties(this.blockID, 15, 100);
setBurnProperties(this.blockID, 15, 100);
this.setTickRandomly(true);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override
@ -456,10 +456,10 @@ public class BlockMoss extends Block
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return BOPItems.mossItem.itemID;
}
// public int idDropped(int par1, Random par2Random, int par3)
// {
// return BOPItems.mossItem.itemID;
// }
/**
* Returns the quantity of items to drop on block destruction.
@ -472,10 +472,10 @@ public class BlockMoss extends Block
/**
* only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
*/
public int idPicked(World par1World, int par2, int par3, int par4)
{
return BOPItems.mossItem.itemID;
}
// public int idPicked(World par1World, int par2, int par3, int par4)
// {
// return BOPItems.mossItem.itemID;
// }
@Override
public boolean isBlockReplaceable(World world, int x, int y, int z)

View File

@ -3,6 +3,8 @@ package biomesoplenty.blocks;
import java.util.ArrayList;
import java.util.Random;
import biomesoplenty.BiomesOPlenty;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
@ -20,8 +22,9 @@ public class BlockWillow extends Block implements IShearable
public BlockWillow(int par1)
{
super(par1, Material.vine);
this.setBurnProperties(this.blockID, 15, 100);
setBurnProperties(this.blockID, 15, 100);
this.setTickRandomly(true);
this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
@Override

View File

@ -9,6 +9,7 @@ import biomesoplenty.blocks.BlockBOPLog.LogCategory;
import biomesoplenty.blocks.BlockBOPSlab.SlabCategory;
import biomesoplenty.blocks.BlockBOPStairs.Category;
import biomesoplenty.helpers.FurnaceFuel;
import biomesoplenty.items.ItemBamboo;
import biomesoplenty.items.ItemBOPAppleLeaves;
import biomesoplenty.items.ItemBOPColorizedLeaves;
import biomesoplenty.items.ItemBOPColorizedSapling;
@ -16,12 +17,14 @@ import biomesoplenty.items.ItemBOPFlower;
import biomesoplenty.items.ItemBOPFoliage;
import biomesoplenty.items.ItemBOPLeaves;
import biomesoplenty.items.ItemBOPLog;
import biomesoplenty.items.ItemBOPMoss;
import biomesoplenty.items.ItemBOPPetals;
import biomesoplenty.items.ItemBOPPlank;
import biomesoplenty.items.ItemBOPPlant;
import biomesoplenty.items.ItemBOPRedRock;
import biomesoplenty.items.ItemBOPSlab;
import biomesoplenty.items.ItemBOPSapling;
import biomesoplenty.items.ItemBOPWillow;
import com.google.common.base.Optional;
@ -106,14 +109,14 @@ public class BOPBlocks {
GameRegistry.registerBlock(Blocks.ash.get(), "ash");
GameRegistry.registerBlock(Blocks.plants.get(), ItemBOPPlant.class, "plants");
GameRegistry.registerBlock(Blocks.flowers.get(), ItemBOPFlower.class, "flowers");
GameRegistry.registerBlock(Blocks.willow.get(), "willow");
GameRegistry.registerBlock(Blocks.willow.get(), ItemBOPWillow.class, "willow");
GameRegistry.registerBlock(Blocks.leaves1.get(), ItemBOPLeaves.class, "leaves1");
GameRegistry.registerBlock(Blocks.leaves2.get(), ItemBOPLeaves.class, "leaves2");
GameRegistry.registerBlock(Blocks.foliage.get(), ItemBOPFoliage.class, "foliage");
GameRegistry.registerBlock(Blocks.ashStone.get(), "ashStone");
GameRegistry.registerBlock(Blocks.hardIce.get(), "hardIce");
GameRegistry.registerBlock(Blocks.leavesFruit.get(), ItemBOPAppleLeaves.class, "leavesFruit");
GameRegistry.registerBlock(Blocks.bamboo.get(), "bamboo");
GameRegistry.registerBlock(Blocks.bamboo.get(), ItemBamboo.class, "bamboo");
GameRegistry.registerBlock(Blocks.mudBrick.get(), "mudBrick");
GameRegistry.registerBlock(Blocks.mudBricksStairs.get(), "mudBricksStairs");
GameRegistry.registerBlock(Blocks.originGrass.get(), "originGrass");
@ -134,7 +137,7 @@ public class BOPBlocks {
GameRegistry.registerBlock(Blocks.amethystOre.get(), "amethystOre");
GameRegistry.registerBlock(Blocks.amethystBlock.get(), "amethystBlock");
GameRegistry.registerBlock(Blocks.bambooThatching.get(), "bambooThatching");
GameRegistry.registerBlock(Blocks.moss.get(), "moss");
GameRegistry.registerBlock(Blocks.moss.get(), ItemBOPMoss.class, "moss");
GameRegistry.registerBlock(Blocks.smolderingGrass.get(), "smolderingGrass");
GameRegistry.registerBlock(Blocks.cragRock.get(), "cragRock");
GameRegistry.registerBlock(Blocks.quicksand.get(), "quicksand");
@ -547,8 +550,8 @@ public class BOPBlocks {
GameRegistry.addRecipe(new ItemStack(Blocks.amethystBlock.get(), 1), new Object[] {"AAA", "AAA", "AAA", 'A', BOPItems.amethyst});
GameRegistry.addRecipe(new ItemStack(Blocks.ash.get(), 1), new Object[] {"AA", "AA", 'A', BOPItems.ashes});
GameRegistry.addRecipe(new ItemStack(Blocks.mudBrick.get(), 1), new Object[] {"MM", "MM", 'M', BOPItems.mudBrick});
GameRegistry.addRecipe(new ItemStack(Blocks.bambooThatching.get(), 1), new Object[] {"###", "###", "###", '#', BOPItems.bambooItem});
GameRegistry.addRecipe(new ItemStack(Block.cobblestoneMossy, 1, 0), new Object[] {"MMM", "MCM", "MMM", 'M', BOPItems.mossItem, 'C', Block.cobblestone});
GameRegistry.addRecipe(new ItemStack(Block.stoneBrick, 1, 1), new Object[] {"MMM", "MSM", "MMM", 'M', BOPItems.mossItem, 'S', Block.stoneBrick});
GameRegistry.addRecipe(new ItemStack(Blocks.bambooThatching.get(), 1), new Object[] {"###", "###", "###", '#', Blocks.bamboo.get()});
GameRegistry.addRecipe(new ItemStack(Block.cobblestoneMossy, 1, 0), new Object[] {"MMM", "MCM", "MMM", 'M', Blocks.moss.get(), 'C', Block.cobblestone});
GameRegistry.addRecipe(new ItemStack(Block.stoneBrick, 1, 1), new Object[] {"MMM", "MSM", "MMM", 'M', Blocks.moss.get(), 'S', Block.stoneBrick});
}
}

View File

@ -56,9 +56,9 @@ public class BOPItems {
// public static Item mediumGrassItem;
// public static Item bushItem;
// public static Item sproutItem;
public static Item mossItem;
// public static Item mossItem;
public static Item ashes;
public static Item bambooItem;
// public static Item bambooItem;
public static Item ancientStaff;
public static Item ancientStaffHandle;
public static Item ancientStaffPole;
@ -142,14 +142,14 @@ public class BOPItems {
shroomPowder = (new ItemShroomPowder(BOPConfiguration.shroomPowderID, 1, 0.5F, false)).setPotionEffect(Potion.confusion.id, 30, 0, 0.6F).setAlwaysEdible().setUnlocalizedName("shroomPowder").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
mudBall = (new ItemBOP(BOPConfiguration.mudBallID, 0)).setUnlocalizedName("mudBall").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
mudBrick = (new ItemBOP(BOPConfiguration.mudBrickID, 1)).setUnlocalizedName("mudBrick").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
bambooItem = (new ItemBamboo(BOPConfiguration.bambooItemID, Blocks.bamboo.get())).setUnlocalizedName("bambooItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
// bambooItem = (new ItemBamboo(BOPConfiguration.bambooItemID, Blocks.bamboo.get())).setUnlocalizedName("bambooItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
// cattailItem = (new ItemCattail(BOPConfiguration.cattailItemID, BOPBlocks.cattail)).setUnlocalizedName("cattailItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
// barleyItem = (new ItemBarley(BOPConfiguration.barleyItemID, BOPBlocks.barley)).setUnlocalizedName("barleyItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
// shortGrassItem = (new ItemShortGrass(BOPConfiguration.shortGrassItemID, BOPBlocks.shortGrass)).setUnlocalizedName("shortGrassItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
// mediumGrassItem = (new ItemMediumGrass(BOPConfiguration.mediumGrassItemID, BOPBlocks.mediumGrass)).setUnlocalizedName("mediumGrassItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
// bushItem = (new ItemBush(BOPConfiguration.bushItemID, BOPBlocks.bush)).setUnlocalizedName("bushItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
// sproutItem = (new ItemSprout(BOPConfiguration.sproutItemID, BOPBlocks.sprout)).setUnlocalizedName("sproutItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
mossItem = (new ItemBOP(BOPConfiguration.mossItemID, 2)).setUnlocalizedName("mossItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
// mossItem = (new ItemBOP(BOPConfiguration.mossItemID, 2)).setUnlocalizedName("mossItem").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
ancientStaff = new ItemAncientStaff(BOPConfiguration.ancientStaffID).setUnlocalizedName("ancientStaff").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
enderporter = new ItemEnderporter(BOPConfiguration.enderporterID).setUnlocalizedName("enderporter").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
ashes = (new ItemBOP(BOPConfiguration.ashesID, 3)).setUnlocalizedName("ashes").setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
@ -215,7 +215,7 @@ public class BOPItems {
GameRegistry.addRecipe(new ItemStack(enderporter, 1, 0), new Object[] {"IOI", "OAO", "IOI", 'I', Item.eyeOfEnder, 'O', Block.obsidian, 'A', Blocks.amethystBlock.get()});
GameRegistry.addRecipe(new ItemStack(bopDiscMud, 1), new Object[] {" M ", "MDM", " M ", 'M', mudBall, 'D', bopDisc});
GameRegistry.addShapelessRecipe(new ItemStack(bambooItem, 9), new Object[] {Blocks.bambooThatching.get()});
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.bamboo.get(), 9), new Object[] {Blocks.bambooThatching.get()});
GameRegistry.addShapelessRecipe(new ItemStack(amethyst, 9), new Object[] {Blocks.amethystBlock.get()});
//Plants
@ -226,13 +226,13 @@ public class BOPItems {
LanguageRegistry.addName(shroomPowder, "Shroom Powder");
LanguageRegistry.addName(mudBall, "Mud Ball");
LanguageRegistry.addName(mudBrick, "Mud Brick");
LanguageRegistry.addName(bambooItem, "Bamboo");
// LanguageRegistry.addName(bambooItem, "Bamboo");
// LanguageRegistry.addName(cattailItem, "Cattail");
// LanguageRegistry.addName(shortGrassItem, "Short Grass");
// LanguageRegistry.addName(mediumGrassItem, "Medium Grass");
// LanguageRegistry.addName(bushItem, "Bush");
// LanguageRegistry.addName(sproutItem, "Sprout");
LanguageRegistry.addName(mossItem, "Moss");
// LanguageRegistry.addName(mossItem, "Moss");
// LanguageRegistry.addName(barleyItem, "Barley");
LanguageRegistry.addName(ashes, "Pile of Ashes");
LanguageRegistry.addName(pickaxeMud, "Muddy Pickaxe");

View File

@ -28,7 +28,7 @@ public class BOPVanillaCompat {
village = ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH);
dungeon.addItem(new WeightedRandomChestContent(new ItemStack(BOPItems.bopDisc), 1, 1, 2));
dungeon.addItem(new WeightedRandomChestContent(new ItemStack(BOPItems.mossItem), 2, 8, 50));
dungeon.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.moss.get()), 2, 8, 50));
dungeon.addItem(new WeightedRandomChestContent(new ItemStack(Item.dyePowder, 1, 2), 4, 12, 75));
mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(BOPItems.ashes), 2, 8, 25));
@ -36,11 +36,11 @@ public class BOPVanillaCompat {
mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(BOPItems.mudBall), 2, 8, 10));
mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(Item.dyePowder, 1, 3), 4, 12, 75));
strongholdCorridor.addItem(new WeightedRandomChestContent(new ItemStack(BOPItems.mossItem), 2, 8, 50));
strongholdCorridor.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.moss.get()), 2, 8, 50));
strongholdCorridor.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.flowers.get(),1,3), 1, 4, 25));
strongholdCorridor.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.flowers.get(),1,2), 1, 4, 25));
strongholdCrossing.addItem(new WeightedRandomChestContent(new ItemStack(BOPItems.mossItem), 2, 8, 50));
strongholdCrossing.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.moss.get()), 2, 8, 50));
strongholdCrossing.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.flowers.get(),1,3), 1, 4, 25));
strongholdCrossing.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.flowers.get(),1,2), 1, 4, 25));

View File

@ -8,7 +8,6 @@ import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.configuration.BOPItems;
import cpw.mods.fml.common.registry.LanguageRegistry;
@ -24,7 +23,7 @@ public class AchievementHelper
private static Achievement achPromised;
private static Achievement achMud;
private static Achievement achShroom;
// private static Achievement achBarley;
private static Achievement achBarley;
private static Achievement achMoss;
public static AchievementPage pageBOP;
@ -45,10 +44,10 @@ public class AchievementHelper
achPromised = (new Achievement(3062, "achPromised", 0, -5, Blocks.holyGrass.get(), achFlower)).setSpecial().registerAchievement();
achMud = (new Achievement(3063, "achMud", -2, -1, BOPItems.mudBall, achFlower)).registerAchievement();
achShroom = (new Achievement(3064, "achShroom", 1, -2, new ItemStack(Blocks.flowers.get(),1,10), achFlower)).registerAchievement();
// achBarley = (new Achievement(3065, "achBarley", -2, 4, BOPItems.barleyItem, achFlower)).registerAchievement();
achMoss = (new Achievement(3066, "achMoss", -1, -3, BOPItems.mossItem, achFlower)).registerAchievement();
achBarley = (new Achievement(3065, "achBarley", -2, 4, new ItemStack(Blocks.plants.get(),1,6), achFlower)).registerAchievement();
achMoss = (new Achievement(3066, "achMoss", -1, -3, Blocks.moss.get(), achFlower)).registerAchievement();
pageBOP = new AchievementPage("Biomes O\' Plenty", new Achievement[] {achFlower, achRedRock, achThorn, achAsh, achOrigin, achPromised, achMud, achShroom, /*achBarley,*/ achMoss});
pageBOP = new AchievementPage("Biomes O\' Plenty", new Achievement[] {achFlower, achRedRock, achThorn, achAsh, achOrigin, achPromised, achMud, achShroom, achBarley, achMoss});
AchievementPage.registerAchievementPage(pageBOP);
// Add Achievement registration
@ -101,11 +100,11 @@ public class AchievementHelper
{
player.addStat(achShroom, 1);
}
// if (item.itemID == BOPItems.barleyItem.itemID)
// {
// player.addStat(achBarley, 1);
// }
if (item.itemID == BOPItems.mossItem.itemID)
if (item.itemID == Blocks.planks.get().blockID && item.getItemDamage() == 6)
{
player.addStat(achBarley, 1);
}
if (item.itemID == Blocks.moss.get().blockID)
{
player.addStat(achMoss, 1);
}

View File

@ -5,16 +5,17 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemColored;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import biomesoplenty.api.Blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBOPFoliage extends ItemBlock
public class ItemBOPFoliage extends ItemColored
{
private static final String[] foliageTypes = new String[] {"algae", "shortgrass", "mediumgrass", "highgrass", "bush", "sprout", "highgrasstop"};
@SideOnly(Side.CLIENT)
@ -22,7 +23,7 @@ public class ItemBOPFoliage extends ItemBlock
public ItemBOPFoliage(int par1)
{
super(par1);
super(par1, true);
setMaxDamage(0);
setHasSubtypes(true);
}
@ -33,7 +34,18 @@ public class ItemBOPFoliage extends ItemBlock
textures = new Icon[foliageTypes.length - 1];
for (int i = 0; i < foliageTypes.length - 1; ++i)
textures[i] = iconRegister.registerIcon("BiomesOPlenty:item_" + foliageTypes[i]);
textures[i] = iconRegister.registerIcon("BiomesOPlenty:" + foliageTypes[i]);
textures[3] = iconRegister.registerIcon("BiomesOPlenty:item_highgrass");
}
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemStack, int par2)
{
if (itemStack.getItemDamage() == 3)
return 16777215;
else
return Blocks.foliage.get().getRenderColor(itemStack.getItemDamage());
}
@Override

View File

@ -0,0 +1,30 @@
package biomesoplenty.items;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.Icon;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBOPMoss extends ItemBlock
{
@SideOnly(Side.CLIENT)
private Icon texture;
public ItemBOPMoss(int par1)
{
super(par1);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
texture = iconRegister.registerIcon("BiomesOPlenty:item_moss");
}
@Override
public Icon getIconFromDamage(int meta)
{
return texture;
}
}

View File

@ -0,0 +1,38 @@
package biomesoplenty.items;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.ItemColored;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import biomesoplenty.api.Blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBOPWillow extends ItemColored
{
@SideOnly(Side.CLIENT)
private Icon texture;
public ItemBOPWillow(int par1)
{
super(par1, false);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister)
{
texture = iconRegister.registerIcon("BiomesOPlenty:willow");
}
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack itemStack, int par2)
{
return Blocks.willow.get().getRenderColor(itemStack.getItemDamage());
}
@Override
public Icon getIconFromDamage(int meta)
{
return texture;
}
}

View File

@ -1,98 +1,97 @@
package biomesoplenty.items;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.Icon;
public class ItemBamboo extends Item
public class ItemBamboo extends ItemBlock
{
private int spawnID;
public ItemBamboo(int par1, Block par2Block)
public ItemBamboo(int par1)
{
super(par1);
this.spawnID = par2Block.blockID;
}
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("BiomesOPlenty:bamboo");
itemIcon = iconRegister.registerIcon("BiomesOPlenty:item_bamboo");
}
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
@Override
public Icon getIconFromDamage(int meta)
{
int var11 = par3World.getBlockId(par4, par5, par6);
if (var11 == Block.snow.blockID)
{
par7 = 1;
}
else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID)
{
if (par7 == 0)
{
--par5;
}
if (par7 == 1)
{
++par5;
}
if (par7 == 2)
{
--par6;
}
if (par7 == 3)
{
++par6;
}
if (par7 == 4)
{
--par4;
}
if (par7 == 5)
{
++par4;
}
}
if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
{
return false;
}
else if (par1ItemStack.stackSize == 0)
{
return false;
}
else
{
if (par3World.canPlaceEntityOnSide(this.spawnID, par4, par5, par6, false, par7, (Entity)null, par1ItemStack))
{
Block var12 = Block.blocksList[this.spawnID];
int var13 = var12.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0);
if (par3World.setBlock(par4, par5, par6, this.spawnID, var13, 2))
{
if (par3World.getBlockId(par4, par5, par6) == this.spawnID)
{
Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack);
Block.blocksList[this.spawnID].onPostBlockPlaced(par3World, par4, par5, par6, var13);
}
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F);
--par1ItemStack.stackSize;
}
}
return true;
}
return itemIcon;
}
// public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
// {
// int var11 = par3World.getBlockId(par4, par5, par6);
//
// if (var11 == Block.snow.blockID)
// {
// par7 = 1;
// }
// else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID)
// {
// if (par7 == 0)
// {
// --par5;
// }
//
// if (par7 == 1)
// {
// ++par5;
// }
//
// if (par7 == 2)
// {
// --par6;
// }
//
// if (par7 == 3)
// {
// ++par6;
// }
//
// if (par7 == 4)
// {
// --par4;
// }
//
// if (par7 == 5)
// {
// ++par4;
// }
// }
//
// if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
// {
// return false;
// }
// else if (par1ItemStack.stackSize == 0)
// {
// return false;
// }
// else
// {
// if (par3World.canPlaceEntityOnSide(this.spawnID, par4, par5, par6, false, par7, (Entity)null, par1ItemStack))
// {
// Block var12 = Block.blocksList[this.spawnID];
// int var13 = var12.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0);
//
// if (par3World.setBlock(par4, par5, par6, this.spawnID, var13, 2))
// {
// if (par3World.getBlockId(par4, par5, par6) == this.spawnID)
// {
// Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack);
// Block.blocksList[this.spawnID].onPostBlockPlaced(par3World, par4, par5, par6, var13);
// }
//
// par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F);
// --par1ItemStack.stackSize;
// }
// }
//
// return true;
// }
// }
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B