Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Economy economy = null;
- @Override
- public void onEnable() {
- if (!setupEconomy()) {
- LOGGER.severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName()));
- getServer().getPluginManager().disablePlugin(this);
- return;
- }
- }
- private boolean setupEconomy() {
- if (getServer().getPluginManager().getPlugin("Vault") == null) {
- return false;
- }
- RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
- if (rsp == null) {
- return false;
- }
- economy = rsp.getProvider();
- return economy != null;
- }
- public Economy getEconomy() {
- return this.economy;
- }
- //getEconomy().has(p, count) - проверить если на указанная сумма на счёте у игрока.
- //getEconomy().depositPlayer(p, count) - положить на счёт игрока указанную сумму.
- //getEconomy().withdrawPlayer(p, count) - снять указанную сумму с счёта игрока.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement