The API for Economy has been rebuilt. - - Class renamed: net.t2code.lib.Spigot.Lib.vault.Vault -> net.t2code.lib.Spigot.Lib.eco.Eco - Methods renamed: - buy(String prefix, Player p, Double price) -> moneyRemove(String prefix, Player player, Double price) - addMoney(String prefix, Player p, Double price) -> moneyAdd(String prefix, Player player, Double price) - New methods: - itemRemove(Player player, String item, int amount) - itemAdd(Player player, String item, int amount) - votePointsRemove(String prefix, Player player, Integer amount) (for VotingPlugin) - votePointsAdd(String prefix, Player player, Integer amount) (for VotingPlugin) - VotingPlugin added to PluginCheck
39 lines
1.5 KiB
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;
|
|
}
|
|
}
|