From b58ea4369dc090c993d4ac00f308594011fa7c37 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Wed, 10 Jul 2013 10:23:44 +1000 Subject: [PATCH] Made the chance of scythes getting damaged related to their material --- .../biomesoplenty/items/ItemBOPScythe.java | 81 ++++++++++++++++--- 1 file changed, 72 insertions(+), 9 deletions(-) diff --git a/src/minecraft/biomesoplenty/items/ItemBOPScythe.java b/src/minecraft/biomesoplenty/items/ItemBOPScythe.java index ef8487c1d..4537e9c0d 100644 --- a/src/minecraft/biomesoplenty/items/ItemBOPScythe.java +++ b/src/minecraft/biomesoplenty/items/ItemBOPScythe.java @@ -118,10 +118,31 @@ public class ItemBOPScythe extends Item if (block != null) { - if (world.rand.nextInt(6) == 0) - { - stack.damageItem(1, entity); - } + if (toolMaterial == EnumToolMaterial.IRON || toolMaterial == EnumToolMaterial.GOLD) + { + 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)) { @@ -174,7 +195,28 @@ public class ItemBOPScythe extends Item { 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); } @@ -203,10 +245,31 @@ public class ItemBOPScythe extends Item if (block != null) { - if (world.rand.nextInt(7) == 0) - { - stack.damageItem(1, entity); - } + if (toolMaterial == EnumToolMaterial.IRON || toolMaterial == EnumToolMaterial.GOLD) + { + 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)) {