Try this coolty

This commit is contained in:
Jesse Boyd
2016-03-27 16:01:53 +11:00
parent e3f5842299
commit 1bf05df706
6 changed files with 17 additions and 6 deletions

View File

@ -264,6 +264,7 @@ public class PS {
TaskManager.runTask(new Runnable() {
@Override
public void run() {
System.out.println("SETTING UP ECON");
EconHandler.manager = PS.this.IMP.getEconomyHandler();
}
});

View File

@ -240,7 +240,7 @@ public abstract class PlotArea {
this.SCHEMATIC_FILE = config.getString("schematic.file");
this.SCHEMATIC_CLAIM_SPECIFY = config.getBoolean("schematic.specify_on_claim");
this.SCHEMATICS = config.getStringList("schematic.schematics");
this.USE_ECONOMY = config.getBoolean("economy.use") && EconHandler.manager != null;
this.USE_ECONOMY = config.getBoolean("economy.use") && EconHandler.getEconHandler() != null;
ConfigurationSection priceSection = config.getConfigurationSection("economy.prices");
if (this.USE_ECONOMY) {
this.PRICES = new HashMap<>();

View File

@ -1,5 +1,6 @@
package com.intellectualcrafters.plot.util;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.ConsolePlayer;
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
import com.intellectualcrafters.plot.object.PlotPlayer;
@ -7,6 +8,15 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
public abstract class EconHandler {
public static EconHandler manager;
private static boolean initialized;
public static EconHandler getEconHandler() {
if (initialized) {
return manager;
}
initialized = true;
return manager = PS.get().IMP.getEconomyHandler();
}
public double getMoney(PlotPlayer player) {
if (ConsolePlayer.isConsole(player)) {