mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Try this coolty
This commit is contained in:
@ -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();
|
||||
}
|
||||
});
|
||||
|
@ -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<>();
|
||||
|
@ -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)) {
|
||||
|
Reference in New Issue
Block a user