Skip to content

Commit

Permalink
Fix errors on world load when adding TCon to a world (Thx skyboy)
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Feb 21, 2015
1 parent dfa8341 commit 8de3882
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/tconstruct/armor/player/KnapsackInventory.java
Expand Up @@ -144,6 +144,10 @@ public void saveToNBT (NBTTagCompound tagCompound)

public void readFromNBT (NBTTagCompound tagCompound)
{
// player doesn't have a knapsack saved, tcon probably wasn't present before. don't error out.
if(!tagCompound.hasKey("Knapsack"))
return;

NBTTagList tagList = tagCompound.getTagList("Knapsack", 10);
for (int i = 0; i < tagList.tagCount(); ++i)
{
Expand Down

0 comments on commit 8de3882

Please sign in to comment.