public void removeDepositFromVault(UUID uuid, double deposit) {
   String path =
       new StringBuilder(51)
           .append("vaults.")
           .append(uuid.toString())
           .append('.')
           .append("deposit")
           .toString();
   double original = data.getYamlConfig().getDouble(path, 0);
   double newDeposit = original - deposit;
   if (newDeposit <= 0) {
     data.set(path, null);
   } else {
     data.set(path, newDeposit);
   }
 }
 public void addDeposit(Lot lot, Player p, double deposit) {
   String depositPath =
       new StringBuilder(86)
           .append("lots.")
           .append(lot.getUuid())
           .append(".deposit.")
           .append(p.getUniqueId())
           .toString();
   data.set(depositPath, data.getYamlConfig().getDouble(depositPath, 0) + deposit);
 }
 public void removeDepositFromVault(UUID uuid) {
   String path =
       new StringBuilder(51)
           .append("vaults.")
           .append(uuid.toString())
           .append('.')
           .append("deposit")
           .toString();
   data.set(path, null);
 }
 public void setLastBid(Player p, Lot lot, long lastBid) {
   String lastBidPath =
       new StringBuilder(90)
           .append("lots.")
           .append(lot.getUuid())
           .append(".bid.lastBid.")
           .append(p.getUniqueId())
           .toString();
   data.set(lastBidPath, lastBid);
 }
 public void addDepositToVault(UUID uuid, double deposit) {
   String path =
       new StringBuilder(51)
           .append("vaults.")
           .append(uuid.toString())
           .append('.')
           .append("deposit")
           .toString();
   double original = data.getYamlConfig().getDouble(path, 0);
   data.set(path, original + deposit);
 }
  public void hammer(Lot lot) {

    UUID buyerUuid = lot.getLastBidPlayerUuid();
    Player buyer = CompatUtils.getPlayer(buyerUuid);
    if (null == buyer || buyer.getInventory().firstEmpty() == -1) {
      String path =
          new StringBuilder(80)
              .append("vaults.")
              .append(buyerUuid.toString())
              .append('.')
              .append(lot.getUuid())
              .toString();
      data.set(path, lot.getItem());
    } else {
      unoccupyVault(buyerUuid);
      buyer.getInventory().addItem(lot.getItem());
    }

    if (buyer != null) buyer.sendMessage(localeManager.getLocalizedString("ui.hammerBuyer"));

    Map<UUID, Double> deposit = getDeposit(lot);
    deposit.remove(buyerUuid);

    for (Entry<UUID, Double> e : deposit.entrySet()) {

      Player p = CompatUtils.getPlayer(e.getKey());

      if (null != p) {
        p.sendMessage(localeManager.getLocalizedString("ui.hammerOthers"));
        Main.economy.depositPlayer(p, e.getValue());
      } else {
        addDepositToVault(e.getKey(), e.getValue());
      }

      unoccupyVault(e.getKey());
    }

    removeLot(lot);
  }
 private void removeFromBackend(Lot lot) {
   data.set("lots." + lot.getUuid().toString(), null);
 }