Browse Source

refactoring: added new method writeNewItem() to collectCommand.java

remotes/origin/Julia
Juliakn66 2 years ago
parent
commit
346155ab00
  1. 7
      src/main/java/org/bitbiome/commands/CollectCommand.java

7
src/main/java/org/bitbiome/commands/CollectCommand.java

@ -42,6 +42,11 @@ public class CollectCommand implements CommandAPI {
} }
} }
} }
writeNewItem(location, getInventory, o1, inventory, i, jp, o);
}
} System.out.println("Es gibt kein Item, dass du einsammeln kannst.");
}
public void writeNewItem(ArrayList<Item> location, ArrayList<Item> getInventory, JSONObject o1, JSONArray inventory, int i, JsonParser jp, JSONObject o){
o1.put("name", location.get(i).getName()); o1.put("name", location.get(i).getName());
o1.put("doesDamage", location.get(i).doesDamage()); o1.put("doesDamage", location.get(i).doesDamage());
o1.put("damage", location.get(i).getDamage()); o1.put("damage", location.get(i).getDamage());
@ -52,8 +57,6 @@ public class CollectCommand implements CommandAPI {
getInventory.add(location.get(i)); getInventory.add(location.get(i));
location.remove(i); location.remove(i);
} }
} System.out.println("Es gibt kein Item, dass du einsammeln kannst.");
}
public void increaseAmountInPlayerConfig(JSONArray inventory, int k, JsonParser jp, JSONObject o){ public void increaseAmountInPlayerConfig(JSONArray inventory, int k, JsonParser jp, JSONObject o){
JSONObject o2 = new JSONObject(); JSONObject o2 = new JSONObject();
int amountItemsInPlayerconfig = 0; int amountItemsInPlayerconfig = 0;

Loading…
Cancel
Save