diff --git a/pom.xml b/pom.xml index 1fba3a2..504e1ce 100644 --- a/pom.xml +++ b/pom.xml @@ -60,9 +60,20 @@ spigot-repo https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + papermc + https://repo.papermc.io/repository/maven-public/ + + + com.velocitypowered + velocity-api + 3.0.1 + provided + org.spigotmc spigot-api diff --git a/src/main/java/com/grubnest/game/core/GrubnestCorePlugin.java b/src/main/java/com/grubnest/game/core/GrubnestCorePlugin.java index 7acf009..bfa8b42 100644 --- a/src/main/java/com/grubnest/game/core/GrubnestCorePlugin.java +++ b/src/main/java/com/grubnest/game/core/GrubnestCorePlugin.java @@ -6,8 +6,10 @@ import org.bukkit.plugin.java.JavaPlugin; public class GrubnestCorePlugin extends JavaPlugin { + private MySQL sql; private static GrubnestCorePlugin instance; + /** * Runs when plugin is enabled */ @@ -37,9 +39,10 @@ public void onDisable() { /** * Initialize data from config.yml + * * @return MySQLData */ - private MySQLData dataInitializer(){ + private MySQLData dataInitializer() { String host = getConfig().getString("Database.hostname"); String port = getConfig().getString("Database.port"); String database = getConfig().getString("Database.database"); @@ -49,22 +52,24 @@ private MySQLData dataInitializer(){ int minimumConnections = getConfig().getInt("Database.minimumConnections"); int maximumConnections = getConfig().getInt("Database.maximumConnections"); long connectionTimeout = getConfig().getLong("Database.connectionTimeout"); - return new MySQLData(host,username,password,port,database,minimumConnections,maximumConnections,connectionTimeout); + return new MySQLData(host, username, password, port, database, minimumConnections, maximumConnections, connectionTimeout); } /** * Get SQL Object + * * @return SQL object */ - public MySQL getMySQL(){ + public MySQL getMySQL() { return sql; } /** * Get Plugin Instance + * * @return Plugin Instance */ - public static GrubnestCorePlugin getInstance(){ + public static GrubnestCorePlugin getInstance() { return instance; } } diff --git a/src/main/java/com/grubnest/game/core/Velocity/VelocityPlugin.java b/src/main/java/com/grubnest/game/core/Velocity/VelocityPlugin.java new file mode 100644 index 0000000..026cfc0 --- /dev/null +++ b/src/main/java/com/grubnest/game/core/Velocity/VelocityPlugin.java @@ -0,0 +1,39 @@ +package com.grubnest.game.core.Velocity; + +import com.google.inject.Inject; +import com.velocitypowered.api.plugin.Plugin; +import com.velocitypowered.api.proxy.ProxyServer; +import net.kyori.adventure.text.Component; +import org.slf4j.Logger; + +/** + * The VelocityPlugin class is an implementation of the Velocity API. + * It provides communication to and from the Velocity Proxy server + * running on the Grubnest network + *

+ * Date: 5/20/2022 + * Authors: Theeef + */ +@Plugin(id = "grubnestcore", name = "Grubnest Core Plugin", version = "0.1.0-SNAPSHOT", + url = "htts://grubnest.com", description = "Grubnest Core running on Velocity", authors = {"Theeef"}) +public class VelocityPlugin { + + private final ProxyServer server; + private final Logger logger; + + + /** + * Creates an instance of the Velocity Plugin and injects it + * + * @param server The velocity proxy server + * @param logger The proxy server's logger + */ + @Inject + public VelocityPlugin(ProxyServer server, Logger logger) { + this.server = server; + this.logger = logger; + + this.server.sendMessage(Component.text("GrubnestCore is enabled on Velocity!")); + } + +}