mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Move the caching and static accessors from EconHandler to PlotMain
This commit is contained in:

committed by
Alexander Söderberg

parent
38425a1eae
commit
9c3d2cfb02
@ -178,6 +178,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain<
|
||||
@Getter private BackupManager backupManager;
|
||||
@Getter private PlatformWorldManager<World> worldManager;
|
||||
private final BukkitPlayerManager playerManager = new BukkitPlayerManager();
|
||||
private EconHandler econ;
|
||||
|
||||
@Override public int[] getServerVersion() {
|
||||
if (this.version == null) {
|
||||
@ -902,8 +903,16 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain<
|
||||
}
|
||||
|
||||
@Override public EconHandler getEconomyHandler() {
|
||||
if (econ != null) {
|
||||
if (econ.init() /* is inited*/) {
|
||||
return econ;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
BukkitEconHandler econ = new BukkitEconHandler();
|
||||
econ = new BukkitEconHandler();
|
||||
if (econ.init()) {
|
||||
return econ;
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ public class BukkitEconHandler extends EconHandler {
|
||||
private Economy econ;
|
||||
private Permission perms;
|
||||
|
||||
@Override
|
||||
public boolean init() {
|
||||
if (this.econ == null || this.perms == null) {
|
||||
setupPermissions();
|
||||
|
Reference in New Issue
Block a user