The Erebus

The Erebus

16M Downloads

Exception on startup (ItemErebusFood.java)

clubpetey opened this issue ยท 1 comments

commented

I get the following crash/exception on startup

Exception caught during firing event net.minecraftforge.event.AttachCapabilitiesEvent@68ff19fd:
java.lang.ArrayIndexOutOfBoundsException: 20
	at erebus.items.ItemErebusFood.getContainerItem(ItemErebusFood.java:120) ~[ItemErebusFood.class:?]
	at erebus.items.ItemErebusFood.hasContainerItem(ItemErebusFood.java:137) ~[ItemErebusFood.class:?]
	at erebus.items.ItemErebusFood.getItemStackLimit(ItemErebusFood.java:142) ~[ItemErebusFood.class:?]
	at net.minecraft.item.ItemStack.func_77976_d(ItemStack.java:248) ~[aip.class:?]

The error seems to be in ItemErebusFood.java:118

if(stack.getItemDamage() > EnumFoodType.values().length) return ItemStack.EMPTY;

should be
if(stack.getItemDamage() >= EnumFoodType.values().length) return ItemStack.EMPTY;

commented

๐Ÿ‘