Knapsack/extended slots tick updates

- Fixed a null pointer exception
- Clean up imports in GlassBlock(accidental)
- Made the extended armor slots tick and armor tick items
- Made the knapsack tick items
This commit is contained in:
Arthur Uzulin committed 2013-12-14 14:11:41 +11:00
1 parent 22c99c80dd
commit f8450e4a31
4 files changed
+47 -4

No files matched your search

@@ -1,5 +1,11 @@
package tconstruct.items.armor;
import tconstruct.TConstruct;
import tconstruct.util.player.*;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
import java.util.List;
import tconstruct.items.CraftingItem;
@@ -29,5 +35,20 @@ public class Knapsack extends CraftingItem
break;
}
}
@Override
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack)
{
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username);
KnapsackInventory inv = stats.knapsack;
if (stats != null && inv != null) {
for(int i = 0; i < inv.getSizeInventory(); i++){
if(inv.getStackInSlot(i) != null){
inv.getStackInSlot(i).getItem().onUpdate(inv.getStackInSlot(i), player.worldObj, player, i, false);
}
}
}
}
}