diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..774cf3e
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "AnvilGUI"]
+ path = AnvilGUI
+ url = https://github.com/SeanOMik/AnvilGUI
diff --git a/1_14_R1/pom.xml b/1_14_R1/pom.xml
index e8f3760..4a4cf93 100644
--- a/1_14_R1/pom.xml
+++ b/1_14_R1/pom.xml
@@ -17,10 +17,10 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
+
diff --git a/1_14_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_14_R1/EntityTamableFox.java b/1_14_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_14_R1/EntityTamableFox.java
index 6fc3ab0..78afc0e 100644
--- a/1_14_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_14_R1/EntityTamableFox.java
+++ b/1_14_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_14_R1/EntityTamableFox.java
@@ -320,7 +320,7 @@ public class EntityTamableFox extends EntityFox {
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
return true;
}
@@ -341,13 +341,13 @@ public class EntityTamableFox extends EntityFox {
getBukkitEntity().getWorld().spawnParticle(org.bukkit.Particle.HEART, getBukkitEntity().getLocation(), 6, 0.5D, 0.5D, 0.5D);
// Give player tamed message.
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
// Let the player choose the new fox's name if its enabled in config.
if (Config.askForNameAfterTaming()) {
Player player = (Player) entityhuman.getBukkitEntity();
- player.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
+ player.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
new AnvilGUI.Builder()
.onComplete((plr, input) -> { // Called when the inventory output slot is clicked
if (!input.equals("")) {
@@ -358,7 +358,7 @@ public class EntityTamableFox extends EntityFox {
tamableFox.setCustomName(foxName);
tamableFox.setCustomNameVisible(true);
- plr.sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
+ plr.sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
}
return AnvilGUI.Response.close();
diff --git a/1_14_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_14_R1/NMSInterface_1_14_R1.java b/1_14_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_14_R1/NMSInterface_1_14_R1.java
index f917d76..fede864 100644
--- a/1_14_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_14_R1/NMSInterface_1_14_R1.java
+++ b/1_14_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_14_R1/NMSInterface_1_14_R1.java
@@ -5,6 +5,7 @@ import net.minecraft.server.v1_14_R1.EntityTypes;
import net.seanomik.tamablefoxes.util.FieldHelper;
import net.seanomik.tamablefoxes.util.NMSInterface;
import net.seanomik.tamablefoxes.util.Utils;
+import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -20,9 +21,9 @@ public class NMSInterface_1_14_R1 implements NMSInterface {
try { // Replace the fox entity
Field field = EntityTypes.FOX.getClass().getDeclaredField("aZ");
FieldHelper.setField(field, EntityTypes.FOX, (EntityTypes.b) EntityTamableFox::new);
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
} catch (Exception e) {
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
e.printStackTrace();
}
}
diff --git a/1_15_R1/pom.xml b/1_15_R1/pom.xml
index f1ad010..36a68d8 100644
--- a/1_15_R1/pom.xml
+++ b/1_15_R1/pom.xml
@@ -17,10 +17,10 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
+
diff --git a/1_15_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15_R1/EntityTamableFox.java b/1_15_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15_R1/EntityTamableFox.java
index 61ebae5..9c47eac 100644
--- a/1_15_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15_R1/EntityTamableFox.java
+++ b/1_15_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15_R1/EntityTamableFox.java
@@ -320,7 +320,7 @@ public class EntityTamableFox extends EntityFox {
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
return true;
}
@@ -341,13 +341,13 @@ public class EntityTamableFox extends EntityFox {
getBukkitEntity().getWorld().spawnParticle(org.bukkit.Particle.HEART, getBukkitEntity().getLocation(), 6, 0.5D, 0.5D, 0.5D);
// Give player tamed message.
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
// Let the player choose the new fox's name if its enabled in config.
if (Config.askForNameAfterTaming()) {
Player player = (Player) entityhuman.getBukkitEntity();
- player.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
+ player.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
new AnvilGUI.Builder()
.onComplete((plr, input) -> { // Called when the inventory output slot is clicked
if (!input.equals("")) {
@@ -358,7 +358,7 @@ public class EntityTamableFox extends EntityFox {
tamableFox.setCustomName(foxName);
tamableFox.setCustomNameVisible(true);
- plr.sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
+ plr.sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
}
return AnvilGUI.Response.close();
diff --git a/1_15_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15_R1/NMSInterface_1_15_R1.java b/1_15_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15_R1/NMSInterface_1_15_R1.java
index f3402f9..4e1466e 100644
--- a/1_15_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15_R1/NMSInterface_1_15_R1.java
+++ b/1_15_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_15_R1/NMSInterface_1_15_R1.java
@@ -5,6 +5,7 @@ import net.minecraft.server.v1_15_R1.EntityTypes;
import net.seanomik.tamablefoxes.util.FieldHelper;
import net.seanomik.tamablefoxes.util.NMSInterface;
import net.seanomik.tamablefoxes.util.Utils;
+import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -20,9 +21,9 @@ public class NMSInterface_1_15_R1 implements NMSInterface {
try { // Replace the fox entity
Field field = EntityTypes.FOX.getClass().getDeclaredField("ba");
FieldHelper.setField(field, EntityTypes.FOX, (EntityTypes.b) EntityTamableFox::new);
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
} catch (Exception e) {
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
e.printStackTrace();
}
}
diff --git a/1_16_R1/pom.xml b/1_16_R1/pom.xml
index 548ad9f..b057bff 100644
--- a/1_16_R1/pom.xml
+++ b/1_16_R1/pom.xml
@@ -17,10 +17,10 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
+
diff --git a/1_16_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R1/EntityTamableFox.java b/1_16_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R1/EntityTamableFox.java
index a5bcf79..07a3608 100644
--- a/1_16_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R1/EntityTamableFox.java
+++ b/1_16_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R1/EntityTamableFox.java
@@ -323,7 +323,7 @@ public class EntityTamableFox extends EntityFox {
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
return EnumInteractionResult.SUCCESS;
}
@@ -344,13 +344,13 @@ public class EntityTamableFox extends EntityFox {
getBukkitEntity().getWorld().spawnParticle(org.bukkit.Particle.HEART, getBukkitEntity().getLocation(), 6, 0.5D, 0.5D, 0.5D);
// Give player tamed message.
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
// Let the player choose the new fox's name if its enabled in config.
if (Config.askForNameAfterTaming()) {
Player player = (Player) entityhuman.getBukkitEntity();
- player.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
+ player.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
new AnvilGUI.Builder()
.onComplete((plr, input) -> { // Called when the inventory output slot is clicked
if (!input.equals("")) {
@@ -361,7 +361,7 @@ public class EntityTamableFox extends EntityFox {
tamableFox.setCustomName(foxName);
tamableFox.setCustomNameVisible(true);
- plr.sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
+ plr.sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
}
return AnvilGUI.Response.close();
diff --git a/1_16_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R1/NMSInterface_1_16_R1.java b/1_16_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R1/NMSInterface_1_16_R1.java
index a98e311..8aa92ed 100644
--- a/1_16_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R1/NMSInterface_1_16_R1.java
+++ b/1_16_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R1/NMSInterface_1_16_R1.java
@@ -5,6 +5,7 @@ import net.minecraft.server.v1_16_R1.EntityFox;
import net.seanomik.tamablefoxes.util.FieldHelper;
import net.seanomik.tamablefoxes.util.NMSInterface;
import net.seanomik.tamablefoxes.util.Utils;
+import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -21,9 +22,9 @@ public class NMSInterface_1_16_R1 implements NMSInterface {
try { // Replace the fox entity
Field field = EntityTypes.FOX.getClass().getDeclaredField("be");
FieldHelper.setField(field, EntityTypes.FOX, (EntityTypes.b) EntityTamableFox::new);
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
} catch (Exception e) {
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
e.printStackTrace();
}
}
diff --git a/1_16_R2/pom.xml b/1_16_R2/pom.xml
index 2f99109..7243a30 100644
--- a/1_16_R2/pom.xml
+++ b/1_16_R2/pom.xml
@@ -17,10 +17,10 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
+
diff --git a/1_16_R2/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R2/EntityTamableFox.java b/1_16_R2/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R2/EntityTamableFox.java
index 9d3b80b..4274980 100644
--- a/1_16_R2/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R2/EntityTamableFox.java
+++ b/1_16_R2/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R2/EntityTamableFox.java
@@ -320,7 +320,7 @@ public class EntityTamableFox extends EntityFox {
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
return EnumInteractionResult.SUCCESS;
}
@@ -341,13 +341,13 @@ public class EntityTamableFox extends EntityFox {
getBukkitEntity().getWorld().spawnParticle(org.bukkit.Particle.HEART, getBukkitEntity().getLocation(), 6, 0.5D, 0.5D, 0.5D);
// Give player tamed message.
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
// Let the player choose the new fox's name if its enabled in config.
if (Config.askForNameAfterTaming()) {
Player player = (Player) entityhuman.getBukkitEntity();
- player.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
+ player.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
new AnvilGUI.Builder()
.onComplete((plr, input) -> { // Called when the inventory output slot is clicked
if (!input.equals("")) {
@@ -358,7 +358,7 @@ public class EntityTamableFox extends EntityFox {
tamableFox.setCustomName(foxName);
tamableFox.setCustomNameVisible(true);
- plr.sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
+ plr.sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
}
return AnvilGUI.Response.close();
diff --git a/1_16_R2/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R2/NMSInterface_1_16_R2.java b/1_16_R2/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R2/NMSInterface_1_16_R2.java
index 5c5b086..51f17b0 100644
--- a/1_16_R2/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R2/NMSInterface_1_16_R2.java
+++ b/1_16_R2/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R2/NMSInterface_1_16_R2.java
@@ -5,6 +5,7 @@ import net.minecraft.server.v1_16_R2.EntityTypes;
import net.seanomik.tamablefoxes.util.FieldHelper;
import net.seanomik.tamablefoxes.util.NMSInterface;
import net.seanomik.tamablefoxes.util.Utils;
+import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -21,9 +22,9 @@ public class NMSInterface_1_16_R2 implements NMSInterface {
try { // Replace the fox entity
Field field = EntityTypes.FOX.getClass().getDeclaredField("bf");
FieldHelper.setField(field, EntityTypes.FOX, (EntityTypes.b) EntityTamableFox::new);
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
} catch (Exception e) {
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
e.printStackTrace();
}
}
diff --git a/1_16_R3/pom.xml b/1_16_R3/pom.xml
index 3a7850b..05d38e1 100644
--- a/1_16_R3/pom.xml
+++ b/1_16_R3/pom.xml
@@ -17,10 +17,10 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
+
diff --git a/1_16_R3/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R3/EntityTamableFox.java b/1_16_R3/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R3/EntityTamableFox.java
index c636207..23efcce 100644
--- a/1_16_R3/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R3/EntityTamableFox.java
+++ b/1_16_R3/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R3/EntityTamableFox.java
@@ -321,7 +321,7 @@ public class EntityTamableFox extends EntityFox {
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
return EnumInteractionResult.SUCCESS;
}
@@ -342,13 +342,13 @@ public class EntityTamableFox extends EntityFox {
getBukkitEntity().getWorld().spawnParticle(org.bukkit.Particle.HEART, getBukkitEntity().getLocation(), 6, 0.5D, 0.5D, 0.5D);
// Give player tamed message.
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
// Let the player choose the new fox's name if its enabled in config.
if (Config.askForNameAfterTaming()) {
Player player = (Player) entityhuman.getBukkitEntity();
- player.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
+ player.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
new AnvilGUI.Builder()
.onComplete((plr, input) -> { // Called when the inventory output slot is clicked
if (!input.equals("")) {
@@ -359,7 +359,7 @@ public class EntityTamableFox extends EntityFox {
tamableFox.setCustomName(foxName);
tamableFox.setCustomNameVisible(true);
- plr.sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
+ plr.sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
}
return AnvilGUI.Response.close();
diff --git a/1_16_R3/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R3/NMSInterface_1_16_R3.java b/1_16_R3/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R3/NMSInterface_1_16_R3.java
index d76e8b7..91a3ffb 100644
--- a/1_16_R3/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R3/NMSInterface_1_16_R3.java
+++ b/1_16_R3/src/main/java/net/seanomik/tamablefoxes/versions/version_1_16_R3/NMSInterface_1_16_R3.java
@@ -5,6 +5,7 @@ import net.minecraft.server.v1_16_R3.EntityTypes;
import net.seanomik.tamablefoxes.util.FieldHelper;
import net.seanomik.tamablefoxes.util.NMSInterface;
import net.seanomik.tamablefoxes.util.Utils;
+import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -21,9 +22,9 @@ public class NMSInterface_1_16_R3 implements NMSInterface {
try { // Replace the fox entity
Field field = EntityTypes.FOX.getClass().getDeclaredField("bf");
FieldHelper.setField(field, EntityTypes.FOX, (EntityTypes.b) EntityTamableFox::new);
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
} catch (Exception e) {
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
e.printStackTrace();
}
}
diff --git a/1_17_R1/pom.xml b/1_17_R1/pom.xml
index 6b7c740..e60028b 100644
--- a/1_17_R1/pom.xml
+++ b/1_17_R1/pom.xml
@@ -17,10 +17,10 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
+
diff --git a/1_17_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_17_R1/EntityTamableFox.java b/1_17_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_17_R1/EntityTamableFox.java
index 3ad8f4c..c07850c 100644
--- a/1_17_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_17_R1/EntityTamableFox.java
+++ b/1_17_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_17_R1/EntityTamableFox.java
@@ -382,7 +382,7 @@ public class EntityTamableFox extends EntityFox {
SQLiteHelper sqLiteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
int maxTameCount = Config.getMaxPlayerFoxTames();
if ( !((Player) entityhuman.getBukkitEntity()).hasPermission("tamablefoxes.tame.unlimited") && maxTameCount > 0 && sqLiteHelper.getPlayerFoxAmount(entityhuman.getUniqueID()) >= maxTameCount) {
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFoxDoesntTrust());
return EnumInteractionResult.a;
}
@@ -403,11 +403,11 @@ public class EntityTamableFox extends EntityFox {
getBukkitEntity().getWorld().spawnParticle(org.bukkit.Particle.HEART, getBukkitEntity().getLocation(), 6, 0.5D, 0.5D, 0.5D);
// Give player tamed message.
- ((Player) entityhuman.getBukkitEntity()).sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
+ ((Player) entityhuman.getBukkitEntity()).sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamedMessage());
// Let the player choose the new fox's name if its enabled in config.
if (Config.askForNameAfterTaming()) {
- player.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
+ player.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getTamingAskingName());
new AnvilGUI.Builder()
.onComplete((plr, input) -> { // Called when the inventory output slot is clicked
if (!input.equals("")) {
@@ -418,7 +418,7 @@ public class EntityTamableFox extends EntityFox {
tamableFox.setCustomName(foxName);
tamableFox.setCustomNameVisible(true);
- plr.sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
+ plr.sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getTamingChosenPerfect(input));
}
return AnvilGUI.Response.close();
diff --git a/1_17_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_17_R1/NMSInterface_1_17_R1.java b/1_17_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_17_R1/NMSInterface_1_17_R1.java
index d6d43fe..0cf7f7b 100644
--- a/1_17_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_17_R1/NMSInterface_1_17_R1.java
+++ b/1_17_R1/src/main/java/net/seanomik/tamablefoxes/versions/version_1_17_R1/NMSInterface_1_17_R1.java
@@ -5,6 +5,7 @@ import net.minecraft.world.entity.animal.EntityFox;
import net.seanomik.tamablefoxes.util.FieldHelper;
import net.seanomik.tamablefoxes.util.NMSInterface;
import net.seanomik.tamablefoxes.util.Utils;
+import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -27,9 +28,9 @@ public class NMSInterface_1_17_R1 implements NMSInterface {
EntityTypes type = method.invoke(null, "fox", EntityTypes.Builder.a(EntityTamableFox::new, EnumCreatureType.C))*/
FieldHelper.setField(field, EntityTypes.E, (EntityTypes.b) EntityTamableFox::new);
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
} catch (Exception e) {
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
e.printStackTrace();
}
}
diff --git a/AnvilGUI b/AnvilGUI
new file mode 160000
index 0000000..802f1d1
--- /dev/null
+++ b/AnvilGUI
@@ -0,0 +1 @@
+Subproject commit 802f1d18b9ecb6f8f9dc699bff4adc187cfdee28
diff --git a/Plugin/pom.xml b/Plugin/pom.xml
index e5dfba4..8a5c53a 100644
--- a/Plugin/pom.xml
+++ b/Plugin/pom.xml
@@ -73,10 +73,10 @@
sonatype
https://oss.sonatype.org/content/groups/public/
-
+
diff --git a/Plugin/src/main/java/net/seanomik/tamablefoxes/CommandSpawnTamableFox.java b/Plugin/src/main/java/net/seanomik/tamablefoxes/CommandSpawnTamableFox.java
index 8db8eb0..82850fd 100644
--- a/Plugin/src/main/java/net/seanomik/tamablefoxes/CommandSpawnTamableFox.java
+++ b/Plugin/src/main/java/net/seanomik/tamablefoxes/CommandSpawnTamableFox.java
@@ -2,6 +2,7 @@ package net.seanomik.tamablefoxes;
import net.seanomik.tamablefoxes.util.NMSInterface;
import net.seanomik.tamablefoxes.util.Utils;
+import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
@@ -24,12 +25,12 @@ public class CommandSpawnTamableFox implements TabExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
- sender.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getOnlyRunPlayer());
+ sender.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getOnlyRunPlayer());
return true;
}
if (!sender.hasPermission("tamablefoxes.spawntamablefox")) {
- sender.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getNoPermMessage());
+ sender.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getNoPermMessage());
return true;
}
@@ -39,25 +40,25 @@ public class CommandSpawnTamableFox implements TabExecutor {
case "red":
try {
plugin.nmsInterface.spawnTamableFox(player.getLocation(), NMSInterface.FoxType.RED);
- player.sendMessage(Utils.getPrefix() + ChatColor.RESET + LanguageConfig.getSpawnedFoxMessage(NMSInterface.FoxType.RED));
+ player.sendMessage(Config.getPrefix() + ChatColor.RESET + LanguageConfig.getSpawnedFoxMessage(NMSInterface.FoxType.RED));
} catch (Exception e) {
e.printStackTrace();
- player.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFailureSpawn());
+ player.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureSpawn());
}
break;
case "snow":
try {
plugin.nmsInterface.spawnTamableFox(player.getLocation(), NMSInterface.FoxType.SNOW);
- player.sendMessage(Utils.getPrefix() + ChatColor.RESET + LanguageConfig.getSpawnedFoxMessage(NMSInterface.FoxType.SNOW));
+ player.sendMessage(Config.getPrefix() + ChatColor.RESET + LanguageConfig.getSpawnedFoxMessage(NMSInterface.FoxType.SNOW));
} catch (Exception e) {
e.printStackTrace();
- player.sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFailureSpawn());
+ player.sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureSpawn());
}
break;
case "reload":
plugin.reloadConfig();
LanguageConfig.getConfig(plugin).reloadConfig();
- player.sendMessage(Utils.getPrefix() + ChatColor.GREEN + LanguageConfig.getReloadMessage());
+ player.sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getReloadMessage());
break;
default:
player.sendMessage(ChatColor.RED + "/spawntamablefox " + ChatColor.GRAY + "[red | snow | reload]");
diff --git a/Plugin/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java b/Plugin/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java
index 3e8e8af..bfe02bd 100644
--- a/Plugin/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java
+++ b/Plugin/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java
@@ -52,14 +52,14 @@ public final class TamableFoxes extends JavaPlugin implements Listener {
nmsInterface = new NMSInterface_1_17_R1();
break;
default:
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getUnsupportedMCVersionRegister());
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + "You're trying to run MC version " + version + " which is not supported!");
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getUnsupportedMCVersionRegister());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + "You're trying to run MC version " + version + " which is not supported!");
versionSupported = false;
return;
}
// Display starting message then register entity.
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.YELLOW + LanguageConfig.getMCVersionLoading(version));
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.YELLOW + LanguageConfig.getMCVersionLoading(version));
nmsInterface.registerCustomFoxEntity();
if (Config.getMaxPlayerFoxTames() != 0) {
@@ -70,7 +70,7 @@ public final class TamableFoxes extends JavaPlugin implements Listener {
@Override
public void onEnable() {
if (!versionSupported) {
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getUnsupportedMCVersionDisable());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getUnsupportedMCVersionDisable());
getServer().getPluginManager().disablePlugin(this);
return;
}
@@ -85,7 +85,7 @@ public final class TamableFoxes extends JavaPlugin implements Listener {
@Override
public void onDisable() {
- getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.YELLOW + LanguageConfig.getSavingFoxMessage());
+ getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.YELLOW + LanguageConfig.getSavingFoxMessage());
}
public static TamableFoxes getPlugin() {
diff --git a/Plugin/src/main/resources/config.yml b/Plugin/src/main/resources/config.yml
index 2c2faf2..ed7b948 100644
--- a/Plugin/src/main/resources/config.yml
+++ b/Plugin/src/main/resources/config.yml
@@ -2,6 +2,7 @@
show-owner-in-fox-name: true
ask-for-name-after-taming: true
max-fox-tames: 0
+prefix: "&c[Tamable Foxes] "
tamed-behavior:
attack-wild-animals: true
\ No newline at end of file
diff --git a/README.md b/README.md
index 1e5319e..d320263 100644
--- a/README.md
+++ b/README.md
@@ -9,11 +9,13 @@ SpigotMC Plugin that gives you the ability to tame foxes!
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
```
+### Default Config
+
If you get any errors, create an issue!
Have you ever wanted to tame foxes? Well, now you can! Use chicken to tame and sweet berries to breed them!
-Features:
+### Features:
* 33% Chance of taming
* Breeding
* Wild foxes pick berry bushes
@@ -32,12 +34,11 @@ Features:
* Language.yml
* Message for when a tamed fox dies
-Commands:
+### Commands:
* /spawntamablefox [red/snow]: Spawns a tamable fox at the players location.
-
-Permissions:
+### Permissions:
* tamablefoxes.spawn: Gives permission to run the command /spawntamablefox. Default: `op`
* tamablefoxes.tame: Gives the player the ability to tame a fox. Default: `Everybody`
* tamablefoxes.tame.unlimited: Lets players bypass the tame limit. Default: `op`
diff --git a/Utility/src/main/java/net/seanomik/tamablefoxes/util/FieldHelper.java b/Utility/src/main/java/net/seanomik/tamablefoxes/util/FieldHelper.java
index 288cd16..d168d38 100644
--- a/Utility/src/main/java/net/seanomik/tamablefoxes/util/FieldHelper.java
+++ b/Utility/src/main/java/net/seanomik/tamablefoxes/util/FieldHelper.java
@@ -1,5 +1,6 @@
package net.seanomik.tamablefoxes.util;
+import net.seanomik.tamablefoxes.util.io.Config;
import net.seanomik.tamablefoxes.util.io.LanguageConfig;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@@ -39,7 +40,7 @@ public final class FieldHelper {
fieldMutable.setAccessible(false);
}
} catch (NoSuchFieldException | IllegalAccessException e) {
- Bukkit.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
+ Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
e.printStackTrace();
}
} else {
diff --git a/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/Config.java b/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/Config.java
index 275d9df..b8b7c91 100644
--- a/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/Config.java
+++ b/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/Config.java
@@ -1,5 +1,6 @@
package net.seanomik.tamablefoxes.util.io;
+import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
@@ -27,4 +28,8 @@ public class Config {
// Check if the plugin asks for a fox name after taming.
public static boolean askForNameAfterTaming() { return config.getBoolean("ask-for-name-after-taming"); }
+
+ public static String getPrefix() {
+ return ChatColor.translateAlternateColorCodes('&', config.contains("prefix") ? config.getString("prefix") : "&c[Tamable Foxes] ");
+ }
}
diff --git a/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/sqlite/SQLiteHelper.java b/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/sqlite/SQLiteHelper.java
index 816ee51..892c91d 100644
--- a/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/sqlite/SQLiteHelper.java
+++ b/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/sqlite/SQLiteHelper.java
@@ -1,6 +1,7 @@
package net.seanomik.tamablefoxes.util.io.sqlite;
import net.seanomik.tamablefoxes.util.Utils;
+import net.seanomik.tamablefoxes.util.io.Config;
import org.bukkit.plugin.Plugin;
import java.sql.DatabaseMetaData;
@@ -42,7 +43,7 @@ public class SQLiteHelper {
PreparedStatement statement = sqLiteHandler.getConnection().prepareStatement(userFoxAmountQuery);
statement.executeUpdate();
- plugin.getServer().getConsoleSender().sendMessage(Utils.getPrefix() + "Created previous player bans table!");
+ plugin.getServer().getConsoleSender().sendMessage(Config.getPrefix() + "Created previous player bans table!");
}
} catch (SQLException e) {
e.printStackTrace();
diff --git a/pom.xml b/pom.xml
index 73b4eb9..0c96b77 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,6 +18,7 @@
1_16_R1
1_15_R1
1_14_R1
+ AnvilGUI