Fixed a bug that would cause foxes to not be tamed after a server reboot
Also tested on PaperMC and 1.15.2 (works)
This commit is contained in:
parent
ba5a373201
commit
6053e66e2d
|
@ -8,9 +8,11 @@
|
||||||
<outputRelativeToContentRoot value="true" />
|
<outputRelativeToContentRoot value="true" />
|
||||||
<module name="TamableFoxesCustomEntity" />
|
<module name="TamableFoxesCustomEntity" />
|
||||||
<module name="tamableFoxes" />
|
<module name="tamableFoxes" />
|
||||||
|
<module name="TamableFoxes" />
|
||||||
</profile>
|
</profile>
|
||||||
</annotationProcessing>
|
</annotationProcessing>
|
||||||
<bytecodeTargetLevel>
|
<bytecodeTargetLevel>
|
||||||
|
<module name="TamableFoxes" target="1.8" />
|
||||||
<module name="tamableFoxes" target="1.8" />
|
<module name="tamableFoxes" target="1.8" />
|
||||||
<module name="TamableFoxesCustomEntity" target="1.8" />
|
<module name="TamableFoxesCustomEntity" target="1.8" />
|
||||||
</bytecodeTargetLevel>
|
</bytecodeTargetLevel>
|
||||||
|
|
|
@ -2,18 +2,25 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="dcab9632-7b1a-44d7-9283-be9b37640afc" name="Default Changelist" comment="">
|
<list default="true" id="dcab9632-7b1a-44d7-9283-be9b37640afc" name="Default Changelist" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/io/LanguageConfig.java" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/src/main/resources/language.yml" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/Config.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/io/Config.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/command/CommandSpawnTamableFox.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/command/CommandSpawnTamableFox.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/Utils.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/sqlite/SQLiteSetterGetter.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/sqlite/SQLiteSetterGetter.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/command/CommandSpawnTamableFox.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15/command/CommandSpawnTamableFox.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/resources/plugin.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/plugin.yml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/pathfinding/FoxPathfinderGoalFollowOwner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15/pathfinding/FoxPathfinderGoalFollowOwner.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/pathfinding/FoxPathfinderGoalHurtByTarget.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15/pathfinding/FoxPathfinderGoalHurtByTarget.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/pathfinding/FoxPathfinderGoalMeleeAttack.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15/pathfinding/FoxPathfinderGoalMeleeAttack.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/pathfinding/FoxPathfinderGoalOwnerHurtByTarget.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15/pathfinding/FoxPathfinderGoalOwnerHurtByTarget.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/pathfinding/FoxPathfinderGoalOwnerHurtTarget.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15/pathfinding/FoxPathfinderGoalOwnerHurtTarget.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/pathfinding/FoxPathfinderGoalPanic.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15/pathfinding/FoxPathfinderGoalPanic.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/pathfinding/FoxPathfinderGoalSit.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15/pathfinding/FoxPathfinderGoalSit.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/sqlite/SQLiteHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/sqlite/SQLiteHandler.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/sqlite/SQLiteSetterGetter.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15/sqlite/SQLiteSetterGetter.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/resources/language.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/language.yml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/target/classes/plugin.yml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/plugin.yml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/target/classes/plugin.yml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/plugin.yml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/target/maven-archiver/pom.properties" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-archiver/pom.properties" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
|
@ -49,7 +56,7 @@
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent">
|
<component name="PropertiesComponent">
|
||||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/io" />
|
<property name="last_opened_file_path" value="$PROJECT_DIR$/../DexunGUI" />
|
||||||
<property name="project.structure.last.edited" value="Modules" />
|
<property name="project.structure.last.edited" value="Modules" />
|
||||||
<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" />
|
||||||
|
@ -64,12 +71,32 @@
|
||||||
</key>
|
</key>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunManager" selected="JAR Application.Spigot-1.15.1">
|
<component name="RunManager" selected="JAR Application.Spigot-1.15.1">
|
||||||
|
<configuration name="Paper-1.15.1" type="JarApplication">
|
||||||
|
<option name="JAR_PATH" value="$PROJECT_DIR$/../../_TEST_SERVER_PAPER_1.15.1_/paper-62.jar" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="D:\Code\java\spigotPlugins\_TEST_SERVER_PAPER_1.15.1_" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
<configuration name="Paper-1.15.2" type="JarApplication">
|
||||||
|
<option name="JAR_PATH" value="$PROJECT_DIR$/../../_TEST_SERVER_PAPER_1.15.2_/paper-77.jar" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="nogui" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="D:\Code\java\spigotPlugins\_TEST_SERVER_PAPER_1.15.2_" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
<configuration name="Spigot-1.15.1" type="JarApplication">
|
<configuration name="Spigot-1.15.1" type="JarApplication">
|
||||||
<option name="JAR_PATH" value="$USER_HOME$/_TEST_SERVER_1.15.1_/spigot-1.15.1.jar" />
|
<option name="JAR_PATH" value="$PROJECT_DIR$/../../_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 name="Spigot-1.15.2" type="JarApplication">
|
||||||
|
<option name="JAR_PATH" value="$PROJECT_DIR$/../../_TEST_SERVER_1.15.2_/spigot-1.15.2.jar" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="nogui" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="D:\Code\java\spigotPlugins\_TEST_SERVER_1.15.2_" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
<configuration default="true" type="JarApplication">
|
<configuration default="true" type="JarApplication">
|
||||||
<option name="JAR_PATH" value="$USER_HOME$/_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_" />
|
||||||
|
@ -104,6 +131,9 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
<list>
|
<list>
|
||||||
<item itemvalue="JAR Application.Spigot-1.15.1" />
|
<item itemvalue="JAR Application.Spigot-1.15.1" />
|
||||||
|
<item itemvalue="JAR Application.Spigot-1.15.2" />
|
||||||
|
<item itemvalue="JAR Application.Paper-1.15.1" />
|
||||||
|
<item itemvalue="JAR Application.Paper-1.15.2" />
|
||||||
<item itemvalue="Maven.TamableFoxesCustomEntity build" />
|
<item itemvalue="Maven.TamableFoxesCustomEntity build" />
|
||||||
</list>
|
</list>
|
||||||
</component>
|
</component>
|
||||||
|
@ -133,61 +163,65 @@
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="WindowStateProjectService">
|
<component name="WindowStateProjectService">
|
||||||
<state x="414" y="174" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1580016134312">
|
<state x="414" y="174" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1580081956712">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="414" y="174" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580016134312" />
|
<state x="414" y="174" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580081956712" />
|
||||||
<state x="414" y="174" key="#com.intellij.execution.impl.EditConfigurationsDialog/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1579710781130" />
|
<state x="414" y="174" key="#com.intellij.execution.impl.EditConfigurationsDialog/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1579710781130" />
|
||||||
<state x="765" y="230" key="#com.intellij.ide.util.MemberChooser" timestamp="1579737522244">
|
<state x="765" y="230" key="#com.intellij.ide.util.MemberChooser" timestamp="1580081253579">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="765" y="230" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1579737522244" />
|
<state x="765" y="230" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580081253579" />
|
||||||
<state x="765" y="230" key="#com.intellij.ide.util.MemberChooser/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1579708181770" />
|
<state x="765" y="230" key="#com.intellij.ide.util.MemberChooser/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1579708181770" />
|
||||||
<state x="740" y="274" key="FileChooserDialogImpl" timestamp="1579710595269">
|
<state x="740" y="274" key="FileChooserDialogImpl" timestamp="1580081289890">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="794" y="418" width="356" height="203" key="Github.CreateGistDialog/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1579471488647" />
|
<state x="740" y="274" key="FileChooserDialogImpl/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580081289890" />
|
||||||
<state width="1877" height="234" key="GridCell.Tab.0.bottom" timestamp="1580022271776">
|
<state x="794" y="418" key="Github.CreateGistDialog" timestamp="1580081718270">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="234" key="GridCell.Tab.0.bottom/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580022271776" />
|
<state x="794" y="418" width="356" height="203" key="Github.CreateGistDialog/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580081718270" />
|
||||||
<state width="1877" height="234" key="GridCell.Tab.0.center" timestamp="1580022271776">
|
<state width="1877" height="237" key="GridCell.Tab.0.bottom" timestamp="1580082727030">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="234" key="GridCell.Tab.0.center/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580022271776" />
|
<state width="1877" height="237" key="GridCell.Tab.0.bottom/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580082727030" />
|
||||||
<state width="1877" height="234" key="GridCell.Tab.0.left" timestamp="1580022271776">
|
<state width="1877" height="237" key="GridCell.Tab.0.center" timestamp="1580082727030">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="234" key="GridCell.Tab.0.left/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580022271776" />
|
<state width="1877" height="237" key="GridCell.Tab.0.center/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580082727030" />
|
||||||
<state width="1877" height="234" key="GridCell.Tab.0.right" timestamp="1580022271776">
|
<state width="1877" height="237" key="GridCell.Tab.0.left" timestamp="1580082727030">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="234" key="GridCell.Tab.0.right/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580022271776" />
|
<state width="1877" height="237" key="GridCell.Tab.0.left/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580082727030" />
|
||||||
<state width="1877" height="234" key="GridCell.Tab.1.bottom" timestamp="1580022271776">
|
<state width="1877" height="237" key="GridCell.Tab.0.right" timestamp="1580082727030">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="234" key="GridCell.Tab.1.bottom/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580022271776" />
|
<state width="1877" height="237" key="GridCell.Tab.0.right/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580082727030" />
|
||||||
<state width="1877" height="234" key="GridCell.Tab.1.center" timestamp="1580022271776">
|
<state width="1877" height="237" key="GridCell.Tab.1.bottom" timestamp="1580082727030">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="234" key="GridCell.Tab.1.center/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580022271776" />
|
<state width="1877" height="237" key="GridCell.Tab.1.bottom/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580082727030" />
|
||||||
<state width="1877" height="234" key="GridCell.Tab.1.left" timestamp="1580022271776">
|
<state width="1877" height="237" key="GridCell.Tab.1.center" timestamp="1580082727030">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="234" key="GridCell.Tab.1.left/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580022271776" />
|
<state width="1877" height="237" key="GridCell.Tab.1.center/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580082727030" />
|
||||||
<state width="1877" height="234" key="GridCell.Tab.1.right" timestamp="1580022271776">
|
<state width="1877" height="237" key="GridCell.Tab.1.left" timestamp="1580082727030">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="1877" height="234" key="GridCell.Tab.1.right/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580022271776" />
|
<state width="1877" height="237" key="GridCell.Tab.1.left/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580082727030" />
|
||||||
|
<state width="1877" height="237" key="GridCell.Tab.1.right" timestamp="1580082727030">
|
||||||
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
|
</state>
|
||||||
|
<state width="1877" height="237" key="GridCell.Tab.1.right/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580082727030" />
|
||||||
<state x="490" y="174" key="Maven.ArtifactSearchDialog" timestamp="1579373377880">
|
<state x="490" y="174" key="Maven.ArtifactSearchDialog" timestamp="1579373377880">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state width="498" height="446" key="SwitcherDM/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1579469022098" />
|
<state width="498" height="446" key="SwitcherDM/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1579469022098" />
|
||||||
<state width="498" height="446" key="SwitcherDM/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1579705820492" />
|
<state width="498" height="446" key="SwitcherDM/1920.0.1920.1040/0.0.1920.1040@0.0.1920.1040" timestamp="1579705820492" />
|
||||||
<state x="656" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1579647313147">
|
<state x="656" y="343" key="com.intellij.ide.util.TipDialog" timestamp="1580063431581">
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="656" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1579647313147" />
|
<state x="656" y="343" key="com.intellij.ide.util.TipDialog/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580063431581" />
|
||||||
<state x="-781" y="188" width="1359" height="1028" key="dock-window-1" timestamp="1580017524734">
|
<state x="-781" y="188" width="1359" height="1028" key="dock-window-1" timestamp="1580017524734">
|
||||||
<screen x="-1920" y="0" width="1920" height="1040" />
|
<screen x="-1920" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
|
@ -204,5 +238,9 @@
|
||||||
<screen x="0" y="0" width="1920" height="1040" />
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
</state>
|
</state>
|
||||||
<state x="342" y="189" key="new project wizard/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1579657428699" />
|
<state x="342" y="189" key="new project wizard/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1579657428699" />
|
||||||
|
<state x="623" y="225" width="672" height="678" key="search.everywhere.popup" timestamp="1580063483764">
|
||||||
|
<screen x="0" y="0" width="1920" height="1040" />
|
||||||
|
</state>
|
||||||
|
<state x="623" y="225" width="672" height="678" key="search.everywhere.popup/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1580063483764" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
6
pom.xml
6
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>net.seanomik</groupId>
|
<groupId>net.seanomik</groupId>
|
||||||
<artifactId>tamablefoxes</artifactId>
|
<artifactId>tamablefoxes</artifactId>
|
||||||
<version>1.5-SNAPSHOT</version>
|
<version>1.5.1-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>Tamablefoxes</name>
|
<name>Tamablefoxes</name>
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<outputFile>D:\Code\java\spigotPlugins\_TEST_SERVER_1.15.1_\plugins\TamableFoxes-MC-v1.15.1-v${project.version}.jar</outputFile>
|
<outputFile>D:\Code\java\spigotPlugins\_TEST_SERVER_1.15.1_\plugins\TamableFoxes-MC-v1.15.1-v${project.version}.jar</outputFile>
|
||||||
<!--<outputFile>E:\_TEST_SERVER_1.15.1_\plugins\${project.artifactId}-MC-1.15.1-${project.version}.jar</outputFile>-->
|
<!--<outputFile>D:\Code\java\spigotPlugins\_TEST_SERVER_PAPER_1.15.1_\plugins\TamableFoxes-MC-v1.15.2-v${project.version}.jar</outputFile>-->
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>1.15.1-R0.1-SNAPSHOT</version>
|
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -3,7 +3,7 @@ package net.seanomik.tamablefoxes;
|
||||||
import com.mojang.datafixers.Dynamic;
|
import com.mojang.datafixers.Dynamic;
|
||||||
import net.minecraft.server.v1_15_R1.*;
|
import net.minecraft.server.v1_15_R1.*;
|
||||||
import net.seanomik.tamablefoxes.io.Config;
|
import net.seanomik.tamablefoxes.io.Config;
|
||||||
import net.seanomik.tamablefoxes.pathfinding.*;
|
import net.seanomik.tamablefoxes.versions.version_1_15.pathfinding.*;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
|
||||||
import org.bukkit.entity.Item;
|
import org.bukkit.entity.Item;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package net.seanomik.tamablefoxes;
|
package net.seanomik.tamablefoxes;
|
||||||
|
|
||||||
import net.minecraft.server.v1_15_R1.*;
|
import net.minecraft.server.v1_15_R1.*;
|
||||||
import net.seanomik.tamablefoxes.command.CommandSpawnTamableFox;
|
import net.seanomik.tamablefoxes.versions.version_1_15.command.CommandSpawnTamableFox;
|
||||||
import net.seanomik.tamablefoxes.io.Config;
|
import net.seanomik.tamablefoxes.io.Config;
|
||||||
import net.seanomik.tamablefoxes.io.LanguageConfig;
|
import net.seanomik.tamablefoxes.io.LanguageConfig;
|
||||||
import net.seanomik.tamablefoxes.sqlite.SQLiteHandler;
|
import net.seanomik.tamablefoxes.sqlite.SQLiteHandler;
|
||||||
import net.seanomik.tamablefoxes.sqlite.SQLiteSetterGetter;
|
import net.seanomik.tamablefoxes.versions.version_1_15.sqlite.SQLiteSetterGetter;
|
||||||
import net.wesjd.anvilgui.AnvilGUI;
|
import net.wesjd.anvilgui.AnvilGUI;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
@ -23,38 +23,44 @@ import org.bukkit.event.player.PlayerBedEnterEvent;
|
||||||
import org.bukkit.event.player.PlayerBedLeaveEvent;
|
import org.bukkit.event.player.PlayerBedLeaveEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.world.ChunkLoadEvent;
|
||||||
import org.bukkit.event.world.WorldSaveEvent;
|
import org.bukkit.event.world.WorldSaveEvent;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
// @TODO: Add language.yml
|
// @TODO:
|
||||||
// Foxes will be loaded in as sitting, even if they weren't when the server was shutdown (sometimes)
|
|
||||||
|
/* @CHANGELOG (1.5.1):
|
||||||
|
* Now loads on Linux
|
||||||
|
* Fixed a bug that would cause foxes to not be tamed after a server reboot
|
||||||
|
* Updated to 1.15.2
|
||||||
|
*/
|
||||||
public final class TamableFoxes extends JavaPlugin implements Listener {
|
public final class TamableFoxes extends JavaPlugin implements Listener {
|
||||||
private static TamableFoxes plugin;
|
private static TamableFoxes plugin;
|
||||||
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;
|
public SQLiteHandler sqLiteHandler = new 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();
|
||||||
|
|
||||||
String version = Bukkit.getServer().getClass().getPackage().getName();
|
String version = Bukkit.getServer().getClass().getPackage().getName();
|
||||||
|
|
||||||
if (!version.equals("org.bukkit.craftbukkit.v1_15_R1")) {
|
if (!version.equals("org.bukkit.craftbukkit.v1_15_R1")) {
|
||||||
Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getUnsupportedMCVersionRegister());
|
Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getUnsupportedMCVersionRegister());
|
||||||
versionSupported = false;
|
versionSupported = false;
|
||||||
|
@ -98,8 +104,6 @@ public final class TamableFoxes extends JavaPlugin implements Listener {
|
||||||
this.saveDefaultConfig();
|
this.saveDefaultConfig();
|
||||||
getConfig().options().copyDefaults(true);
|
getConfig().options().copyDefaults(true);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
|
|
||||||
spawnedFoxes = sqLiteSetterGetter.loadFoxes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -113,6 +117,13 @@ public final class TamableFoxes extends JavaPlugin implements Listener {
|
||||||
sqLiteSetterGetter.saveFoxes(spawnedFoxes);
|
sqLiteSetterGetter.saveFoxes(spawnedFoxes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onChunkLoad(ChunkLoadEvent event) {
|
||||||
|
Bukkit.getScheduler().runTaskLaterAsynchronously(this, ()-> {
|
||||||
|
spawnedFoxes.addAll(sqLiteSetterGetter.loadFoxes(event.getChunk()));
|
||||||
|
}, 5L);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
@ -140,6 +151,8 @@ public final class TamableFoxes extends JavaPlugin implements Listener {
|
||||||
|
|
||||||
if (event.getHand() != EquipmentSlot.HAND) return;
|
if (event.getHand() != EquipmentSlot.HAND) return;
|
||||||
|
|
||||||
|
player.sendMessage(entity.getUniqueId().toString());
|
||||||
|
|
||||||
ItemStack itemHand = player.getInventory().getItemInMainHand();
|
ItemStack itemHand = player.getInventory().getItemInMainHand();
|
||||||
ItemMeta handMeta = itemHand.getItemMeta();
|
ItemMeta handMeta = itemHand.getItemMeta();
|
||||||
|
|
||||||
|
@ -258,7 +271,7 @@ public final class TamableFoxes extends JavaPlugin implements Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the fox from database
|
// Remove the fox from database
|
||||||
sqLiteSetterGetter.removeFox(tamableFox);
|
//sqLiteSetterGetter.removeFox(tamableFox);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EntityTamableFox spawnTamableFox(Location loc, EntityFox.Type type) {
|
public EntityTamableFox spawnTamableFox(Location loc, EntityFox.Type type) {
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
package net.seanomik.tamablefoxes;
|
package net.seanomik.tamablefoxes;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
|
|
||||||
|
@ -83,4 +88,26 @@ public class Utils {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Entity getEntity(UUID uuid) {
|
||||||
|
for (World world : Bukkit.getServer().getWorlds()) {
|
||||||
|
for (Entity entity : world.getEntities()) {
|
||||||
|
if (entity.getUniqueId().equals(uuid)) {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Entity getEntity(Chunk chunk, UUID uuid) {
|
||||||
|
for (Entity entity : chunk.getEntities()) {
|
||||||
|
if (entity.getUniqueId().equals(uuid)) {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,20 @@
|
||||||
package net.seanomik.tamablefoxes.sqlite;
|
package net.seanomik.tamablefoxes.sqlite;
|
||||||
|
|
||||||
|
import net.seanomik.tamablefoxes.TamableFoxes;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
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 url = "jdbc:sqlite:/" + dataFolder.getAbsolutePath() + "/foxes.db";
|
String url = "jdbc:sqlite:" + TamableFoxes.getPlugin().getDataFolder() + "/foxes.db";
|
||||||
connection = DriverManager.getConnection(url);
|
connection = DriverManager.getConnection(url);
|
||||||
|
|
||||||
//Bukkit.getConsoleSender().sendMessage(TamableFoxes.getPrefix() + "Connection to SQLite has been established.");
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package net.seanomik.tamablefoxes.command;
|
package net.seanomik.tamablefoxes.versions.version_1_15.command;
|
||||||
|
|
||||||
import net.seanomik.tamablefoxes.EntityTamableFox;
|
import net.seanomik.tamablefoxes.EntityTamableFox;
|
||||||
import net.seanomik.tamablefoxes.TamableFoxes;
|
import net.seanomik.tamablefoxes.TamableFoxes;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.seanomik.tamablefoxes.pathfinding;
|
package net.seanomik.tamablefoxes.versions.version_1_15.pathfinding;
|
||||||
|
|
||||||
import net.seanomik.tamablefoxes.EntityTamableFox;
|
import net.seanomik.tamablefoxes.EntityTamableFox;
|
||||||
import net.minecraft.server.v1_15_R1.*;
|
import net.minecraft.server.v1_15_R1.*;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.seanomik.tamablefoxes.pathfinding;
|
package net.seanomik.tamablefoxes.versions.version_1_15.pathfinding;
|
||||||
|
|
||||||
import net.seanomik.tamablefoxes.EntityTamableFox;
|
import net.seanomik.tamablefoxes.EntityTamableFox;
|
||||||
import net.minecraft.server.v1_15_R1.*;
|
import net.minecraft.server.v1_15_R1.*;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.seanomik.tamablefoxes.pathfinding;
|
package net.seanomik.tamablefoxes.versions.version_1_15.pathfinding;
|
||||||
|
|
||||||
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;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.seanomik.tamablefoxes.pathfinding;
|
package net.seanomik.tamablefoxes.versions.version_1_15.pathfinding;
|
||||||
|
|
||||||
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;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.seanomik.tamablefoxes.pathfinding;
|
package net.seanomik.tamablefoxes.versions.version_1_15.pathfinding;
|
||||||
|
|
||||||
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;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.seanomik.tamablefoxes.pathfinding;
|
package net.seanomik.tamablefoxes.versions.version_1_15.pathfinding;
|
||||||
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityFox;
|
import net.minecraft.server.v1_15_R1.EntityFox;
|
||||||
import net.minecraft.server.v1_15_R1.PathfinderGoalPanic;
|
import net.minecraft.server.v1_15_R1.PathfinderGoalPanic;
|
|
@ -1,4 +1,4 @@
|
||||||
package net.seanomik.tamablefoxes.pathfinding;
|
package net.seanomik.tamablefoxes.versions.version_1_15.pathfinding;
|
||||||
|
|
||||||
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;
|
|
@ -1,12 +1,17 @@
|
||||||
package net.seanomik.tamablefoxes.sqlite;
|
package net.seanomik.tamablefoxes.versions.version_1_15.sqlite;
|
||||||
|
|
||||||
import net.minecraft.server.v1_15_R1.EntityLiving;
|
import net.minecraft.server.v1_15_R1.EntityLiving;
|
||||||
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 net.seanomik.tamablefoxes.sqlite.SQLiteHandler;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Chunk;
|
||||||
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.entity.Entity;
|
||||||
|
|
||||||
import java.sql.DatabaseMetaData;
|
import java.sql.DatabaseMetaData;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
|
@ -14,6 +19,8 @@ import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
// @TODO: Use try-with-resource instead of try-catch-finally
|
||||||
|
|
||||||
public class SQLiteSetterGetter {
|
public class SQLiteSetterGetter {
|
||||||
public static TamableFoxes plugin;
|
public static TamableFoxes plugin;
|
||||||
public static SQLiteHandler sqLiteHandler;
|
public static SQLiteHandler sqLiteHandler;
|
||||||
|
@ -39,17 +46,13 @@ public class SQLiteSetterGetter {
|
||||||
PreparedStatement statement = sqLiteHandler.getConnection().prepareStatement(foxesTable);
|
PreparedStatement statement = sqLiteHandler.getConnection().prepareStatement(foxesTable);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
|
|
||||||
plugin.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + LanguageConfig.getCreatedSQLDatabase());
|
plugin.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getCreatedSQLDatabase());
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
if (sqLiteHandler.getConnection() != null) {
|
if (sqLiteHandler.getConnection() != null) {
|
||||||
try {
|
sqLiteHandler.closeConnection();
|
||||||
sqLiteHandler.getConnection().close();
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,11 +94,7 @@ public class SQLiteSetterGetter {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
if (sqLiteHandler.getConnection() != null) {
|
if (sqLiteHandler.getConnection() != null) {
|
||||||
try {
|
sqLiteHandler.closeConnection();
|
||||||
sqLiteHandler.getConnection().close();
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,30 +107,38 @@ public class SQLiteSetterGetter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EntityTamableFox> loadFoxes() {
|
public List<EntityTamableFox> loadFoxes(Chunk chunk) {
|
||||||
plugin = TamableFoxes.getPlugin(TamableFoxes.class);
|
plugin = TamableFoxes.getPlugin(TamableFoxes.class);
|
||||||
List<UUID> toRemoveLater = new ArrayList<>();
|
|
||||||
|
// If there are no foxes then don't even start
|
||||||
|
List<EntityTamableFox> foxesInChunk = new ArrayList<>();
|
||||||
|
for (Entity entity : chunk.getEntities()) {
|
||||||
|
if (Utils.isTamableFox(entity)) {
|
||||||
|
foxesInChunk.add((EntityTamableFox) ((CraftEntity) entity).getHandle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (foxesInChunk.size() == 0) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sqLiteHandler.connect();
|
sqLiteHandler.connect();
|
||||||
PreparedStatement statement = sqLiteHandler.getConnection().prepareStatement("SELECT * FROM foxes");
|
|
||||||
ResultSet results = statement.executeQuery();
|
|
||||||
|
|
||||||
List<EntityTamableFox> spawnedFoxes = new ArrayList<>();
|
List<EntityTamableFox> spawnedFoxes = new ArrayList<>();
|
||||||
while (results.next()) { // Loop through each row
|
|
||||||
UUID entityUUID = UUID.fromString(results.getString("ENTITY_UUID"));
|
for (EntityTamableFox tamableFox : foxesInChunk) {
|
||||||
|
PreparedStatement statement = sqLiteHandler.getConnection().prepareStatement("SELECT * FROM foxes WHERE ENTITY_UUID=?");
|
||||||
|
statement.setString(1, tamableFox.getUniqueID().toString());
|
||||||
|
ResultSet results = statement.executeQuery();
|
||||||
|
|
||||||
|
if (results.next()) {
|
||||||
String ownerUUIDString = results.getString("OWNER_UUID");
|
String ownerUUIDString = results.getString("OWNER_UUID");
|
||||||
String name = results.getString("NAME");
|
String name = results.getString("NAME");
|
||||||
boolean sitting = results.getInt("SITTING") == 1;
|
boolean sitting = results.getInt("SITTING") == 1;
|
||||||
boolean sleeping = results.getInt("SLEEPING") == 1;
|
boolean sleeping = results.getInt("SLEEPING") == 1;
|
||||||
|
|
||||||
// If the entity is null, it doesn't exist anymore so remove it from database
|
|
||||||
if (plugin.getServer().getEntity(entityUUID) == null) {
|
|
||||||
toRemoveLater.add(entityUUID);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean tamed = false;
|
boolean tamed = false;
|
||||||
EntityTamableFox tamableFox = (EntityTamableFox) ((CraftEntity) plugin.getServer().getEntity(entityUUID)).getHandle();
|
|
||||||
if (!ownerUUIDString.equals("none")) {
|
if (!ownerUUIDString.equals("none")) {
|
||||||
tamed = true;
|
tamed = true;
|
||||||
|
|
||||||
|
@ -146,33 +153,26 @@ public class SQLiteSetterGetter {
|
||||||
tamableFox.setChosenName(name);
|
tamableFox.setChosenName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fox may spawn standing if the server was closed while it was sitting.
|
if (sitting && tamed) {
|
||||||
if (sitting) {
|
|
||||||
if (tamed) {
|
|
||||||
tamableFox.setHardSitting(true);
|
tamableFox.setHardSitting(true);
|
||||||
}
|
|
||||||
} else if (sleeping) {
|
} else if (sleeping) {
|
||||||
tamableFox.setSleeping(true);
|
tamableFox.setSleeping(true);
|
||||||
|
} else { // Avoid the foxes getting stuck sitting down.
|
||||||
|
tamableFox.setSitting(false);
|
||||||
|
tamableFox.setSleeping(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
spawnedFoxes.add(tamableFox);
|
spawnedFoxes.add(tamableFox);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return spawnedFoxes;
|
return spawnedFoxes;
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
if (sqLiteHandler.getConnection() != null) {
|
if (sqLiteHandler.getConnection() != null) {
|
||||||
try {
|
sqLiteHandler.closeConnection();
|
||||||
sqLiteHandler.getConnection().close();
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove those to remove later UUIDs
|
|
||||||
for (UUID uuid : toRemoveLater) {
|
|
||||||
removeFox(uuid);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -189,11 +189,7 @@ public class SQLiteSetterGetter {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
if (sqLiteHandler.getConnection() != null) {
|
if (sqLiteHandler.getConnection() != null) {
|
||||||
try {
|
sqLiteHandler.closeConnection();
|
||||||
sqLiteHandler.getConnection().close();
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
unsupported-mc-version-not-registering: "ERROR: This plugin version only supports 1.15.1! Not registering entity!"
|
unsupported-mc-version-not-registering: "ERROR: This plugin version only supports Spigot 1.15.1, currently not Paper! Not registering entity!"
|
||||||
unsupported-mc-version-disabling: "This plugin version only supports 1.15.1! Disabling plugin!"
|
unsupported-mc-version-disabling: "This plugin version only supports Spigot 1.15.1, currently not Paper! Disabling plugin!"
|
||||||
success-replaced-entity: "Replaced tamable fox entity!"
|
success-replaced-entity: "Replaced tamable fox entity!"
|
||||||
error-to-replaced-entity: "Failed to replace tamable fox entity!"
|
error-to-replaced-entity: "Failed to replace tamable fox entity!"
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
name: Tamablefoxes
|
name: Tamablefoxes
|
||||||
version: 1.5-SNAPSHOT
|
version: 1.5.1-SNAPSHOT
|
||||||
main: net.seanomik.tamablefoxes.TamableFoxes
|
main: net.seanomik.tamablefoxes.TamableFoxes
|
||||||
api-version: 1.15
|
api-version: 1.15
|
||||||
#load: STARTUP
|
|
||||||
load: POSTWORLD
|
load: POSTWORLD
|
||||||
#load: STARTUP
|
|
||||||
description: Adds tamable foxes to Minecraft!
|
description: Adds tamable foxes to Minecraft!
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#Generated by Maven
|
#Generated by Maven
|
||||||
#Wed Jan 22 08:36:01 CST 2020
|
#Sun Jan 26 14:51:19 CST 2020
|
||||||
version=1.5-SNAPSHOT
|
version=1.5.1-SNAPSHOT
|
||||||
groupId=net.seanomik
|
groupId=net.seanomik
|
||||||
artifactId=tamablefoxes
|
artifactId=tamablefoxes
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
net\seanomik\tamablefoxes\EntityTamableFox.class
|
net\seanomik\tamablefoxes\EntityTamableFox.class
|
||||||
net\seanomik\tamablefoxes\command\CommandSpawnTamableFox.class
|
net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalMeleeAttack.class
|
||||||
net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalSit.class
|
net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalPanic.class
|
||||||
net\seanomik\tamablefoxes\sqlite\SQLiteSetterGetter.class
|
net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalHurtByTarget.class
|
||||||
net\seanomik\tamablefoxes\io\LanguageConfig.class
|
|
||||||
net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalPanic.class
|
|
||||||
net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalOwnerHurtTarget.class
|
|
||||||
net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalMeleeAttack.class
|
|
||||||
net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalOwnerHurtByTarget.class
|
|
||||||
net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalFollowOwner.class
|
|
||||||
net\seanomik\tamablefoxes\sqlite\SQLiteHandler.class
|
net\seanomik\tamablefoxes\sqlite\SQLiteHandler.class
|
||||||
|
net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalFollowOwner.class
|
||||||
net\seanomik\tamablefoxes\TamableFoxes.class
|
net\seanomik\tamablefoxes\TamableFoxes.class
|
||||||
net\seanomik\tamablefoxes\EntityTamableFox$UpdateFoxRunnable.class
|
net\seanomik\tamablefoxes\EntityTamableFox$UpdateFoxRunnable.class
|
||||||
net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalHurtByTarget.class
|
net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalSit.class
|
||||||
|
net\seanomik\tamablefoxes\versions\version_1_15\command\CommandSpawnTamableFox.class
|
||||||
|
net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalOwnerHurtByTarget.class
|
||||||
|
net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalOwnerHurtTarget.class
|
||||||
|
net\seanomik\tamablefoxes\io\LanguageConfig.class
|
||||||
|
net\seanomik\tamablefoxes\versions\version_1_15\sqlite\SQLiteSetterGetter.class
|
||||||
net\seanomik\tamablefoxes\Utils.class
|
net\seanomik\tamablefoxes\Utils.class
|
||||||
net\seanomik\tamablefoxes\io\Config.class
|
net\seanomik\tamablefoxes\io\Config.class
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalHurtByTarget.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalHurtByTarget.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalOwnerHurtByTarget.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalPanic.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\command\CommandSpawnTamableFox.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalOwnerHurtByTarget.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\TamableFoxes.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\sqlite\SQLiteHandler.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\io\Config.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\versions\version_1_15\command\CommandSpawnTamableFox.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\Utils.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalSit.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalSit.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\Utils.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\EntityTamableFox.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalFollowOwner.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalOwnerHurtTarget.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\TamableFoxes.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\sqlite\SQLiteHandler.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\io\Config.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\sqlite\SQLiteSetterGetter.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalOwnerHurtTarget.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalFollowOwner.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\versions\version_1_15\sqlite\SQLiteSetterGetter.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalMeleeAttack.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\versions\version_1_15\pathfinding\FoxPathfinderGoalMeleeAttack.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\pathfinding\FoxPathfinderGoalPanic.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\EntityTamableFox.java
|
||||||
D:\Code\java\spigotPlugins\myPlugins\GitTamableFoxes\src\main\java\net\seanomik\tamablefoxes\io\LanguageConfig.java
|
D:\Code\java\spigotPlugins\myPlugins\TamableFoxes\src\main\java\net\seanomik\tamablefoxes\io\LanguageConfig.java
|
||||||
|
|
Loading…
Reference in New Issue