Made the chance of scythes getting damaged related to their material

This commit is contained in:
Adubbz 2013-07-10 10:23:44 +10:00
parent f5936e2434
commit b58ea4369d

View file

@ -118,10 +118,31 @@ public class ItemBOPScythe extends Item
if (block != null) if (block != null)
{ {
if (world.rand.nextInt(6) == 0) if (toolMaterial == EnumToolMaterial.IRON || toolMaterial == EnumToolMaterial.GOLD)
{ {
stack.damageItem(1, entity); if (world.rand.nextInt(7) == 0)
} {
stack.damageItem(1, entity);
}
}
else if (toolMaterial == EnumToolMaterial.EMERALD)
{
if (world.rand.nextInt(8) == 0)
{
stack.damageItem(1, entity);
}
}
else if (toolMaterial == BOPItems.EnumToolMaterialAmethyst)
{
if (world.rand.nextInt(9) == 0)
{
stack.damageItem(1, entity);
}
}
else if (world.rand.nextInt(5) == 0)
{
stack.damageItem(1, entity);
}
if (block.blockID == Blocks.foliage.get().blockID && (meta == 1 || meta == 2 || meta == 6)) if (block.blockID == Blocks.foliage.get().blockID && (meta == 1 || meta == 2 || meta == 6))
{ {
@ -174,7 +195,28 @@ public class ItemBOPScythe extends Item
{ {
if (block.isLeaves(world, x + aX, y + aY, z + aZ)) if (block.isLeaves(world, x + aX, y + aY, z + aZ))
{ {
if (world.rand.nextInt(5) == 0) if (toolMaterial == EnumToolMaterial.IRON || toolMaterial == EnumToolMaterial.GOLD)
{
if (world.rand.nextInt(6) == 0)
{
stack.damageItem(1, entity);
}
}
else if (toolMaterial == EnumToolMaterial.EMERALD)
{
if (world.rand.nextInt(7) == 0)
{
stack.damageItem(1, entity);
}
}
else if (toolMaterial == BOPItems.EnumToolMaterialAmethyst)
{
if (world.rand.nextInt(8) == 0)
{
stack.damageItem(1, entity);
}
}
else if (world.rand.nextInt(4) == 0)
{ {
stack.damageItem(1, entity); stack.damageItem(1, entity);
} }
@ -203,10 +245,31 @@ public class ItemBOPScythe extends Item
if (block != null) if (block != null)
{ {
if (world.rand.nextInt(7) == 0) if (toolMaterial == EnumToolMaterial.IRON || toolMaterial == EnumToolMaterial.GOLD)
{ {
stack.damageItem(1, entity); if (world.rand.nextInt(8) == 0)
} {
stack.damageItem(1, entity);
}
}
else if (toolMaterial == EnumToolMaterial.EMERALD)
{
if (world.rand.nextInt(9) == 0)
{
stack.damageItem(1, entity);
}
}
else if (toolMaterial == BOPItems.EnumToolMaterialAmethyst)
{
if (world.rand.nextInt(10) == 0)
{
stack.damageItem(1, entity);
}
}
else if (world.rand.nextInt(5) == 0)
{
stack.damageItem(1, entity);
}
if (block.blockID == Blocks.foliage.get().blockID && (meta == 1 || meta == 2 || meta == 6)) if (block.blockID == Blocks.foliage.get().blockID && (meta == 1 || meta == 2 || meta == 6))
{ {