use of convenientadditions.api.item.IPlayerInventoryTick in project ConvenientAdditions by Necr0.
the class PlayerInventoryTickHandler method onPlayerInventoryTick.
@SubscribeEvent
public void onPlayerInventoryTick(TickEvent.PlayerTickEvent e) {
EntityPlayer player = e.player;
Iterable<SlotNotation> iter = InventoryIterator.getIterable(player, EnumInventory.MAIN);
for (SlotNotation slot : iter) {
ItemStack stack = slot.getItem();
if (stack != null && stack.getItem() instanceof IPlayerInventoryTick) {
((IPlayerInventoryTick) stack.getItem()).onPlayerInventoryTick(stack, slot, player);
;
}
}
}
Aggregations