Actually make API class a singleton

(Don't know what I even thought earlier)
This commit is contained in:
Eric 2018-08-02 23:02:09 +02:00
parent 35e1d50c25
commit 7e0ba6d8e7

View File

@ -6,6 +6,15 @@ import lombok.experimental.Delegate;
public class WorldGuardWrapper implements IWorldGuardImplementation {
private static WorldGuardWrapper instance;
public static WorldGuardWrapper getInstance() {
if (instance == null) {
instance = new WorldGuardWrapper();
}
return instance;
}
@Delegate
private IWorldGuardImplementation delegate;
@ -19,8 +28,4 @@ public class WorldGuardWrapper implements IWorldGuardImplementation {
}
}
public WorldGuardWrapper getInstance() {
return this;
}
}