Browse Source

Created function for getting name of item from command argument

remotes/origin/fight-engine
fdai7430 2 years ago
parent
commit
5a95b33878
  1. 9
      src/main/java/org/bitbiome/commands/UseCommand.java

9
src/main/java/org/bitbiome/commands/UseCommand.java

@ -9,11 +9,16 @@ public class UseCommand implements CommandAPI {
} }
private String getUseMessage(String msg) { private String getUseMessage(String msg) {
String message[] = msg.split(" on ");
return useItem(message[0], message[1]);
String item = getItemName(msg);
String target = msg.replaceFirst(item + " on ", "");
return useItem(item, target);
} }
private String useItem(String item, String target) { private String useItem(String item, String target) {
return "You used " + item + " on " + target; return "You used " + item + " on " + target;
} }
private String getItemName(String msg) {
return "";
}
} }
Loading…
Cancel
Save