Skip to content

Commit

Permalink
Merge pull request #20 from Grubnest/feature-mysql-basics
Browse files Browse the repository at this point in the history
Velocity MySQL Interaction
  • Loading branch information
Wyzards authored May 23, 2022
2 parents eb95add + 81f7db7 commit a85a2db
Show file tree
Hide file tree
Showing 15 changed files with 382 additions and 226 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.idea/
/target/
/*.iml
/dependency-reduced-pom.xml
19 changes: 19 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -93,5 +107,10 @@
<version>5.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.29</version>
</dependency>
</dependencies>
</project>

This file was deleted.

55 changes: 0 additions & 55 deletions src/main/java/com/grubnest/game/core/DatabaseHandler/MySQL.java

This file was deleted.

This file was deleted.

21 changes: 16 additions & 5 deletions src/main/java/com/grubnest/game/core/GrubnestCorePlugin.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.grubnest.game.core;

import com.grubnest.game.core.DatabaseHandler.MySQL;
import com.grubnest.game.core.DatabaseHandler.MySQLData;
import com.grubnest.game.core.DatabaseHandler.Utils.Disabler;
import com.grubnest.game.core.databasehandler.MySQL;
import com.grubnest.game.core.databasehandler.MySQLData;
import com.grubnest.game.core.databasehandler.utils.Disabler;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

public class GrubnestCorePlugin extends JavaPlugin {
Expand All @@ -21,9 +22,18 @@ public void onEnable() {
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new PluginMessage());

getServer().getConsoleSender().sendMessage(ChatColor.AQUA + "GrubnestCore is Enabled");

loadConfig();
this.sql = new MySQL(dataInitializer());
}

/**
* Loads the config and enables copying defaults
*/
public void loadConfig() {
getConfig().options().copyDefaults(true);
saveConfig();
sql = new MySQL(dataInitializer());
}

/**
Expand All @@ -44,7 +54,7 @@ public void onDisable() {
*/
private MySQLData dataInitializer() {
String host = getConfig().getString("Database.hostname");
String port = getConfig().getString("Database.port");
int port = getConfig().getInt("Database.port");
String database = getConfig().getString("Database.database");
String username = getConfig().getString("Database.username");
String password = getConfig().getString("Database.password");
Expand Down Expand Up @@ -72,4 +82,5 @@ public MySQL getMySQL() {
public static GrubnestCorePlugin getInstance() {
return instance;
}

}
39 changes: 0 additions & 39 deletions src/main/java/com/grubnest/game/core/Velocity/VelocityPlugin.java

This file was deleted.

Loading

0 comments on commit a85a2db

Please sign in to comment.