Skip to content

Commit

Permalink
Sale dupe
Browse files Browse the repository at this point in the history
  • Loading branch information
MinecraftDorado committed May 8, 2021
1 parent a714815 commit fd7c864
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ private void invClick(InventoryClickEvent e) {
Config.sendMessage("command.sell.message", p);
p.getInventory().removeItem(Sales.getItemStack(uuid));
p.closeInventory();

Sales.setItemStack(uuid, null);
Sales.setPrice(uuid, 0);
}else
Config.sendMessage("command.sell.error_limit", p);
}else
Expand Down Expand Up @@ -91,9 +94,9 @@ private void chat(AsyncPlayerChatEvent e) {
double value = Double.parseDouble(s);

if(value >= Config.getMinimumPrice()) {
list.remove(p.getUniqueId());
Sales.setPrice(p.getUniqueId(), value);
Bukkit.getScheduler().runTask(MainClass.main, () -> InventoryManager.openInventory(p, Sales.getInventory(p)));
list.remove(p.getUniqueId());
}else
p.sendMessage(Config.getMessage("command.sell.error_minimum_price").replace("%price%", Config.getMinimumPrice() + ""));
}catch (Exception ex) {
Expand Down

0 comments on commit fd7c864

Please sign in to comment.