Permalink
Browse files

Check max durability in block drops.

  • Loading branch information...
me4502 committed Oct 22, 2016
1 parent 5d0ae1d commit 05cce7a9cd49e95bb1b43c7a20cbc54afb116746
@@ -123,7 +123,7 @@ public static Location getBlockCentre(Block block) {
drops.add(new ItemStack(Material.INK_SACK, 3, (short) 3));
break;
default:
- if(tool == null)
+ if(tool == null || ItemUtil.getMaxDurability(tool.getType()) > 0)
drops.addAll(block.getDrops());
else
drops.addAll(block.getDrops(tool));
@@ -678,9 +678,7 @@ public static ItemStack makeItemValid(ItemStack invalid) {
* @return
*/
public static short getMaxDurability(Material type) {
-
switch(type) {
-
case DIAMOND_AXE:
case DIAMOND_HOE:
case DIAMOND_PICKAXE:
@@ -711,8 +709,15 @@ public static short getMaxDurability(Material type) {
case GOLD_SPADE:
case GOLD_SWORD:
return 33;
+ case SHEARS:
+ return 238;
+ case FLINT_AND_STEEL:
+ case FISHING_ROD:
+ return 65;
+ case SHIELD:
+ return 337;
default:
- return 0;
+ return type.getMaxDurability();
}
}

0 comments on commit 05cce7a

Please sign in to comment.