public void setPowertool(ItemType mat, List<String> cmds) {
   JsonConfig data = getPlayerConfig();
   if (pts == null) {
     pts = new HashMap<>();
     if (data.contains("powertool")) {
       for (String s : data.listKeys("powertool", false)) {
         ArrayList<String> l = (ArrayList<String>) data.getStringList("powertool." + s);
         pts.put(ItemDatabase.getItem(s).getItem(), l);
       }
     }
   }
   pts.put(mat, cmds);
   data.set("powertool." + mat.toString(), cmds);
   data.save();
   save();
 }
Beispiel #2
0
 public Builder add(ItemType type, int qty) {
   qty = qty < 0 ? 1 : qty;
   inventory.add(
       new Pair<>(type, qty <= type.getMaxStackQuantity() ? qty : type.getMaxStackQuantity()));
   return this;
 }
Beispiel #3
0
 public Builder add(ItemType type) {
   inventory.add(new Pair<>(type, type.getMaxStackQuantity()));
   return this;
 }