From bb177c42f0d4f740d860e353b2b5ec7bf9f9b770 Mon Sep 17 00:00:00 2001 From: fdai7430 Date: Mon, 16 Jan 2023 11:32:28 +0100 Subject: [PATCH] No item or location containing " on " will exist, thus does not need to be supported --- src/main/java/org/bitbiome/commands/UseCommand.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/UseCommand.java b/src/main/java/org/bitbiome/commands/UseCommand.java index 69da5bd..a827597 100644 --- a/src/main/java/org/bitbiome/commands/UseCommand.java +++ b/src/main/java/org/bitbiome/commands/UseCommand.java @@ -9,16 +9,12 @@ public class UseCommand implements CommandAPI { } private String getUseMessage(String msg) { - String item = getItemName(msg); - String target = msg.replaceFirst(item + " on ", ""); + String item = msg.split(" on ")[0]; + String target = msg.split(" on ")[1]; return useItem(item, target); } private String useItem(String item, String target) { return "You used " + item + " on " + target; } - - private String getItemName(String msg) { - return ""; - } } \ No newline at end of file