Fixed mudballs in dispensers (had to move to separate ID)

Added seeds on destroying our grasses
Added carrots / potatoes dropped on destroying sprouts (1% chance)
Added golem compatibility with our apple leaves for Thaumcraft
Added random drop of apples when destroying apple leaves
Added flowers to plants created on bonemeal use
Changed recipe for Bamboo Thatching
Added bamboo usable as sticks
This commit is contained in:
Amnet 2013-04-25 00:45:57 +02:00
parent 10326d1396
commit ff149f05a0
14 changed files with 151 additions and 47 deletions

View File

@ -24,7 +24,7 @@ public class ClientProxy extends CommonProxy {
MinecraftForgeClient.preloadTexture(ARMOR_AMETHYST1_PNG);
MinecraftForgeClient.preloadTexture(ARMOR_AMETHYST2_PNG);
RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(Items.miscItems.get(), 0));
RenderingRegistry.registerEntityRenderingHandler(EntityMudball.class, new RenderSnowball(Items.mudball.get(), 0));
RenderingRegistry.registerBlockHandler(new FoliageRenderer());
RenderingRegistry.registerBlockHandler(new PlantsRenderer());
@ -35,7 +35,7 @@ public class ClientProxy extends CommonProxy {
{
EntityFX entityfx = null;
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.miscItems.get(), mc.renderEngine);
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.mudball.get(), mc.renderEngine);
mc.effectRenderer.addEffect(entityfx);
}

View File

@ -33,4 +33,5 @@ public class Items
public static Optional<? extends Item> enderporter = Optional.absent();
public static Optional<? extends Item> shroomPowder = Optional.absent();
public static Optional<? extends Item> miscItems = Optional.absent();
public static Optional<? extends Item> mudball = Optional.absent();
}

View File

@ -259,6 +259,27 @@ public class BlockBOPAppleLeaves extends BlockLeavesBase implements IShearable
return random.nextInt(20) == 0 ? 1 : 0;
}
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int par7)
{
if (world.isRemote)
return;
if (world.rand.nextInt(20) == 0)
{
int var9 = this.idDropped(meta, world.rand, par7);
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(var9, 1, this.damageDropped(meta)));
}
if ((meta & 3) == 3)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
else if ((meta & 3) == 2 && world.rand.nextInt(2) == 0)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
else if ((meta & 3) == 1 && world.rand.nextInt(5) == 0)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
else if ((meta & 3) == 0 && world.rand.nextInt(10) == 0)
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Item.appleRed, 1, 0));
}
@Override
public boolean isShearable(ItemStack item, World world, int x, int y, int z)
{

View File

@ -10,12 +10,14 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.IShearable;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.blocks.renderers.FoliageRenderer;
@ -69,6 +71,38 @@ public class BlockBOPFoliage extends BlockFlower implements IShearable
list.add(new ItemStack(blockID, 1, i));
}
@Override
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int meta, int fortune)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
switch (meta)
{
case 1:
case 2:
case 3:
if (world.rand.nextInt(8) != 0)
return ret;
ItemStack item = ForgeHooks.getGrassSeed(world);
if (item != null)
ret.add(item);
break;
case 5:
if (world.rand.nextInt(50) != 0)
return ret;
if (world.rand.nextInt(2) == 0)
ret.add(new ItemStack(Item.carrot,1));
else
ret.add(new ItemStack(Item.potato,1));
break;
}
return ret;
}
@Override
public boolean canPlaceBlockOnSide(World world, int x, int y, int z, int side, ItemStack itemStack)
{

View File

@ -86,7 +86,7 @@ public class BlockMud extends Block
public int idDropped(int par1, Random par2Random, int par3)
{
if (par1 == 0)
return Items.miscItems.get().itemID;
return Items.mudball.get().itemID;
else
return this.blockID;
}

View File

@ -84,6 +84,8 @@ public class BOPBlocks {
MinecraftForge.setBlockHarvestLevel(Blocks.amethystOre.get(), "pickaxe", 3);
MinecraftForge.setBlockHarvestLevel(Blocks.amethystBlock.get(), "pickaxe", 3);
addGrassPlants();
registerNames();
}
@ -384,4 +386,20 @@ public class BOPBlocks {
LanguageRegistry.addName(new ItemStack(Blocks.leavesColorized.get(),1,1), "Mangrove Leaves");
LanguageRegistry.addName(new ItemStack(Blocks.leaves1.get(),1,6), "Holy Leaves");
}
private static void addGrassPlants()
{
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 0, 10);
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 1, 3);
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 2, 1);
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 3, 1);
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 4, 5);
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 5, 5);
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 6, 5);
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 7, 5);
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 8, 5);
MinecraftForge.addGrassPlant(Blocks.flowers.get(), 9, 5);
MinecraftForge.addGrassPlant(Blocks.foliage.get(), 5, 10);
}
}

View File

@ -181,6 +181,7 @@ public class BOPConfiguration {
public static int bopDiscMudID;
public static int miscItemsID;
public static int mudballID;
public static int swordMudID;
public static int shovelMudID;
@ -480,6 +481,7 @@ public class BOPConfiguration {
enderporterID = config.getItem("Enderporter ID", 21007).getInt();
miscItemsID = config.getItem("Misc Items ID", 21010).getInt();
mudballID = config.getItem("Mud Ball ID", 21011).getInt();
bopDiscID = config.getItem("Traversia Music Disc ID", 21019, null).getInt();
bopDiscMudID = config.getItem("Muddy Music Disc ID", 21020, null).getInt();

View File

@ -107,24 +107,24 @@ public class BOPCrafting
GameRegistry.addRecipe(new ItemStack(Block.cloth, 1, 0), new Object[] {"CCC", "CCC", "CCC", 'C', new ItemStack(Blocks.plants.get(), 1, 7)});
GameRegistry.addRecipe(new ItemStack(Item.coal, 1), new Object[] {"AAA", "AAA", "AAA", 'A', new ItemStack(Items.miscItems.get(), 1, 1)});
GameRegistry.addRecipe(new ItemStack(Blocks.mud.get(), 1), new Object[] {"MM", "MM", 'M', new ItemStack(Items.miscItems.get(), 1, 0)});
GameRegistry.addRecipe(new ItemStack(Blocks.mud.get(), 1), new Object[] {"MM", "MM", 'M', Items.mudball.get()});
GameRegistry.addRecipe(new ItemStack(Blocks.amethystBlock.get(), 1), new Object[] {"AAA", "AAA", "AAA", 'A', new ItemStack(Items.miscItems.get(), 1, 2)});
GameRegistry.addRecipe(new ItemStack(Blocks.ash.get(), 1), new Object[] {"AA", "AA", 'A', new ItemStack(Items.miscItems.get(), 1, 1)});
GameRegistry.addRecipe(new ItemStack(Blocks.mudBrick.get(), 1), new Object[] {"MM", "MM", 'M', new ItemStack(Items.miscItems.get(), 1, 3)});
GameRegistry.addRecipe(new ItemStack(Blocks.planks.get(), 1, 10), new Object[] {"###", "###", "###", '#', Blocks.bamboo.get()});
// GameRegistry.addRecipe(new ItemStack(Blocks.planks.get(), 1, 10), 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});
//Mud Tools and Armor
GameRegistry.addRecipe(new ItemStack(Items.pickaxeMud.get(), 1), new Object [] {"###", " X ", " X ", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 0), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.shovelMud.get(), 1), new Object [] {"#", "X", "X", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 0), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.swordMud.get(), 1), new Object [] {"#", "#", "X", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 0), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.axeMud.get(), 1), new Object [] {"##", "#X", " X", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 0), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.hoeMud.get(), 1), new Object [] {"##", " X", " X", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 0), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.helmetMud.get(), 1), new Object [] {"###", "# #", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 0)});
GameRegistry.addRecipe(new ItemStack(Items.chestplateMud.get(), 1), new Object [] {"# #", "###", "###", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 0)});
GameRegistry.addRecipe(new ItemStack(Items.leggingsMud.get(), 1), new Object [] {"###", "# #", "# #", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 0)});
GameRegistry.addRecipe(new ItemStack(Items.bootsMud.get(), 1), new Object [] {"# #", "# #", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 0)});
GameRegistry.addRecipe(new ItemStack(Items.pickaxeMud.get(), 1), new Object [] {"###", " X ", " X ", Character.valueOf('#'), Items.mudball.get(), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.shovelMud.get(), 1), new Object [] {"#", "X", "X", Character.valueOf('#'), Items.mudball.get(), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.swordMud.get(), 1), new Object [] {"#", "#", "X", Character.valueOf('#'), Items.mudball.get(), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.axeMud.get(), 1), new Object [] {"##", "#X", " X", Character.valueOf('#'), Items.mudball.get(), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.hoeMud.get(), 1), new Object [] {"##", " X", " X", Character.valueOf('#'), Items.mudball.get(), Character.valueOf('X'), Item.stick});
GameRegistry.addRecipe(new ItemStack(Items.helmetMud.get(), 1), new Object [] {"###", "# #", Character.valueOf('#'), Items.mudball.get()});
GameRegistry.addRecipe(new ItemStack(Items.chestplateMud.get(), 1), new Object [] {"# #", "###", "###", Character.valueOf('#'), Items.mudball.get()});
GameRegistry.addRecipe(new ItemStack(Items.leggingsMud.get(), 1), new Object [] {"###", "# #", "# #", Character.valueOf('#'), Items.mudball.get()});
GameRegistry.addRecipe(new ItemStack(Items.bootsMud.get(), 1), new Object [] {"# #", "# #", Character.valueOf('#'), Items.mudball.get()});
//Amethyst Tools and Armor
GameRegistry.addRecipe(new ItemStack(Items.pickaxeAmethyst.get(), 1), new Object [] {"###", " X ", " X ", Character.valueOf('#'), new ItemStack(Items.miscItems.get(), 1, 2), Character.valueOf('X'), Item.ingotIron});
@ -144,9 +144,11 @@ public class BOPCrafting
GameRegistry.addRecipe(new ItemStack(Items.ancientStaff.get(), 1, 2), new Object[] {"ISI", "IRI", "ISI", 'I', Item.ingotIron, 'S', Block.whiteStone, 'R', Item.redstone});
GameRegistry.addRecipe(new ItemStack(Items.ancientStaff.get(), 1, 3), new Object[] {" N ", "IDI", "ISI", 'I', Item.ingotIron, 'S', Block.whiteStone, 'D', Item.diamond, 'N', Item.netherStar});
GameRegistry.addRecipe(new ItemStack(Items.enderporter.get(), 1, 0), new Object[] {"IOI", "OAO", "IOI", 'I', Item.eyeOfEnder, 'O', Block.obsidian, 'A', Blocks.amethystBlock.get()});
GameRegistry.addRecipe(new ItemStack(Items.bopDiscMud.get(), 1), new Object[] {" M ", "MDM", " M ", 'M', new ItemStack(Items.miscItems.get(), 1, 0), 'D', Items.bopDisc.get()});
GameRegistry.addRecipe(new ItemStack(Items.bopDiscMud.get(), 1), new Object[] {" M ", "MDM", " M ", 'M', Items.mudball.get(), 'D', Items.bopDisc.get()});
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.bamboo.get(), 9), new Object[] {new ItemStack(Blocks.planks.get(), 1, 10)});
GameRegistry.addRecipe(new ItemStack(Blocks.planks.get(), 1, 10), new Object[] {"##", "##", '#', Blocks.bamboo.get()});
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.bamboo.get(), 4), new Object[] {new ItemStack(Blocks.planks.get(), 1, 10)});
GameRegistry.addShapelessRecipe(new ItemStack(Items.miscItems.get(), 9, 2), new Object[] {Blocks.amethystBlock.get()});
//Plants
@ -158,7 +160,12 @@ public class BOPCrafting
GameRegistry.addSmelting(Block.dirt.blockID, new ItemStack(Blocks.driedDirt.get(), 1), 0F);
FurnaceRecipes.smelting().addSmelting(Blocks.redRock.get().blockID, 1, new ItemStack(Blocks.redRock.get(), 1, 0), 0.1F);
FurnaceRecipes.smelting().addSmelting(Blocks.flowers.get().blockID, 11, new ItemStack(Item.dyePowder, 1, 2), 0.2F);
FurnaceRecipes.smelting().addSmelting(Items.miscItems.get().itemID, 2, new ItemStack(Items.miscItems.get(), 1, 3), 0F);
FurnaceRecipes.smelting().addSmelting(Items.mudball.get().itemID, 0, new ItemStack(Items.miscItems.get(), 1, 0), 0F);
FurnaceRecipes.smelting().addSmelting(Blocks.logs1.get().blockID, new ItemStack(Item.coal, 1, 1), 15F);
FurnaceRecipes.smelting().addSmelting(Blocks.logs2.get().blockID, new ItemStack(Item.coal, 1, 1), 15F);
for (int i = 0; i < 3; ++i)
FurnaceRecipes.smelting().addSmelting(Blocks.logs3.get().blockID, i, new ItemStack(Item.coal, 1, 1), 15F);
GameRegistry.registerFuelHandler(checkNotNull(new FurnaceFuel()));
}
@ -168,7 +175,8 @@ public class BOPCrafting
//Ore Registration
for (int i = 0; i < 10; ++i)
OreDictionary.registerOre("plankWood", new ItemStack(Blocks.planks.get(), 1, i));
// OreDictionary.registerOre("plankWood", new ItemStack(Blocks.bambooThatching.get()));
OreDictionary.registerOre("stickWood", new ItemStack(Blocks.bamboo.get()));
OreDictionary.registerOre("treeSapling", new ItemStack(Blocks.saplings.get(), 1, OreDictionary.WILDCARD_VALUE));
OreDictionary.registerOre("treeSapling", new ItemStack(Blocks.colorizedSaplings.get(), 1, OreDictionary.WILDCARD_VALUE));

View File

@ -18,6 +18,7 @@ import biomesoplenty.items.ItemBOP;
import biomesoplenty.items.ItemBOPAncientStaff;
import biomesoplenty.items.ItemBOPAxe;
import biomesoplenty.items.ItemBOPHoe;
import biomesoplenty.items.ItemBOPMudball;
import biomesoplenty.items.ItemBOPPickaxe;
import biomesoplenty.items.ItemBOPRecord;
import biomesoplenty.items.ItemBOPRecordMud;
@ -101,6 +102,7 @@ public class BOPItems {
// Item declaration
Items.shroomPowder = Optional.of(new ItemShroomPowder(BOPConfiguration.shroomPowderID, 1, 0.5F, false));
Items.miscItems = Optional.of(new ItemBOP(BOPConfiguration.miscItemsID));
Items.mudball = Optional.of(new ItemBOPMudball(BOPConfiguration.mudballID));
Items.ancientStaff = Optional.of(new ItemBOPAncientStaff(BOPConfiguration.ancientStaffID));
@ -133,8 +135,8 @@ public class BOPItems {
private static void registerNames()
{
LanguageRegistry.addName(Items.shroomPowder.get(), "Shroom Powder");
LanguageRegistry.addName(new ItemStack(Items.miscItems.get(), 1, 0), "Mud Ball");
LanguageRegistry.addName(new ItemStack(Items.miscItems.get(), 1, 3), "Mud Brick");
LanguageRegistry.addName(Items.mudball.get(), "Mud Ball");
LanguageRegistry.addName(new ItemStack(Items.miscItems.get(), 1, 0), "Mud Brick");
LanguageRegistry.addName(new ItemStack(Items.miscItems.get(), 1, 2), "Amethyst");
LanguageRegistry.addName(new ItemStack(Items.miscItems.get(), 1, 1), "Pile of Ashes");

View File

@ -14,7 +14,7 @@ public class BOPVanillaCompat {
public static void init()
{
// Dispenser behavior for mud balls
BlockDispenser.dispenseBehaviorRegistry.putObject(new ItemStack(Items.miscItems.get(), 1, 0), new DispenserBehaviorMudball());
BlockDispenser.dispenseBehaviorRegistry.putObject(Items.mudball.get(), new DispenserBehaviorMudball());
ChestGenHooks dungeon;
ChestGenHooks mineshaft;
@ -34,7 +34,7 @@ public class BOPVanillaCompat {
mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(Items.miscItems.get(), 1, 1), 2, 8, 25));
mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.plants.get(),1,5), 4, 6, 15));
mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(Items.miscItems.get(), 1, 0), 2, 8, 10));
mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(Items.mudball.get(), 1, 0), 2, 8, 10));
mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(Item.dyePowder, 1, 3), 4, 12, 75));
strongholdCorridor.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.moss.get()), 2, 8, 50));

View File

@ -42,7 +42,7 @@ public class AchievementHelper
achAsh = (new Achievement(3060, "achAsh", 1, 3, new ItemStack(Items.miscItems.get(), 1, 1), achFlower)).registerAchievement();
achOrigin = (new Achievement(3061, "achOrigin", 0, 5, Blocks.originGrass.get(), achFlower)).setSpecial().registerAchievement();
achPromised = (new Achievement(3062, "achPromised", 0, -5, Blocks.holyGrass.get(), achFlower)).setSpecial().registerAchievement();
achMud = (new Achievement(3063, "achMud", -2, -1, new ItemStack(Items.miscItems.get(), 1, 0), achFlower)).registerAchievement();
achMud = (new Achievement(3063, "achMud", -2, -1, Items.mudball.get(), 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, new ItemStack(Blocks.plants.get(),1,6), achFlower)).registerAchievement();
achMoss = (new Achievement(3066, "achMoss", -1, -3, Blocks.moss.get(), achFlower)).registerAchievement();
@ -92,7 +92,7 @@ public class AchievementHelper
{
player.addStat(achPromised, 1);
}
if (item.itemID == Items.miscItems.get().itemID && item.getItemDamage() == 0)
if (item.itemID == Items.mudball.get().itemID)
{
player.addStat(achMud, 1);
}

View File

@ -1,5 +1,6 @@
package biomesoplenty.integration;
import cpw.mods.fml.common.event.FMLInterModComms;
import net.minecraft.item.ItemStack;
import biomesoplenty.api.BlockReferences;
import biomesoplenty.api.Blocks;
@ -13,6 +14,7 @@ public class ThaumcraftIntegration {
protected static void init()
{
addAspects();
FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(Blocks.leavesFruit.get(), 1, 4));
}
private static void addAspects()

View File

@ -4,19 +4,16 @@ import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.items.projectiles.EntityMudball;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBOP extends Item
{
private static String[] items = {"mudball", "ash", "amethyst", "mudbrick"};
private static String[] items = {"mudbrick", "ash", "amethyst"};
@SideOnly(Side.CLIENT)
private Icon[] textures;
@ -53,23 +50,4 @@ public class ItemBOP extends Item
for(int meta = 0; meta < items.length; ++meta)
subTypes.add(new ItemStack(itemId, 1, meta));
}
public ItemStack onItemRightClick(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (itemStack.getItemDamage() == 0)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--itemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityMudball(par2World, par3EntityPlayer));
}
}
return itemStack;
}
}

View File

@ -0,0 +1,38 @@
package biomesoplenty.items;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.items.projectiles.EntityMudball;
public class ItemBOPMudball extends Item
{
public ItemBOPMudball(int par1)
{
super(par1);
setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
setUnlocalizedName("mudball");
}
public void registerIcons(IconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon("BiomesOPlenty:mudball");
}
public ItemStack onItemRightClick(ItemStack itemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
--itemStack.stackSize;
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
par2World.spawnEntityInWorld(new EntityMudball(par2World, par3EntityPlayer));
return itemStack;
}
}