9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-28 11:29:18 +00:00

Added SQLite and MySQL support

This commit is contained in:
HeroBrineGoat
2022-01-17 14:12:45 -05:00
parent a6c5761636
commit 3e609dac93
17 changed files with 481 additions and 60 deletions

View File

@@ -5,6 +5,8 @@ import com.comphenix.protocol.ProtocolManager;
import io.github.fisher2911.hmccosmetics.command.CosmeticsCommand;
import io.github.fisher2911.hmccosmetics.cosmetic.CosmeticManager;
import io.github.fisher2911.hmccosmetics.database.Database;
import io.github.fisher2911.hmccosmetics.database.DatabaseFactory;
import io.github.fisher2911.hmccosmetics.gui.ArmorItem;
import io.github.fisher2911.hmccosmetics.gui.CosmeticsMenu;
import io.github.fisher2911.hmccosmetics.listener.ClickListener;
@@ -34,6 +36,7 @@ public class HMCCosmetics extends JavaPlugin {
private CosmeticsMenu cosmeticsMenu;
private CommandManager commandManager;
private boolean papiEnabled;
private Database database;
@Override
public void onEnable() {
@@ -47,12 +50,16 @@ public class HMCCosmetics extends JavaPlugin {
this.cosmeticsMenu = new CosmeticsMenu(this);
this.messageHandler.load();
this.cosmeticsMenu.load();
this.registerCommands();
this.registerListeners();
this.userManager.startTeleportTask();
this.database = DatabaseFactory.create(this);
this.database.load();
this.papiEnabled = Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null;
this.registerCommands();
this.registerListeners();
}
@Override
@@ -116,6 +123,10 @@ public class HMCCosmetics extends JavaPlugin {
return protocolManager;
}
public Database getDatabase() {
return database;
}
public boolean isPapiEnabled() {
return papiEnabled;
}