Merge pull request #2 from Draycia/fix-file-issue
Fix plugin not loading on docker/linux. Will be released with the 1.15.2 update
This commit is contained in:
commit
ba5a373201
|
@ -54,6 +54,7 @@
|
||||||
<property name="project.structure.proportion" value="0.0" />
|
<property name="project.structure.proportion" value="0.0" />
|
||||||
<property name="project.structure.side.proportion" value="0.0" />
|
<property name="project.structure.side.proportion" value="0.0" />
|
||||||
<property name="restartRequiresConfirmation" value="false" />
|
<property name="restartRequiresConfirmation" value="false" />
|
||||||
|
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
|
||||||
<property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
|
<property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
|
||||||
</component>
|
</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
|
@ -64,13 +65,13 @@
|
||||||
</component>
|
</component>
|
||||||
<component name="RunManager" selected="JAR Application.Spigot-1.15.1">
|
<component name="RunManager" selected="JAR Application.Spigot-1.15.1">
|
||||||
<configuration name="Spigot-1.15.1" type="JarApplication">
|
<configuration name="Spigot-1.15.1" type="JarApplication">
|
||||||
<option name="JAR_PATH" value="$PROJECT_DIR$/../../_TEST_SERVER_1.15.1_/spigot-1.15.1.jar" />
|
<option name="JAR_PATH" value="$USER_HOME$/_TEST_SERVER_1.15.1_/spigot-1.15.1.jar" />
|
||||||
<option name="WORKING_DIRECTORY" value="D:\Code\java\spigotPlugins\_TEST_SERVER_1.15.1_" />
|
<option name="WORKING_DIRECTORY" value="D:\Code\java\spigotPlugins\_TEST_SERVER_1.15.1_" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration default="true" type="JarApplication">
|
<configuration default="true" type="JarApplication">
|
||||||
<option name="JAR_PATH" value="$PROJECT_DIR$/../../_TEST_SERVER_2_/spigot-1.15.1.jar" />
|
<option name="JAR_PATH" value="$USER_HOME$/_TEST_SERVER_2_/spigot-1.15.1.jar" />
|
||||||
<option name="WORKING_DIRECTORY" value="D:\Code\java\spigotPlugins\_TEST_SERVER_2_" />
|
<option name="WORKING_DIRECTORY" value="D:\Code\java\spigotPlugins\_TEST_SERVER_2_" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
|
|
|
@ -42,12 +42,13 @@ public final class TamableFoxes extends JavaPlugin implements Listener {
|
||||||
public List<EntityTamableFox> spawnedFoxes = new ArrayList<>();
|
public List<EntityTamableFox> spawnedFoxes = new ArrayList<>();
|
||||||
|
|
||||||
public SQLiteSetterGetter sqLiteSetterGetter = new SQLiteSetterGetter();
|
public SQLiteSetterGetter sqLiteSetterGetter = new SQLiteSetterGetter();
|
||||||
public SQLiteHandler sqLiteHandler = new SQLiteHandler();
|
public SQLiteHandler sqLiteHandler;
|
||||||
|
|
||||||
private boolean versionSupported = true;
|
private boolean versionSupported = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad() {
|
public void onLoad() {
|
||||||
|
sqLiteHandler = new SQLiteHandler(getDataFolder());
|
||||||
plugin = this;
|
plugin = this;
|
||||||
|
|
||||||
LanguageConfig.getConfig().saveDefault();
|
LanguageConfig.getConfig().saveDefault();
|
||||||
|
|
|
@ -5,9 +5,6 @@ import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.seanomik.tamablefoxes.pathfinding;
|
package net.seanomik.tamablefoxes.pathfinding;
|
||||||
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityFox;
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityLiving;
|
import net.minecraft.server.v1_15_R1.EntityLiving;
|
||||||
import net.minecraft.server.v1_15_R1.PathfinderGoalMeleeAttack;
|
import net.minecraft.server.v1_15_R1.PathfinderGoalMeleeAttack;
|
||||||
import net.minecraft.server.v1_15_R1.SoundEffects;
|
import net.minecraft.server.v1_15_R1.SoundEffects;
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
package net.seanomik.tamablefoxes.pathfinding;
|
package net.seanomik.tamablefoxes.pathfinding;
|
||||||
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityTameableAnimal;
|
|
||||||
import net.seanomik.tamablefoxes.EntityTamableFox;
|
import net.seanomik.tamablefoxes.EntityTamableFox;
|
||||||
import net.minecraft.server.v1_15_R1.EntityLiving;
|
import net.minecraft.server.v1_15_R1.EntityLiving;
|
||||||
import net.minecraft.server.v1_15_R1.PathfinderGoalTarget;
|
import net.minecraft.server.v1_15_R1.PathfinderGoalTarget;
|
||||||
import net.minecraft.server.v1_15_R1.PathfinderTargetCondition;
|
import net.minecraft.server.v1_15_R1.PathfinderTargetCondition;
|
||||||
import net.seanomik.tamablefoxes.Utils;
|
|
||||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||||
|
|
||||||
import javax.rmi.CORBA.Util;
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
|
|
||||||
public class FoxPathfinderGoalOwnerHurtTarget extends PathfinderGoalTarget {
|
public class FoxPathfinderGoalOwnerHurtTarget extends PathfinderGoalTarget {
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
package net.seanomik.tamablefoxes.sqlite;
|
package net.seanomik.tamablefoxes.sqlite;
|
||||||
|
|
||||||
import net.seanomik.tamablefoxes.TamableFoxes;
|
import java.io.File;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
public class SQLiteHandler {
|
public class SQLiteHandler {
|
||||||
private Connection connection;
|
private Connection connection;
|
||||||
|
private File dataFolder;
|
||||||
|
|
||||||
|
public SQLiteHandler(File dataFolder) {
|
||||||
|
this.dataFolder = dataFolder;
|
||||||
|
}
|
||||||
|
|
||||||
public void connect() {
|
public void connect() {
|
||||||
try {
|
try {
|
||||||
String baseLoc = Bukkit.getWorldContainer().toURI().toString().substring(6);
|
String url = "jdbc:sqlite:/" + dataFolder.getAbsolutePath() + "/foxes.db";
|
||||||
baseLoc = baseLoc.substring(0,baseLoc.length()-2);
|
|
||||||
|
|
||||||
String url = "jdbc:sqlite:" + baseLoc + "plugins/TamableFoxes/foxes.db";
|
|
||||||
connection = DriverManager.getConnection(url);
|
connection = DriverManager.getConnection(url);
|
||||||
|
|
||||||
//Bukkit.getConsoleSender().sendMessage(TamableFoxes.getPrefix() + "Connection to SQLite has been established.");
|
//Bukkit.getConsoleSender().sendMessage(TamableFoxes.getPrefix() + "Connection to SQLite has been established.");
|
||||||
|
|
|
@ -1,23 +1,12 @@
|
||||||
package net.seanomik.tamablefoxes.sqlite;
|
package net.seanomik.tamablefoxes.sqlite;
|
||||||
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityFox;
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityLiving;
|
import net.minecraft.server.v1_15_R1.EntityLiving;
|
||||||
import net.minecraft.server.v1_15_R1.EnumItemSlot;
|
|
||||||
import net.seanomik.tamablefoxes.EntityTamableFox;
|
import net.seanomik.tamablefoxes.EntityTamableFox;
|
||||||
import net.seanomik.tamablefoxes.TamableFoxes;
|
import net.seanomik.tamablefoxes.TamableFoxes;
|
||||||
import net.seanomik.tamablefoxes.Utils;
|
import net.seanomik.tamablefoxes.Utils;
|
||||||
import net.seanomik.tamablefoxes.io.LanguageConfig;
|
import net.seanomik.tamablefoxes.io.LanguageConfig;
|
||||||
import org.apache.commons.lang.ObjectUtils;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
|
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import java.sql.DatabaseMetaData;
|
import java.sql.DatabaseMetaData;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
|
|
Loading…
Reference in New Issue