T2CodeLib/src/main/java/net/t2code/lib/Spigot/Lib/vault/Vault.java

39 lines
1.5 KiB
Java

package net.t2code.lib.Spigot.Lib.vault;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.system.Main;
import net.t2code.lib.Spigot.system.languages.SelectLibMsg;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class Vault {
public static Boolean vaultEnable;
public static boolean buy(String prefix, Player p, Double price) {
if (Main.eco == null) {
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
send.console(prefix + " §4\n" + prefix + " §4Vault could not be found! §9Please download it here: " +
"§6https://www.spigotmc.org/resources/vault.34315/§4\n" + prefix);
}
p.sendMessage(prefix + "\n" + SelectLibMsg.vaultNotSetUp + "\n" + prefix);
} else {
return Main.eco.withdrawPlayer(p,price).transactionSuccess();
}
return false;
}
public static boolean addMoney(String prefix, Player p, Double price) {
if (Main.eco == null) {
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
send.console(prefix + " §4\n" + prefix + " §4Vault could not be found! §9Please download it here: " +
"§6https://www.spigotmc.org/resources/vault.34315/§4\n" + prefix);
}
p.sendMessage(prefix + "\n" + SelectLibMsg.vaultNotSetUp + "\n" + prefix);
} else {
return Main.eco.depositPlayer(p,price).transactionSuccess();
}
return false;
}
}