From c8c49fa551a4c5867a43d4b13aa4d5d78dfe87dd Mon Sep 17 00:00:00 2001 From: My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> Date: Sat, 5 Dec 2020 21:15:31 -0500 Subject: Fix out of bound exception Added size check for pattern --- src/main/java/me/Danker/DankersSkyblockMod.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 620f6dc..174581d 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -2880,7 +2880,7 @@ public class DankersSkyblockMod if (ToggleCommand.chronomatronToggled && inventoryName.startsWith("Chronomatron (")) { if (inventory.getStackInSlot(49).getDisplayName().startsWith("§7Timer: §a") && (item == null || item.getItem() == Item.getItemFromBlock(Blocks.stained_glass) || item.getItem() == Item.getItemFromBlock(Blocks.stained_hardened_clay))) { - if(!item.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { + if(chronomatronPattern.size() > 0 && !item.getDisplayName().equals(chronomatronPattern.get(chronomatronMouseClicks))) { if(event.isCancelable() && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && !Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) event.setCanceled(true); return; } -- cgit