Added persimmons

This commit is contained in:
Matt Caughey 2013-09-07 14:16:30 -04:00
parent 7e90f99111
commit 63354631f1
4 changed files with 26 additions and 2 deletions

View file

@ -275,6 +275,7 @@
<entry key="item.bop.food.saladfruit.name">Fruit Salad</entry>
<entry key="item.bop.food.saladveggie.name">Veggie Salad</entry>
<entry key="item.bop.food.saladshroom.name">Shroom Salad</entry>
<entry key="item.bop.food.persimmon.name">Persimmon</entry>
<entry key="item.bop.dartblower.name">Dart Blower</entry>
<entry key="item.bop.dart.dart.name">Dart</entry>

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

View file

@ -9,6 +9,7 @@ import net.minecraft.block.BlockLeavesBase;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
@ -17,6 +18,7 @@ import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.IShearable;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Blocks;
import biomesoplenty.api.Items;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -298,6 +300,23 @@ public class BlockBOPLeaves extends BlockLeavesBase implements IShearable
{
return Blocks.saplings.get().blockID;
}
@Override
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 & 7) == 0 || (meta & 7) == 4 || (meta & 7) == 7) && (world.rand.nextInt(50) == 0)) {
this.dropBlockAsItem_do(world, x, y, z, new ItemStack(Items.food.get(), 1, 8));
}
}
@Override
public int damageDropped(int meta)

View file

@ -16,7 +16,7 @@ import biomesoplenty.BiomesOPlenty;
public class ItemBOPFood extends ItemFood
{
private static final String[] foodTypes = new String[] {"berries", "shroompowder", "wildcarrots", "sunflowerseeds", "saladfruit", "saladveggie", "saladshroom", "earth"};
private static final String[] foodTypes = new String[] {"berries", "shroompowder", "wildcarrots", "sunflowerseeds", "saladfruit", "saladveggie", "saladshroom", "earth", "persimmon"};
private Icon[] textures;
public ItemBOPFood(int par1)
@ -54,7 +54,7 @@ public class ItemBOPFood extends ItemFood
switch (itemstack.getItemDamage())
{
case 0:
player.getFoodStats().addStats(2, 0.2F);
player.getFoodStats().addStats(1, 0.5F);
break;
case 1:
@ -81,6 +81,10 @@ public class ItemBOPFood extends ItemFood
player.getFoodStats().addStats(6, 1.6F);
break;
case 8:
player.getFoodStats().addStats(5, 3.0F);
break;
default:
player.getFoodStats().addStats(0, 0.0F);
break;