mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
I'm rich
This commit is contained in:
parent
8344903c50
commit
cf10c609a9
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user