diff --git a/src/main/java/com/intellectualcrafters/plot/util/EconHandler.java b/src/main/java/com/intellectualcrafters/plot/util/EconHandler.java index 1091a4ef1..c66a162b4 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/EconHandler.java +++ b/src/main/java/com/intellectualcrafters/plot/util/EconHandler.java @@ -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); diff --git a/src/main/java/com/plotsquared/bukkit/util/bukkit/BukkitEconHandler.java b/src/main/java/com/plotsquared/bukkit/util/bukkit/BukkitEconHandler.java index 3d279c70f..4333efe12 100644 --- a/src/main/java/com/plotsquared/bukkit/util/bukkit/BukkitEconHandler.java +++ b/src/main/java/com/plotsquared/bukkit/util/bukkit/BukkitEconHandler.java @@ -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