We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc08e64 commit c7668c1Copy full SHA for c7668c1
1 file changed
src/main/java/com/hiddentech/playerstorage/PlayerStorageAPI.java
@@ -55,8 +55,9 @@ public PlayerRegistry getRegistry() {
55
}
56
57
private final PlayerRegistry registry;
58
+ private static PlayerStorageAPI instance;
59
- public PlayerStorageAPI(JavaPlugin plugin) {
60
+ private PlayerStorageAPI(JavaPlugin plugin) {
61
this.plugin = plugin;
62
this.registry = new PlayerRegistry(this);
63
new PlayerJoinListener(this);
@@ -79,6 +80,12 @@ public PlayerStorageAPI(JavaPlugin plugin) {
79
80
});
81
82
83
+ public PlayerStorageAPI getInstance(JavaPlugin plugin){
84
+ if(instance==null){
85
+ instance = new PlayerStorageAPI(plugin);
86
+ }
87
+ return instance;
88
89
90
private void enableMongo(boolean mongoEnabled) {
91
File file = new File(getPlugin().getDataFolder() + "/Database.yml");
0 commit comments