hopefully improved comp with Vault eco

This commit is contained in:
Indyuce 2022-01-01 11:26:21 +01:00
parent ef80ac265d
commit d017808fac

View File

@ -1,5 +1,6 @@
package net.Indyuce.mmocore.gui.eco; package net.Indyuce.mmocore.gui.eco;
import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@ -59,7 +60,10 @@ public class DepositMenu extends PluginInventory {
if (deposit <= 0) if (deposit <= 0)
return; return;
MMOCore.plugin.economy.getEconomy().depositPlayer(player, deposit); EconomyResponse response = MMOCore.plugin.economy.getEconomy().depositPlayer(player, deposit);
if (!response.transactionSuccess())
return;
event.getInventory().clear(); event.getInventory().clear();
player.closeInventory(); player.closeInventory();
player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1, 2); player.playSound(player.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1, 2);