Remove obsolete economy methods in main plugin class.
These were made obsolete when the special ItemStack type ID of -29 was refactored away.
This commit is contained in:
@@ -18,7 +18,6 @@ import org.bukkit.configuration.InvalidConfigurationException;
|
|||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
@@ -300,14 +299,6 @@ public class MobArena extends JavaPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean giveMoney(Player p, ItemStack item) {
|
|
||||||
if (economy != null) {
|
|
||||||
EconomyResponse result = economy.depositPlayer(p, getAmount(item));
|
|
||||||
return (result.type == ResponseType.SUCCESS);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean giveMoney(Player p, double amount) {
|
public boolean giveMoney(Player p, double amount) {
|
||||||
if (economy != null) {
|
if (economy != null) {
|
||||||
EconomyResponse result = economy.depositPlayer(p, amount);
|
EconomyResponse result = economy.depositPlayer(p, amount);
|
||||||
@@ -316,10 +307,6 @@ public class MobArena extends JavaPlugin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean takeMoney(Player p, ItemStack item) {
|
|
||||||
return takeMoney(p, getAmount(item));
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean takeMoney(Player p, double amount) {
|
public boolean takeMoney(Player p, double amount) {
|
||||||
if (economy != null) {
|
if (economy != null) {
|
||||||
EconomyResponse result = economy.withdrawPlayer(p, amount);
|
EconomyResponse result = economy.withdrawPlayer(p, amount);
|
||||||
@@ -328,28 +315,14 @@ public class MobArena extends JavaPlugin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasEnough(Player p, ItemStack item) {
|
|
||||||
return hasEnough(p, getAmount(item));
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasEnough(Player p, double amount) {
|
public boolean hasEnough(Player p, double amount) {
|
||||||
return economy == null || (economy.getBalance(p) >= amount);
|
return economy == null || (economy.getBalance(p) >= amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String economyFormat(ItemStack item) {
|
|
||||||
return economyFormat(getAmount(item));
|
|
||||||
}
|
|
||||||
|
|
||||||
public String economyFormat(double amount) {
|
public String economyFormat(double amount) {
|
||||||
return economy == null ? null : economy.format(amount);
|
return economy == null ? null : economy.format(amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getAmount(ItemStack item) {
|
|
||||||
double major = item.getAmount();
|
|
||||||
double minor = item.getDurability() / 100D;
|
|
||||||
return major + minor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Messenger getGlobalMessenger() {
|
public Messenger getGlobalMessenger() {
|
||||||
return messenger;
|
return messenger;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user