From 8dce5927879cc42d2034e6da17acad3337b8ffeb Mon Sep 17 00:00:00 2001 From: Nicholas Ignoffo Date: Fri, 23 Mar 2018 17:12:32 -0700 Subject: [PATCH] Fix out of bounds on invalid enum items --- src/main/java/WayofTime/bloodmagic/item/ItemEnum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemEnum.java b/src/main/java/WayofTime/bloodmagic/item/ItemEnum.java index e949e446..0fed5b36 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemEnum.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemEnum.java @@ -42,7 +42,7 @@ public class ItemEnum & ISubItem> extends Item { } public T getItemType(ItemStack stack) { - return types[MathHelper.clamp(stack.getItemDamage(), 0, types.length)]; + return types[MathHelper.clamp(stack.getItemDamage(), 0, types.length - 1)]; } public static class Variant & ISubItem> extends ItemEnum implements IVariantProvider {