mirror of
https://github.com/SimplexDevelopment/Traverse.git
synced 2025-07-03 16:16:41 +00:00
Code push
This commit is contained in:
37
src/main/java/mc/unraveled/reforged/plugin/Traverse.java
Normal file
37
src/main/java/mc/unraveled/reforged/plugin/Traverse.java
Normal file
@ -0,0 +1,37 @@
|
||||
package mc.unraveled.reforged.plugin;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import mc.unraveled.reforged.permission.Rank;
|
||||
import mc.unraveled.reforged.storage.DBConnectionHandler;
|
||||
import mc.unraveled.reforged.storage.DBGroup;
|
||||
import mc.unraveled.reforged.storage.DBProperties;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public final class Traverse extends JavaPlugin {
|
||||
|
||||
private DBConnectionHandler handler;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
initDatabaseGroups();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
private void initDatabaseGroups() {
|
||||
handler = new DBConnectionHandler(new DBProperties("groups.properties"));
|
||||
DBGroup groupHandler = new DBGroup(handler.establish());
|
||||
Arrays.stream(Rank.values()).forEach(groupHandler::createTable);
|
||||
groupHandler.close();
|
||||
}
|
||||
|
||||
public DBConnectionHandler getSQLManager() {
|
||||
return handler;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user