Fix a crash on some machines
This commit is contained in:
parent
90b565131a
commit
9ef4aafb55
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<artifactId>tamablefoxes</artifactId>
|
<artifactId>tamablefoxes</artifactId>
|
||||||
<version>1.7.8-SNAPSHOT</version>
|
<version>1.7.9-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>Tamablefoxes</name>
|
<name>Tamablefoxes</name>
|
||||||
|
|
|
@ -15,8 +15,8 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
// @TODO:
|
// @TODO:
|
||||||
|
|
||||||
/* @CHANGELOG (1.7.8-SNAPSHOT):
|
/* @CHANGELOG (1.7.9-SNAPSHOT):
|
||||||
* Add a permission to allow players to bypass the tame limit.
|
* Fix some crashes and errors with the sqlite database failing to be found.
|
||||||
*/
|
*/
|
||||||
public final class TamableFoxes extends JavaPlugin implements Listener {
|
public final class TamableFoxes extends JavaPlugin implements Listener {
|
||||||
private static TamableFoxes plugin;
|
private static TamableFoxes plugin;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.seanomik.tamablefoxes.io.sqlite;
|
package net.seanomik.tamablefoxes.io.sqlite;
|
||||||
|
|
||||||
|
import net.seanomik.tamablefoxes.TamableFoxes;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
|
@ -21,10 +22,8 @@ public class SQLiteHandler {
|
||||||
|
|
||||||
public void connect() {
|
public void connect() {
|
||||||
try {
|
try {
|
||||||
String baseLoc = Bukkit.getWorldContainer().toURI().toString().substring(6);
|
String pluginFolder = TamableFoxes.getPlugin().getDataFolder().getAbsolutePath();
|
||||||
baseLoc = baseLoc.substring(0,baseLoc.length()-2);
|
String url = "jdbc:sqlite:" + pluginFolder + "/userFoxAmount.db";
|
||||||
|
|
||||||
String url = "jdbc:sqlite:" + baseLoc + "plugins/Tamablefoxes/userFoxAmount.db";
|
|
||||||
connection = DriverManager.getConnection(url);
|
connection = DriverManager.getConnection(url);
|
||||||
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
|
Loading…
Reference in New Issue