diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index f275097..4a9b692 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -6,9 +6,11 @@
-
-
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index bee17f4..a156f52 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -1,7 +1,6 @@
-
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 072970c..6fb7c97 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -5,7 +5,6 @@
-
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 28c1e46..3936248 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,31 +1,41 @@
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -45,59 +55,81 @@
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -116,107 +148,94 @@
-
- 1579293785651
+
+ 1579657428994
- 1579293785651
-
-
-
+ 1579657428994
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- file://$PROJECT_DIR$/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java
- 440
-
-
-
-
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 0309366..f853677 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,11 +5,11 @@
4.0.0
net.seanomik
- tamableFoxes
- 1.4.1-SNAPSHOT
+ tamablefoxes
+ 1.5-SNAPSHOT
jar
- TamableFoxes
+ Tamablefoxes
1.8
@@ -24,8 +24,8 @@
maven-compiler-plugin
3.7.0
-
- 1.8
+
+ ${java.version}
@@ -39,7 +39,8 @@
shade
- D:\Code\java\spigotPlugins\TEST_SERVER\plugins\${project.artifactId}-${project.version}.jar
+
+ E:\_TEST_SERVER_1.15.1_\plugins\${project.artifactId}-MC-1.15.1-${project.version}.jar
false
@@ -70,11 +71,18 @@
-
+
+
+ org.spigotmc
+ spigot
+ 1.15.1
+ system
+ E:/spigot-1.15.1.jar
com.github.WesJD.AnvilGUI
diff --git a/src/main/java/net/seanomik/tamablefoxes/Config.java b/src/main/java/net/seanomik/tamablefoxes/Config.java
new file mode 100644
index 0000000..27efc7d
--- /dev/null
+++ b/src/main/java/net/seanomik/tamablefoxes/Config.java
@@ -0,0 +1,24 @@
+package net.seanomik.tamablefoxes;
+
+import org.bukkit.entity.Player;
+
+public class Config {
+ private static TamableFoxes plugin = TamableFoxes.getPlugin();
+
+ public static boolean doesShowOwnerFoxName() {
+ return plugin.getConfig().getBoolean("show-owner-in-fox-name");
+ }
+
+ public static boolean doesShowNameTags() {
+ return plugin.getConfig().getBoolean("show-nametags");
+ }
+
+ public static boolean doesTamedAttackWildAnimals() {
+ return plugin.getConfig().getBoolean("tamed-behavior.attack-wild-animals");
+ }
+
+ public static boolean canPlayerTameFox(Player player) {
+ return !plugin.getConfig().getBoolean("enable-taming-permission") || (plugin.getConfig().getBoolean("enable-taming-permission") && (player.hasPermission("tamablefoxes.tame") || player.isOp()));
+ }
+
+}
diff --git a/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java b/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java
index 636c00c..c256742 100644
--- a/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java
+++ b/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java
@@ -1,80 +1,120 @@
package net.seanomik.tamablefoxes;
+import com.mojang.datafixers.Dynamic;
import net.minecraft.server.v1_15_R1.*;
import net.seanomik.tamablefoxes.pathfinding.*;
import org.bukkit.ChatColor;
-import org.bukkit.Location;
-import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
-import org.bukkit.craftbukkit.v1_15_R1.event.CraftEventFactory;
-import org.bukkit.entity.Fox;
-import org.bukkit.event.entity.EntityTargetEvent;
+import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
+import org.bukkit.entity.Item;
import org.bukkit.scheduler.BukkitRunnable;
-import org.bukkit.scheduler.BukkitTask;
-import org.bukkit.util.Vector;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
+import javax.annotation.Nullable;
import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
public class EntityTamableFox extends EntityFox {
- private static Fox thisFox;
- private final TamableFoxes plugin;
-
- private boolean isTamed;
- private EntityLiving owner;
+ private boolean tamed;
+ private boolean sitting;
+ private boolean sleeping;
private String chosenName;
- private boolean sit = false;
- private BukkitTask sittingRunnable;
+ private EntityLiving owner;
+ private UUID ownerUUID;
- private FoxPathfindGoalSit goalSit;
- private PathfinderGoalNearestAttackableTarget goalAttack;
+ private FoxPathfinderGoalSit goalSit;
+ private PathfinderGoal goalRandomSitting;
+ private PathfinderGoal goalBerryPicking;
+ private PathfinderGoal goalFleeSun;
+ private PathfinderGoal goalNearestVillage;
- public int databaseID = -1;
+ public EntityTamableFox(EntityTypes extends EntityFox> entitytypes, World world) {
+ super(entitytypes, world);
+ }
- public EntityTamableFox(TamableFoxes plugin, EntityTypes entitytypes, World world) {
- super(EntityTypes.FOX, world);
- this.plugin = plugin;
- thisFox = (Fox) this.getBukkitEntity();
+ private PathfinderGoal getFoxInnerPathfinderGoal(String innerName, List