Skip to content

Commit

Permalink
update research goal resources/parsing -- fixes crash issues related to
Browse files Browse the repository at this point in the history
improperly specified items (need domain name with item)
  • Loading branch information
shadowmage45 committed Sep 19, 2014
1 parent 28b632f commit 0d872b6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.Set;

import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -194,13 +195,19 @@ private static void parseGoalResources(List<String> lines)
itemName = split[1];
meta = StringTools.safeParseInt(split[2]);
qty = StringTools.safeParseInt(split[3]);
AWLog.logDebug("parsed item resource for research: "+name + " item: "+itemName + " qty: "+qty + " meta: "+meta);
if(!goalsByName.containsKey(name)){continue;}
if(!goalsByName.containsKey(name))
{
throw new RuntimeException("Could not locate goal for name: "+name);
}
item = (Item) Item.itemRegistry.getObject(itemName);
if(item==null)
{
block = (Block) Block.blockRegistry.getObject(itemName);
if(block!=null)
if(block==null || block==Blocks.air)
{
throw new RuntimeException("Could not locate item for name: "+itemName);
}
else
{
stack = new ItemStack(block, qty, meta);
goalsByName.get(name).addResource(stack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ combustion,coal,1,8
combustion,iron_ingot,0,5
combustion,netherrack,0,12
chemistry,redstone,0,32
chemistry,lapis,0,16
chemistry,dye,4,16
chemistry,gold_ingot,0,2
chemistry,netherrack,0,8
theory_of_gravity,iron_ingot,0,8
Expand All @@ -73,7 +73,7 @@ theory_of_gravity,book,0,1
theory_of_gravity,apple,0,1
seafaring,planks,0,12
seafaring,iron_ingot,0,8
seafaring,cloth,0,10
seafaring,wool,0,10
seafaring,string,0,12
explosives,coal,0,12
explosives,coal,1,8
Expand All @@ -83,10 +83,10 @@ refining,iron_ingot,0,12
refining,paper,0,10
refining,gold_ingot,0,2
refining,coal,0,12
machinery,steel_ingot,0,10
machinery,AncientWarfare:steel_ingot,0,10
machinery,iron_ingot,0,8
machinery,component,1,3
machinery,component,4,2
machinery,AncientWarfare:component,1,3
machinery,AncientWarfare:component,4,2
navigation,compass,0,1
navigation,map,0,1
navigation,paper,0,12
Expand All @@ -99,19 +99,19 @@ gunpowder,gunpowder,0,16
gunpowder,sand,0,12
gunpowder,coal,1,12
gunpowder,paper,0,8
mass_production,steel_ingot,0,12
mass_production,component,2,6
mass_production,component,5,3
mass_production,component,8,3
flight,cloth,0,16
mass_production,AncientWarfare:steel_ingot,0,12
mass_production,AncientWarfare:component,2,6
mass_production,AncientWarfare:component,5,3
mass_production,AncientWarfare:component,8,3
flight,wool,0,16
flight,planks,0,12
flight,string,0,12
flight,paper,0,16
naval_warfare,gunpowder,0,16
naval_warfare,planks,0,12
naval_warfare,iron_ingot,0,16
naval_warfare,paper,0,8
advanced_siege_warfare,steel_ingot,0,8
advanced_siege_warfare,AncientWarfare:steel_ingot,0,8
advanced_siege_warfare,paper,0,12
advanced_siege_warfare,planks,0,16
advanced_siege_warfare,string,0,12

0 comments on commit 0d872b6

Please sign in to comment.