Fixing NullPointerException

Will not throw NPE when other mods muck with gold armor anymore.
This commit is contained in:
Jeremy Diamond committed 2014-05-13 03:06:27 -07:00
1 parent ad5defb1a9
commit bd92f19615
1 file changed
+19 -10
+19 -10
View File
@@ -92,25 +92,34 @@ public class DarkAspects
ThaumcraftApi.registerObjectTag(Block.tnt.blockID, 0, list);
list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.helmetGold));
list.add(PRIDE, 2);
ThaumcraftApi.registerObjectTag(Item.helmetGold.itemID, -1, list);
if(list != null){
list.add(PRIDE, 2);
ThaumcraftApi.registerObjectTag(Item.helmetGold.itemID, -1, list);
}
list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.plateGold));
list.add(PRIDE, 1);
ThaumcraftApi.registerObjectTag(Item.plateGold.itemID, -1, list);
if(list != null){
list.add(PRIDE, 1);
ThaumcraftApi.registerObjectTag(Item.plateGold.itemID, -1, list);
}
list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.legsGold));
list.add(PRIDE, 1);
ThaumcraftApi.registerObjectTag(Item.legsGold.itemID, -1, list);
if(list != null){
list.add(PRIDE, 1);
ThaumcraftApi.registerObjectTag(Item.legsGold.itemID, -1, list);
}
list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.bootsGold));
list.add(PRIDE, 1);
ThaumcraftApi.registerObjectTag(Item.bootsGold.itemID, -1, list);
if(list != null){
list.add(PRIDE, 1);
ThaumcraftApi.registerObjectTag(Item.bootsGold.itemID, -1, list);
}
list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.swordGold));
if(list != null)
if(list != null){
list.add(PRIDE, 2);
ThaumcraftApi.registerObjectTag(Item.swordGold.itemID, -1, list);
ThaumcraftApi.registerObjectTag(Item.swordGold.itemID, -1, list);
}
//list = ThaumcraftApiHelper.getObjectAspects(new ItemStack(Item.bed));
//list.add(SLOTH, 4);