public void returnDepositInVault(UUID uuid) { Player p = CompatUtils.getPlayer(uuid); double deposit = getDepositInVault(uuid); if (deposit <= 0) return; Main.economy.depositPlayer(p, deposit); removeDepositFromVault(uuid); }
public void returnDeposit(Lot lot) { for (Entry<UUID, Double> e : getDeposit(lot).entrySet()) { Player p = CompatUtils.getPlayer(e.getKey()); if (p != null) { Main.economy.depositPlayer(p, e.getValue()); } else { addDepositToVault(e.getKey(), e.getValue()); } } }
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); }