Browse Source

refactoring: Pulled the actual using of the item into its own function

remotes/origin/fight-engine
fdai7430 2 years ago
parent
commit
1033a02a29
  1. 8
      src/main/java/org/bitbiome/commands/UseCommand.java

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

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