Tidier implementation of previous commit. Should fix for subclasses of individual tools too

This commit is contained in:
Christian committed 2013-12-27 21:48:42 -05:00
1 parent 78b1b54e2b
commit cf3447feea
2 files changed
+39 -23

No files matched your search

@@ -152,20 +152,17 @@ public class ForgeHooks
toolInit = true;
Set<Block> blocks = ReflectionHelper.getPrivateValue(ItemPickaxe.class, null, 0);
setHarvestForItem(Arrays.asList(Items.wooden_pickaxe, Items.stone_pickaxe, Items.iron_pickaxe, Items.diamond_pickaxe), "pickaxe");
for (Block block : blocks)
{
block.setHarvestLevel("pickaxe", 0);
}
setHarvestForItem(Arrays.asList(Items.wooden_shovel, Items.stone_shovel, Items.iron_shovel, Items.diamond_shovel), "shovel");
blocks = ReflectionHelper.getPrivateValue(ItemSpade.class, null, 0);
for (Block block : blocks)
{
block.setHarvestLevel("shovel", 0);
}
setHarvestForItem(Arrays.asList(Items.wooden_axe, Items.stone_axe, Items.iron_axe, Items.diamond_axe), "axe");
blocks = ReflectionHelper.getPrivateValue(ItemAxe.class, null, 0);
for (Block block : blocks)
{
@@ -183,15 +180,6 @@ public class ForgeHooks
Blocks.lapis_block.setHarvestLevel("pickaxe", 1);
}
private static void setHarvestForItem(List<Item> itemList, String toolClass)
{
for (int i = 0; i < itemList.size(); i++)
{
Item item = itemList.get(i);
item.setHarvestLevel("pickaxe", i);
}
}
public static int getTotalArmorValue(EntityPlayer player)
{
int ret = 0;