diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 4717e2c..2352b31 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,51 +2,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -74,7 +32,7 @@
-
+
@@ -92,6 +50,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -161,9 +159,9 @@
-
+
-
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 73e8af0..7bbac61 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
net.seanomik
tamableFoxes
- 1.4-SNAPSHOT
+ 1.4.1-SNAPSHOT
jar
TamableFoxes
diff --git a/src/main/java/net/seanomilk/tamablefoxes/TamableFoxes.java b/src/main/java/net/seanomilk/tamablefoxes/TamableFoxes.java
index 975323f..a469d2d 100644
--- a/src/main/java/net/seanomilk/tamablefoxes/TamableFoxes.java
+++ b/src/main/java/net/seanomilk/tamablefoxes/TamableFoxes.java
@@ -16,6 +16,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftFox;
+import org.bukkit.craftbukkit.v1_15_R1.entity.CraftItem;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
import org.bukkit.entity.Entity;
@@ -332,6 +333,9 @@ public class TamableFoxes extends JavaPlugin implements Listener {
playerHand.setAmount(playerHand.getAmount() - 1);
player.getInventory().setItemInMainHand(playerHand);
}
+ } else if (playerHand.getType() == Material.NAME_TAG) {
+ ItemMeta handMeta = playerHand.getItemMeta();
+ tamableFox.setChosenName(handMeta.getDisplayName());
} else {
tamableFox.toggleSitting();
}
@@ -378,37 +382,8 @@ public class TamableFoxes extends JavaPlugin implements Listener {
event.setCancelled(true);
}
}
-
}
- /*@EventHandler
- public void onChat(AsyncPlayerChatEvent event) {
- final Player player = event.getPlayer();
-
- final UUID foxUuid = waitingName.get(player);
- if (foxUuid == null)
- return;
-
- event.setCancelled(true);
-
- final Entity entityFox = getEntityByUniqueId(foxUuid);
- if (entityFox == null || entityFox.isDead()) {
- player.sendMessage(ChatColor.RED + "R.I.P Foxy :(");
- waitingName.remove(player);
- return;
- }
-
- EntityTamableFox tamableFox = (EntityTamableFox) ((CraftEntity) entityFox).getHandle();
-
- final String chosenName = ChatColor.translateAlternateColorCodes('&', event.getMessage().trim());
- tamableFox.setChosenName(chosenName);
-
- configFoxes.set("Foxes." + entityFox.getUniqueId() + ".name", chosenName).save();
-
- player.sendMessage(chosenName + ChatColor.RESET + ChatColor.GREEN + " is perfect.");
- waitingName.remove(player);
- }*/
-
@EventHandler
public void onPlayerBedEnterEvent(PlayerBedEnterEvent event) {
Player player = event.getPlayer();
diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties
index 6cb1c05..919f7c4 100644
--- a/target/maven-archiver/pom.properties
+++ b/target/maven-archiver/pom.properties
@@ -1,5 +1,5 @@
#Generated by Maven
-#Sat Jan 18 11:25:38 CST 2020
-version=1.4-SNAPSHOT
+#Sat Jan 18 14:21:47 CST 2020
+version=1.4.1-SNAPSHOT
groupId=net.seanomik
artifactId=tamableFoxes