From e58c5dc82e9f1ebb819fc0f4b75b321454ea9a8b Mon Sep 17 00:00:00 2001 From: jameslfc19 Date: Sat, 27 Jun 2020 21:22:03 +0100 Subject: [PATCH] Update AutoCraftCommand.java Fix out of bounds error in AutoCraft command. --- .../minecraft/chests/commands/AutoCraftCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/jamesdpeters/minecraft/chests/commands/AutoCraftCommand.java b/src/main/java/com/jamesdpeters/minecraft/chests/commands/AutoCraftCommand.java index f41c7c0..d77233d 100644 --- a/src/main/java/com/jamesdpeters/minecraft/chests/commands/AutoCraftCommand.java +++ b/src/main/java/com/jamesdpeters/minecraft/chests/commands/AutoCraftCommand.java @@ -76,7 +76,7 @@ public class AutoCraftCommand extends ServerCommand { if(args.length > 1){ if (player.hasPermission(Permissions.AUTOCRAFT_ADD)) { Block targetBlock = player.getTargetBlockExact(5); - if (targetBlock != null) Utils.createAutoCraftChest(player, targetBlock, args[2]); + if (targetBlock != null) Utils.createAutoCraftChest(player, targetBlock, args[1]); else Messages.MUST_LOOK_AT_CHEST(player); } else { Messages.NO_PERMISSION(player); @@ -123,7 +123,7 @@ public class AutoCraftCommand extends ServerCommand { case REMOVE: if(args.length > 1) { if (sender.hasPermission(Permissions.AUTOCRAFT_REMOVE)) { - Config.removeAutoCraft(player, args[2]); + Config.removeAutoCraft(player, args[1]); return true; } else { Messages.NO_PERMISSION(player);