Fix a crash on some machines

This commit is contained in:
SeanOMik 2020-11-02 18:08:54 -06:00
parent 90b565131a
commit 9ef4aafb55
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
3 changed files with 6 additions and 7 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.seanomik</groupId>
<artifactId>tamablefoxes</artifactId>
<version>1.7.8-SNAPSHOT</version>
<version>1.7.9-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Tamablefoxes</name>

View File

@ -15,8 +15,8 @@ import org.bukkit.plugin.java.JavaPlugin;
// @TODO:
/* @CHANGELOG (1.7.8-SNAPSHOT):
* Add a permission to allow players to bypass the tame limit.
/* @CHANGELOG (1.7.9-SNAPSHOT):
* Fix some crashes and errors with the sqlite database failing to be found.
*/
public final class TamableFoxes extends JavaPlugin implements Listener {
private static TamableFoxes plugin;

View File

@ -1,5 +1,6 @@
package net.seanomik.tamablefoxes.io.sqlite;
import net.seanomik.tamablefoxes.TamableFoxes;
import org.bukkit.Bukkit;
import java.sql.Connection;
@ -21,10 +22,8 @@ public class SQLiteHandler {
public void connect() {
try {
String baseLoc = Bukkit.getWorldContainer().toURI().toString().substring(6);
baseLoc = baseLoc.substring(0,baseLoc.length()-2);
String url = "jdbc:sqlite:" + baseLoc + "plugins/Tamablefoxes/userFoxAmount.db";
String pluginFolder = TamableFoxes.getPlugin().getDataFolder().getAbsolutePath();
String url = "jdbc:sqlite:" + pluginFolder + "/userFoxAmount.db";
connection = DriverManager.getConnection(url);
} catch (SQLException e) {