This commit is contained in:
boy0001 2015-07-28 04:06:20 +10:00
parent 8344903c50
commit cf10c609a9
2 changed files with 12 additions and 2 deletions

View File

@ -1,12 +1,18 @@
package com.intellectualcrafters.plot.util;
import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
public abstract class EconHandler {
public static EconHandler manager;
public abstract double getMoney(PlotPlayer player);
public double getMoney(PlotPlayer player) {
if (ConsolePlayer.isConsole(player)) {
return Double.MAX_VALUE;
}
return Double.NaN;
}
public abstract void withdrawMoney(PlotPlayer player, double amount);
public abstract void depositMoney(PlotPlayer player, double amount);
public abstract void depositMoney(OfflinePlotPlayer player, double amount);

View File

@ -43,7 +43,11 @@ public class BukkitEconHandler extends EconHandler {
@Override
public double getMoney(PlotPlayer player) {
return econ.getBalance(player.getName());
double bal = super.getMoney(player);
if (bal == Double.NaN) {
return econ.getBalance(player.getName());
}
return bal;
}
@Override