diff --git a/.gitignore b/.gitignore index 1b26172d4..8e1520400 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,27 @@ -/target - # Ignore IDEA files /.idea *.iml /bin/ + +# Eclipse files +/.settings/ +*.project +*.classpath +*.recommenders + +# NetBeans files +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ + +# Maven files +/target + +# Java files +*.class +*.log +*.ctxt +hs_err_pid* \ No newline at end of file diff --git a/pom.xml b/pom.xml index fd96fe693..cb6a26c59 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ me.blackvein.quests quests - 2.8.2 + 2.8.2-04 quests https://github.com/FlyingPikachu/Quests/ jar @@ -165,6 +165,7 @@ plugin.yml events.yml quests.yml + data.yml diff --git a/src/main/java/me/blackvein/particles/Eff_1_10_R1.java b/src/main/java/me/blackvein/particles/Eff_1_10_R1.java index f60485c19..acb2f7386 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_10_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_10_R1.java @@ -1,13 +1,12 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_10_R1.EnumParticle; -import net.minecraft.server.v1_10_R1.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_10_R1.EnumParticle; +import net.minecraft.server.v1_10_R1.PacketPlayOutWorldParticles; + public enum Eff_1_10_R1 { @@ -67,17 +66,17 @@ public enum Eff_1_10_R1 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleEnum); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); - ReflectionUtil.setValue(packet, "k", data); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, + false, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count, + data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/particles/Eff_1_11_R1.java b/src/main/java/me/blackvein/particles/Eff_1_11_R1.java index 6ec18d916..78c68befa 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_11_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_11_R1.java @@ -1,13 +1,12 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_11_R1.EnumParticle; -import net.minecraft.server.v1_11_R1.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_11_R1.EnumParticle; +import net.minecraft.server.v1_11_R1.PacketPlayOutWorldParticles; + public enum Eff_1_11_R1 { @@ -69,17 +68,17 @@ public enum Eff_1_11_R1 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleEnum); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); - ReflectionUtil.setValue(packet, "k", data); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, + false, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count, + data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/particles/Eff_1_12_R1.java b/src/main/java/me/blackvein/particles/Eff_1_12_R1.java index edd8bf195..6f4b60c74 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_12_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_12_R1.java @@ -1,13 +1,12 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_12_R1.EnumParticle; -import net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_12_R1.EnumParticle; +import net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles; + public enum Eff_1_12_R1 { @@ -69,17 +68,17 @@ public enum Eff_1_12_R1 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleEnum); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); - ReflectionUtil.setValue(packet, "k", data); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, + false, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count, + data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/particles/Eff_1_7_R3.java b/src/main/java/me/blackvein/particles/Eff_1_7_R3.java index cca83f067..4ff0a2e2d 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_7_R3.java +++ b/src/main/java/me/blackvein/particles/Eff_1_7_R3.java @@ -1,12 +1,11 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles; + public enum Eff_1_7_R3 { HUGE_EXPLOSION("hugeexplosion"), @@ -52,16 +51,15 @@ public enum Eff_1_7_R3 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleName); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleName, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/particles/Eff_1_7_R4.java b/src/main/java/me/blackvein/particles/Eff_1_7_R4.java index afc01f1fb..c8d368daa 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_7_R4.java +++ b/src/main/java/me/blackvein/particles/Eff_1_7_R4.java @@ -1,12 +1,11 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles; + public enum Eff_1_7_R4 { HUGE_EXPLOSION("hugeexplosion"), @@ -52,16 +51,15 @@ public enum Eff_1_7_R4 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleName); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleName, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/particles/Eff_1_8_R1.java b/src/main/java/me/blackvein/particles/Eff_1_8_R1.java index c07521a4d..36720353c 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_8_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_8_R1.java @@ -1,13 +1,12 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_8_R1.EnumParticle; -import net.minecraft.server.v1_8_R1.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_8_R1.EnumParticle; +import net.minecraft.server.v1_8_R1.PacketPlayOutWorldParticles; + public enum Eff_1_8_R1 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -60,17 +59,17 @@ public enum Eff_1_8_R1 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleEnum); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); - ReflectionUtil.setValue(packet, "k", data); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, + false, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count, + data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/particles/Eff_1_8_R2.java b/src/main/java/me/blackvein/particles/Eff_1_8_R2.java index 0d48e019f..8bf1c5e2d 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_8_R2.java +++ b/src/main/java/me/blackvein/particles/Eff_1_8_R2.java @@ -1,13 +1,12 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_8_R2.EnumParticle; -import net.minecraft.server.v1_8_R2.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_8_R2.EnumParticle; +import net.minecraft.server.v1_8_R2.PacketPlayOutWorldParticles; + public enum Eff_1_8_R2 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -60,17 +59,17 @@ public enum Eff_1_8_R2 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleEnum); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); - ReflectionUtil.setValue(packet, "k", data); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, + false, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count, + data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/particles/Eff_1_8_R3.java b/src/main/java/me/blackvein/particles/Eff_1_8_R3.java index 6ed29fbe3..28c75bfde 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_8_R3.java +++ b/src/main/java/me/blackvein/particles/Eff_1_8_R3.java @@ -1,13 +1,12 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_8_R3.EnumParticle; -import net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_8_R3.EnumParticle; +import net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles; + public enum Eff_1_8_R3 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -60,17 +59,17 @@ public enum Eff_1_8_R3 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleEnum); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); - ReflectionUtil.setValue(packet, "k", data); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, + false, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count, + data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/particles/Eff_1_9_R1.java b/src/main/java/me/blackvein/particles/Eff_1_9_R1.java index 97b3658ca..10cccde94 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_9_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_9_R1.java @@ -1,13 +1,12 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_9_R1.EnumParticle; -import net.minecraft.server.v1_9_R1.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_9_R1.EnumParticle; +import net.minecraft.server.v1_9_R1.PacketPlayOutWorldParticles; + public enum Eff_1_9_R1 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -64,17 +63,17 @@ public enum Eff_1_9_R1 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleEnum); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); - ReflectionUtil.setValue(packet, "k", data); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, + false, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count, + data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/particles/Eff_1_9_R2.java b/src/main/java/me/blackvein/particles/Eff_1_9_R2.java index ce8e4ab0a..db55891cd 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_9_R2.java +++ b/src/main/java/me/blackvein/particles/Eff_1_9_R2.java @@ -1,13 +1,12 @@ package me.blackvein.particles; -import me.blackvein.quests.util.ReflectionUtil; -import net.minecraft.server.v1_9_R2.EnumParticle; -import net.minecraft.server.v1_9_R2.PacketPlayOutWorldParticles; - import org.bukkit.Location; import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer; import org.bukkit.entity.Player; +import net.minecraft.server.v1_9_R2.EnumParticle; +import net.minecraft.server.v1_9_R2.PacketPlayOutWorldParticles; + public enum Eff_1_9_R2 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -64,17 +63,17 @@ public enum Eff_1_9_R2 { } public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { - PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); - ReflectionUtil.setValue(packet, "a", particleEnum); - ReflectionUtil.setValue(packet, "b", (float) location.getX()); - ReflectionUtil.setValue(packet, "c", (float) location.getY()); - ReflectionUtil.setValue(packet, "d", (float) location.getZ()); - ReflectionUtil.setValue(packet, "e", offsetX); - ReflectionUtil.setValue(packet, "f", offsetY); - ReflectionUtil.setValue(packet, "g", offsetZ); - ReflectionUtil.setValue(packet, "h", speed); - ReflectionUtil.setValue(packet, "i", count); - ReflectionUtil.setValue(packet, "k", data); + PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, + false, + (float) location.getX(), + (float) location.getY(), + (float) location.getZ(), + offsetX, + offsetY, + offsetZ, + speed, + count, + data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); } diff --git a/src/main/java/me/blackvein/quests/ColorUtil.java b/src/main/java/me/blackvein/quests/ColorUtil.java deleted file mode 100644 index 2f47aed90..000000000 --- a/src/main/java/me/blackvein/quests/ColorUtil.java +++ /dev/null @@ -1,30 +0,0 @@ -package me.blackvein.quests; - -import org.bukkit.ChatColor; - -public interface ColorUtil { - - static final ChatColor BOLD = ChatColor.BOLD; - static final ChatColor ITALIC = ChatColor.ITALIC; - static final ChatColor UNDERLINE = ChatColor.UNDERLINE; - static final ChatColor STRIKETHROUGH = ChatColor.STRIKETHROUGH; - static final ChatColor MAGIC = ChatColor.MAGIC; - static final ChatColor RESET = ChatColor.RESET; - static final ChatColor WHITE = ChatColor.WHITE; - static final ChatColor BLACK = ChatColor.BLACK; - static final ChatColor AQUA = ChatColor.AQUA; - static final ChatColor DARKAQUA = ChatColor.DARK_AQUA; - static final ChatColor BLUE = ChatColor.BLUE; - static final ChatColor DARKBLUE = ChatColor.DARK_BLUE; - static final ChatColor GOLD = ChatColor.GOLD; - static final ChatColor GRAY = ChatColor.GRAY; - static final ChatColor DARKGRAY = ChatColor.DARK_GRAY; - static final ChatColor PINK = ChatColor.LIGHT_PURPLE; - static final ChatColor PURPLE = ChatColor.DARK_PURPLE; - static final ChatColor GREEN = ChatColor.GREEN; - static final ChatColor DARKGREEN = ChatColor.DARK_GREEN; - static final ChatColor RED = ChatColor.RED; - static final ChatColor DARKRED = ChatColor.DARK_RED; - static final ChatColor YELLOW = ChatColor.YELLOW; - -} diff --git a/src/main/java/me/blackvein/quests/EventFactory.java b/src/main/java/me/blackvein/quests/EventFactory.java index 7df695b6f..317df668d 100644 --- a/src/main/java/me/blackvein/quests/EventFactory.java +++ b/src/main/java/me/blackvein/quests/EventFactory.java @@ -1,7 +1,5 @@ package me.blackvein.quests; -import me.blackvein.quests.util.ColorUtil; - import java.io.File; import java.io.IOException; import java.util.Arrays; @@ -12,14 +10,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.UUID; -import me.blackvein.quests.prompts.ItemStackPrompt; -import me.blackvein.quests.util.CK; -import me.blackvein.quests.util.ItemUtil; -import me.blackvein.quests.util.Lang; -import me.blackvein.quests.util.MiscUtil; -import me.blackvein.quests.util.QuestMob; -import net.citizensnpcs.api.CitizensAPI; - import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.Effect; @@ -44,7 +34,15 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -public class EventFactory implements ConversationAbandonedListener, ColorUtil { +import me.blackvein.quests.prompts.ItemStackPrompt; +import me.blackvein.quests.util.CK; +import me.blackvein.quests.util.ItemUtil; +import me.blackvein.quests.util.Lang; +import me.blackvein.quests.util.MiscUtil; +import me.blackvein.quests.util.QuestMob; +import net.citizensnpcs.api.CitizensAPI; + +public class EventFactory implements ConversationAbandonedListener { Quests quests; Map editSessions = new HashMap(); @@ -107,11 +105,11 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text - = GOLD + Lang.get("eventEditorTitle") + "\n" - + BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorCreate") + "\n" - + BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorEdit") + "\n" - + BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorDelete") + "\n" - + GREEN + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("exit"); + = ChatColor.GOLD + Lang.get("eventEditorTitle") + "\n" + + ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorCreate") + "\n" + + ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorEdit") + "\n" + + ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorDelete") + "\n" + + ChatColor.GREEN + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("exit"); return text; @@ -128,7 +126,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { context.setSessionData(CK.E_OLD_EVENT, ""); return new EventNamePrompt(); } else { - player.sendMessage(RED + Lang.get("eventEditorCreatePermisssions")); + player.sendMessage(ChatColor.RED + Lang.get("eventEditorCreatePermisssions")); return new MenuPrompt(); } @@ -137,7 +135,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (player.hasPermission("quests.editor.events.edit")) { if (quests.events.isEmpty()) { - ((Player) context.getForWhom()).sendMessage(YELLOW + Lang.get("eventEditorNoneToEdit")); + ((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW + Lang.get("eventEditorNoneToEdit")); return new MenuPrompt(); } else { return new SelectEditPrompt(); @@ -145,7 +143,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { } else { - player.sendMessage(RED + Lang.get("eventEditorEditPermisssions")); + player.sendMessage(ChatColor.RED + Lang.get("eventEditorEditPermisssions")); return new MenuPrompt(); } @@ -154,7 +152,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (player.hasPermission("quests.editor.events.delete")) { if (quests.events.isEmpty()) { - ((Player) context.getForWhom()).sendMessage(YELLOW + Lang.get("eventEditorNoneToDelete")); + ((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW + Lang.get("eventEditorNoneToDelete")); return new MenuPrompt(); } else { return new SelectDeletePrompt(); @@ -162,13 +160,13 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { } else { - player.sendMessage(RED + Lang.get("eventEditorDeletePermisssions")); + player.sendMessage(ChatColor.RED + Lang.get("eventEditorDeletePermisssions")); return new MenuPrompt(); } } else if (input.equalsIgnoreCase("4")) { - ((Player) context.getForWhom()).sendMessage(YELLOW + Lang.get("exited")); + ((Player) context.getForWhom()).sendMessage(ChatColor.YELLOW + Lang.get("exited")); return Prompt.END_OF_CONVERSATION; } @@ -360,14 +358,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + "- " + Lang.get("eventEditorEdit") + " -\n"; + String text = ChatColor.GOLD + "- " + Lang.get("eventEditorEdit") + " -\n"; for (Event evt : quests.events) { - text += AQUA + evt.name + YELLOW + ", "; + text += ChatColor.AQUA + evt.name + ChatColor.YELLOW + ", "; } text = text.substring(0, text.length() - 2) + "\n"; - text += YELLOW + Lang.get("eventEditorEnterEventName"); + text += ChatColor.YELLOW + Lang.get("eventEditorEnterEventName"); return text; @@ -389,7 +387,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { } - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("eventEditorNotFound")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("eventEditorNotFound")); return new SelectEditPrompt(); } else { @@ -405,14 +403,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + "- " + Lang.get("eventEditorDelete") + " -\n"; + String text = ChatColor.GOLD + "- " + Lang.get("eventEditorDelete") + " -\n"; for (Event evt : quests.events) { - text += AQUA + evt.name + YELLOW + ","; + text += ChatColor.AQUA + evt.name + ChatColor.YELLOW + ","; } text = text.substring(0, text.length() - 1) + "\n"; - text += YELLOW + Lang.get("eventEditorEnterEventName"); + text += ChatColor.YELLOW + Lang.get("eventEditorEnterEventName"); return text; @@ -446,18 +444,18 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { context.setSessionData(CK.ED_EVENT_DELETE, evt.name); return new DeletePrompt(); } else { - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("eventEditorEventInUse") + " \"" + PURPLE + evt.name + RED + "\":"); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("eventEditorEventInUse") + " \"" + ChatColor.DARK_PURPLE + evt.name + ChatColor.RED + "\":"); for (String s : used) { - ((Player) context.getForWhom()).sendMessage(RED + "- " + DARKRED + s); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + "- " + ChatColor.DARK_RED + s); } - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("eventEditorMustModifyQuests")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("eventEditorMustModifyQuests")); return new SelectDeletePrompt(); } } } - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("eventEditorNotFound")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("eventEditorNotFound")); return new SelectDeletePrompt(); } else { @@ -474,8 +472,8 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text - = RED + Lang.get("eventEditorDeletePrompt") + " \"" + GOLD + (String) context.getSessionData(CK.ED_EVENT_DELETE) + RED + "\"?\n"; - text += YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord"); + = ChatColor.RED + Lang.get("eventEditorDeletePrompt") + " \"" + ChatColor.GOLD + (String) context.getSessionData(CK.ED_EVENT_DELETE) + ChatColor.RED + "\"?\n"; + text += ChatColor.YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord"); return text; @@ -510,14 +508,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text - = GOLD + "- " + Lang.get("event") + ": " + AQUA + context.getSessionData(CK.E_NAME) + GOLD + " -\n"; + = ChatColor.GOLD + "- " + Lang.get("event") + ": " + ChatColor.AQUA + context.getSessionData(CK.E_NAME) + ChatColor.GOLD + " -\n"; - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetName") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetName") + "\n"; if (context.getSessionData(CK.E_MESSAGE) == null) { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMessage") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMessage") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMessage") + "(" + AQUA + "\"" + context.getSessionData(CK.E_MESSAGE) + "\"" + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMessage") + "(" + ChatColor.AQUA + "\"" + context.getSessionData(CK.E_MESSAGE) + "\"" + ChatColor.YELLOW + ")\n"; } if (context.getSessionData(CK.E_CLEAR_INVENTORY) == null) { @@ -528,100 +526,100 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { context.setSessionData(CK.E_FAIL_QUEST, "No"); } - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorClearInv") + ": " + AQUA + context.getSessionData(CK.E_CLEAR_INVENTORY) + "\n"; - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("eventEditorFailQuest") + ": " + AQUA + context.getSessionData(CK.E_FAIL_QUEST) + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorClearInv") + ": " + ChatColor.AQUA + context.getSessionData(CK.E_CLEAR_INVENTORY) + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorFailQuest") + ": " + ChatColor.AQUA + context.getSessionData(CK.E_FAIL_QUEST) + "\n"; if (context.getSessionData(CK.E_ITEMS) == null) { - text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("eventEditorSetItems") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetItems") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("eventEditorSetItems") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetItems") + "\n"; LinkedList items = (LinkedList) context.getSessionData(CK.E_ITEMS); for (ItemStack is : items) { - text += GRAY + " - " + ItemUtil.getString(is) + "\n"; + text += ChatColor.GRAY + " - " + ItemUtil.getString(is) + "\n"; } } if (context.getSessionData(CK.E_EXPLOSIONS) == null) { - text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("eventEditorSetExplosions") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetExplosions") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("eventEditorSetExplosions") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetExplosions") + "\n"; LinkedList locations = (LinkedList) context.getSessionData(CK.E_EXPLOSIONS); for (String loc : locations) { - text += GRAY + " - " + AQUA + loc + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.AQUA + loc + "\n"; } } if (context.getSessionData(CK.E_EFFECTS) == null) { - text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("eventEditorSetEffects") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetEffects") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("eventEditorSetEffects") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetEffects") + "\n"; LinkedList effects = (LinkedList) context.getSessionData(CK.E_EFFECTS); LinkedList locations = (LinkedList) context.getSessionData(CK.E_EFFECTS_LOCATIONS); for (String effect : effects) { - text += GRAY + " - " + AQUA + effect + GRAY + " at " + DARKAQUA + locations.get(effects.indexOf(effect)) + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.AQUA + effect + ChatColor.GRAY + " at " + ChatColor.DARK_AQUA + locations.get(effects.indexOf(effect)) + "\n"; } } if (context.getSessionData(CK.E_WORLD_STORM) == null) { - text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("eventEditorSetStorm") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetStorm") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("eventEditorSetStorm") + " (" + AQUA + (String) context.getSessionData(CK.E_WORLD_STORM) + YELLOW + " -> " + DARKAQUA + Quests.getTime((Long) context.getSessionData(CK.E_WORLD_STORM_DURATION)) + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetStorm") + " (" + ChatColor.AQUA + (String) context.getSessionData(CK.E_WORLD_STORM) + ChatColor.YELLOW + " -> " + ChatColor.DARK_AQUA + Quests.getTime((Long) context.getSessionData(CK.E_WORLD_STORM_DURATION)) + ChatColor.YELLOW + ")\n"; } if (context.getSessionData(CK.E_WORLD_THUNDER) == null) { - text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("eventEditorSetThunder") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetThunder") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("eventEditorSetThunder") + " (" + AQUA + (String) context.getSessionData(CK.E_WORLD_THUNDER) + YELLOW + " -> " + DARKAQUA + Quests.getTime((Long) context.getSessionData(CK.E_WORLD_THUNDER_DURATION)) + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetThunder") + " (" + ChatColor.AQUA + (String) context.getSessionData(CK.E_WORLD_THUNDER) + ChatColor.YELLOW + " -> " + ChatColor.DARK_AQUA + Quests.getTime((Long) context.getSessionData(CK.E_WORLD_THUNDER_DURATION)) + ChatColor.YELLOW + ")\n"; } if (context.getSessionData(CK.E_MOB_TYPES) == null) { - text += BLUE + "" + BOLD + "10" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobSpawns") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "10" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobSpawns") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { LinkedList types = (LinkedList) context.getSessionData(CK.E_MOB_TYPES); - text += BLUE + "" + BOLD + "10" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobSpawns") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "10" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobSpawns") + "\n"; for (String s : types) { QuestMob qm = QuestMob.fromString(s); - text += GRAY + " - " + AQUA + qm.getType().name() + ((qm.getName() != null) ? ": " + qm.getName() : "") + GRAY + " x " + DARKAQUA + qm.getSpawnAmounts() + GRAY + " -> " + GREEN + Quests.getLocationInfo(qm.getSpawnLocation()) + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.AQUA + qm.getType().name() + ((qm.getName() != null) ? ": " + qm.getName() : "") + ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + qm.getSpawnAmounts() + ChatColor.GRAY + " -> " + ChatColor.GREEN + Quests.getLocationInfo(qm.getSpawnLocation()) + "\n"; } } if (context.getSessionData(CK.E_LIGHTNING) == null) { - text += BLUE + "" + BOLD + "11" + RESET + YELLOW + " - " + Lang.get("eventEditorSetLightning") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetLightning") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "11" + RESET + YELLOW + " - " + Lang.get("eventEditorSetLightning") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetLightning") + "\n"; LinkedList locations = (LinkedList) context.getSessionData(CK.E_LIGHTNING); for (String loc : locations) { - text += GRAY + " - " + AQUA + loc + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.AQUA + loc + "\n"; } } if (context.getSessionData(CK.E_POTION_TYPES) == null) { - text += BLUE + "" + BOLD + "12" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionEffects") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "12" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetPotionEffects") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "12" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionEffects") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "12" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetPotionEffects") + "\n"; LinkedList types = (LinkedList) context.getSessionData(CK.E_POTION_TYPES); LinkedList durations = (LinkedList) context.getSessionData(CK.E_POTION_DURATIONS); LinkedList mags = (LinkedList) context.getSessionData(CK.E_POTION_STRENGHT); @@ -630,57 +628,57 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { for (String type : types) { index++; - text += GRAY + " - " + AQUA + type + PURPLE + " " + Quests.getNumeral(mags.get(index)) + GRAY + " -> " + DARKAQUA + Quests.getTime(durations.get(index) * 50L) + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.AQUA + type + ChatColor.DARK_PURPLE + " " + Quests.getNumeral(mags.get(index)) + ChatColor.GRAY + " -> " + ChatColor.DARK_AQUA + Quests.getTime(durations.get(index) * 50L) + "\n"; } } if (context.getSessionData(CK.E_HUNGER) == null) { - text += BLUE + "" + BOLD + "13" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHunger") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "13" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetHunger") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "13" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHunger") + AQUA + " (" + (Integer) context.getSessionData(CK.E_HUNGER) + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "13" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetHunger") + ChatColor.AQUA + " (" + (Integer) context.getSessionData(CK.E_HUNGER) + ")\n"; } if (context.getSessionData(CK.E_SATURATION) == null) { - text += BLUE + "" + BOLD + "14" + RESET + YELLOW + " - " + Lang.get("eventEditorSetSaturation") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "14" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetSaturation") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "14" + RESET + YELLOW + " - " + Lang.get("eventEditorSetSaturation") + AQUA + " (" + (Integer) context.getSessionData(CK.E_SATURATION) + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "14" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetSaturation") + ChatColor.AQUA + " (" + (Integer) context.getSessionData(CK.E_SATURATION) + ")\n"; } if (context.getSessionData(CK.E_HEALTH) == null) { - text += BLUE + "" + BOLD + "15" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHealth") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "15" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetHealth") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "15" + RESET + YELLOW + " - " + Lang.get("eventEditorSetHealth") + AQUA + " (" + (Integer) context.getSessionData(CK.E_HEALTH) + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "15" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetHealth") + ChatColor.AQUA + " (" + (Integer) context.getSessionData(CK.E_HEALTH) + ")\n"; } if (context.getSessionData(CK.E_TELEPORT) == null) { - text += BLUE + "" + BOLD + "16" + RESET + YELLOW + " - " + Lang.get("eventEditorSetTeleport") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "16" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetTeleport") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "16" + RESET + YELLOW + " - " + Lang.get("eventEditorSetTeleport") + AQUA + " (" + (String) context.getSessionData(CK.E_TELEPORT) + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "16" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetTeleport") + ChatColor.AQUA + " (" + (String) context.getSessionData(CK.E_TELEPORT) + ")\n"; } if (context.getSessionData(CK.E_COMMANDS) == null) { - text += BLUE + "" + BOLD + "17" + RESET + YELLOW + " - " + Lang.get("eventEditorSetCommands") + GRAY + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "17" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetCommands") + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "17" + RESET + YELLOW + " - " + Lang.get("eventEditorSetCommands") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "17" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetCommands") + "\n"; for (String s : (LinkedList) context.getSessionData(CK.E_COMMANDS)) { - text += GRAY + " - " + AQUA + s + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n"; } } - text += GREEN + "" + BOLD + "18" + RESET + YELLOW + " - " + Lang.get("done") + "\n"; - text += RED + "" + BOLD + "19" + RESET + YELLOW + " - " + Lang.get("quit"); + text += ChatColor.GREEN + "" + ChatColor.BOLD + "18" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done") + "\n"; + text += ChatColor.RED + "" + ChatColor.BOLD + "19" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("quit"); return text; @@ -799,8 +797,8 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text - = GREEN + Lang.get("eventEditorQuitWithoutSaving") + "\n"; - text += YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord"); + = ChatColor.GREEN + Lang.get("eventEditorQuitWithoutSaving") + "\n"; + text += ChatColor.YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord"); return text; @@ -815,7 +813,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { } else if (input.equalsIgnoreCase(Lang.get("noWord"))) { return new CreateMenuPrompt(); } else { - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("invalidOption")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("invalidOption")); return new QuitPrompt(); } @@ -858,15 +856,15 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text - = RED + Lang.get("eventEditorFinishAndSave") + " \"" + GOLD + (String) context.getSessionData(CK.E_NAME) + RED + "\"?\n"; + = ChatColor.RED + Lang.get("eventEditorFinishAndSave") + " \"" + ChatColor.GOLD + (String) context.getSessionData(CK.E_NAME) + ChatColor.RED + "\"?\n"; if (modified.isEmpty() == false) { - text += RED + Lang.get("eventEditorModifiedNote") + "\n"; + text += ChatColor.RED + Lang.get("eventEditorModifiedNote") + "\n"; for (String s : modified) { - text += GRAY + " - " + DARKRED + s + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.DARK_RED + s + "\n"; } - text += RED + Lang.get("eventEditorForcedToQuit") + "\n"; + text += ChatColor.RED + Lang.get("eventEditorForcedToQuit") + "\n"; } - text += YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord"); + text += ChatColor.YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord"); return text; @@ -881,7 +879,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { } else if (input.equalsIgnoreCase(Lang.get("noWord"))) { return new CreateMenuPrompt(); } else { - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("invalidOption")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("invalidOption")); return new FinishPrompt(modName); } @@ -1187,7 +1185,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text - = AQUA + Lang.get("eventEditorCreate") + GOLD + " - " + Lang.get("eventEditorEnterEventName"); + = ChatColor.AQUA + Lang.get("eventEditorCreate") + ChatColor.GOLD + " - " + Lang.get("eventEditorEnterEventName"); return text; @@ -1202,7 +1200,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (e.name.equalsIgnoreCase(input)) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorExists")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorExists")); return new EventNamePrompt(); } @@ -1211,14 +1209,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (names.contains(input)) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorSomeone")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorSomeone")); return new EventNamePrompt(); } if (StringUtils.isAlphanumeric(input) == false) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorAlpha")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorAlpha")); return new EventNamePrompt(); } @@ -1242,7 +1240,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorEnterNPCId"); + return ChatColor.YELLOW + Lang.get("eventEditorEnterNPCId"); } @@ -1252,7 +1250,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (input.intValue() != -1) { if (CitizensAPI.getNPCRegistry().getById(input.intValue()) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorNoNPCExists")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorNoNPCExists")); return new SetNpcStartPrompt(); } @@ -1270,7 +1268,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorExplosionPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorExplosionPrompt"); } @@ -1299,7 +1297,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { selectedExplosionLocations.remove(player.getUniqueId()); } else { - player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst")); + player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst")); return new ExplosionPrompt(); } @@ -1328,7 +1326,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorEnterEventName"); + return ChatColor.YELLOW + Lang.get("eventEditorEnterEventName"); } @@ -1340,20 +1338,20 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { for (Event e : quests.events) { if (e.name.equalsIgnoreCase(input)) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorExists")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorExists")); return new SetNamePrompt(); } } if (names.contains(input)) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorSomeone")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorSomeone")); return new SetNamePrompt(); } if (StringUtils.isAlphanumeric(input) == false) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorAlpha")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorAlpha")); return new SetNamePrompt(); } @@ -1374,7 +1372,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorSetMessagePrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorSetMessagePrompt"); } @@ -1420,23 +1418,23 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { } - String text = GOLD + Lang.get("eventEditorGiveItemsTitle") + "\n"; + String text = ChatColor.GOLD + Lang.get("eventEditorGiveItemsTitle") + "\n"; if (context.getSessionData(CK.E_ITEMS) == null) { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorAddItem") + "\n"; - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddItem") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } else { for (ItemStack is : getItems(context)) { - text += GRAY + " - " + ItemUtil.getDisplayString(is) + "\n"; + text += ChatColor.GRAY + " - " + ItemUtil.getDisplayString(is) + "\n"; } - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorAddItem") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddItem") + "\n"; - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } @@ -1450,7 +1448,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (input.equalsIgnoreCase("1")) { return new ItemStackPrompt(ItemListPrompt.this); } else if (input.equalsIgnoreCase("2")) { - context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorItemsCleared")); + context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorItemsCleared")); context.setSessionData(CK.E_ITEMS, null); return new ItemListPrompt(); } else if (input.equalsIgnoreCase("3")) { @@ -1478,36 +1476,36 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + "- " + Lang.get("eventEditorEffects") + " -\n"; + String text = ChatColor.GOLD + "- " + Lang.get("eventEditorEffects") + " -\n"; if (context.getSessionData(CK.E_EFFECTS) == null) { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorAddEffect") + " (" + Lang.get("noneSet") + ")\n"; - text += GRAY + "2 - " + Lang.get("eventEditorAddEffectLocation") + " (" + Lang.get("eventEditorNoEffects") + ")\n"; - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddEffect") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.GRAY + "2 - " + Lang.get("eventEditorAddEffectLocation") + " (" + Lang.get("eventEditorNoEffects") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } else { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorAddEffect") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddEffect") + "\n"; for (String s : getEffects(context)) { - text += GRAY + " - " + AQUA + s + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n"; } if (context.getSessionData(CK.E_EFFECTS_LOCATIONS) == null) { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorAddEffectLocation") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddEffectLocation") + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorAddEffectLocation") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddEffectLocation") + "\n"; for (String s : getEffectLocations(context)) { - text += GRAY + " - " + AQUA + s + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n"; } } - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } @@ -1522,14 +1520,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { return new EffectPrompt(); } else if (input.equalsIgnoreCase("2")) { if (context.getSessionData(CK.E_EFFECTS) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustAddEffects")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustAddEffects")); return new EffectListPrompt(); } else { selectedEffectLocations.put(((Player) context.getForWhom()).getUniqueId(), null); return new EffectLocationPrompt(); } } else if (input.equalsIgnoreCase("3")) { - context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorEffectsCleared")); + context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorEffectsCleared")); context.setSessionData(CK.E_EFFECTS, null); context.setSessionData(CK.E_EFFECTS_LOCATIONS, null); return new EffectListPrompt(); @@ -1553,7 +1551,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (one == two) { return new CreateMenuPrompt(); } else { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorListSizeMismatch")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorListSizeMismatch")); return new EffectListPrompt(); } } @@ -1577,7 +1575,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorEffectLocationPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorEffectLocationPrompt"); } @@ -1606,7 +1604,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { selectedEffectLocations.remove(player.getUniqueId()); } else { - player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst")); + player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst")); return new EffectLocationPrompt(); } @@ -1629,19 +1627,19 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String effects = PINK + Lang.get("eventEditorEffectsTitle") + "\n"; - effects += PURPLE + "BLAZE_SHOOT " + GRAY + "- " + Lang.get("effBlazeShoot") + "\n"; - effects += PURPLE + "BOW_FIRE " + GRAY + "- " + Lang.get("effBowFire") + "\n"; - effects += PURPLE + "CLICK1 " + GRAY + "- " + Lang.get("effClick1") + "\n"; - effects += PURPLE + "CLICK2 " + GRAY + "- " + Lang.get("effClick2") + "\n"; - effects += PURPLE + "DOOR_TOGGLE " + GRAY + "- " + Lang.get("effDoorToggle") + "\n"; - effects += PURPLE + "EXTINGUISH " + GRAY + "- " + Lang.get("effExtinguish") + "\n"; - effects += PURPLE + "GHAST_SHOOT " + GRAY + "- " + Lang.get("effGhastShoot") + "\n"; - effects += PURPLE + "GHAST_SHRIEK " + GRAY + "- " + Lang.get("effGhastShriek") + "\n"; - effects += PURPLE + "ZOMBIE_CHEW_IRON_DOOR " + GRAY + "- " + Lang.get("effZombieWood") + "\n"; - effects += PURPLE + "ZOMBIE_CHEW_WOODEN_DOOR " + GRAY + "- " + Lang.get("effZombieIron") + "\n"; + String effects = ChatColor.LIGHT_PURPLE + Lang.get("eventEditorEffectsTitle") + "\n"; + effects += ChatColor.DARK_PURPLE + "BLAZE_SHOOT " + ChatColor.GRAY + "- " + Lang.get("effBlazeShoot") + "\n"; + effects += ChatColor.DARK_PURPLE + "BOW_FIRE " + ChatColor.GRAY + "- " + Lang.get("effBowFire") + "\n"; + effects += ChatColor.DARK_PURPLE + "CLICK1 " + ChatColor.GRAY + "- " + Lang.get("effClick1") + "\n"; + effects += ChatColor.DARK_PURPLE + "CLICK2 " + ChatColor.GRAY + "- " + Lang.get("effClick2") + "\n"; + effects += ChatColor.DARK_PURPLE + "DOOR_TOGGLE " + ChatColor.GRAY + "- " + Lang.get("effDoorToggle") + "\n"; + effects += ChatColor.DARK_PURPLE + "EXTINGUISH " + ChatColor.GRAY + "- " + Lang.get("effExtinguish") + "\n"; + effects += ChatColor.DARK_PURPLE + "GHAST_SHOOT " + ChatColor.GRAY + "- " + Lang.get("effGhastShoot") + "\n"; + effects += ChatColor.DARK_PURPLE + "GHAST_SHRIEK " + ChatColor.GRAY + "- " + Lang.get("effGhastShriek") + "\n"; + effects += ChatColor.DARK_PURPLE + "ZOMBIE_CHEW_IRON_DOOR " + ChatColor.GRAY + "- " + Lang.get("effZombieWood") + "\n"; + effects += ChatColor.DARK_PURPLE + "ZOMBIE_CHEW_WOODEN_DOOR " + ChatColor.GRAY + "- " + Lang.get("effZombieIron") + "\n"; - return YELLOW + effects + Lang.get("effEnterName"); + return ChatColor.YELLOW + effects + Lang.get("effEnterName"); } @@ -1668,7 +1666,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { return new EffectListPrompt(); } else { - player.sendMessage(PINK + input + " " + RED + Lang.get("eventEditorInvalidEffect")); + player.sendMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED + Lang.get("eventEditorInvalidEffect")); return new EffectPrompt(); } @@ -1693,28 +1691,28 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + Lang.get("eventEditorStormTitle") + "\n"; + String text = ChatColor.GOLD + Lang.get("eventEditorStormTitle") + "\n"; if (context.getSessionData(CK.E_WORLD_STORM) == null) { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + Lang.get("noneSet") + ")\n"; - text += GRAY + "2 - " + Lang.get("eventEditorSetDuration") + " " + Lang.get("eventEditorNoWorld") + "\n"; - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.GRAY + "2 - " + Lang.get("eventEditorSetDuration") + " " + Lang.get("eventEditorNoWorld") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } else { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + AQUA + ((String) context.getSessionData(CK.E_WORLD_STORM)) + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + ChatColor.AQUA + ((String) context.getSessionData(CK.E_WORLD_STORM)) + ChatColor.YELLOW + ")\n"; if (context.getSessionData(CK.E_WORLD_STORM_DURATION) == null) { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + Lang.get("noneSet") + ")\n"; } else { Long dur = (Long) context.getSessionData(CK.E_WORLD_STORM_DURATION); - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + AQUA + Quests.getTime(dur) + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + ChatColor.AQUA + Quests.getTime(dur) + ChatColor.YELLOW + ")\n"; } - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } @@ -1729,20 +1727,20 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { return new StormWorldPrompt(); } else if (input.equalsIgnoreCase("2")) { if (context.getSessionData(CK.E_WORLD_STORM) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorSetWorldFirst")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorSetWorldFirst")); return new StormPrompt(); } else { return new StormDurationPrompt(); } } else if (input.equalsIgnoreCase("3")) { - context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorStormCleared")); + context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorStormCleared")); context.setSessionData(CK.E_WORLD_STORM, null); context.setSessionData(CK.E_WORLD_STORM_DURATION, null); return new StormPrompt(); } else if (input.equalsIgnoreCase("4")) { if (context.getSessionData(CK.E_WORLD_STORM) != null && context.getSessionData(CK.E_WORLD_STORM_DURATION) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetStormDuration")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetStormDuration")); return new StormPrompt(); } else { return new CreateMenuPrompt(); @@ -1759,14 +1757,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String effects = PINK + Lang.get("eventEditorWorldsTitle") + "\n" + PURPLE; + String effects = ChatColor.LIGHT_PURPLE + Lang.get("eventEditorWorldsTitle") + "\n" + ChatColor.DARK_PURPLE; for (World w : quests.getServer().getWorlds()) { effects += w.getName() + ", "; } effects = effects.substring(0, effects.length()); - return YELLOW + effects + Lang.get("eventEditorEnterStormWorld"); + return ChatColor.YELLOW + effects + Lang.get("eventEditorEnterStormWorld"); } @@ -1782,7 +1780,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { context.setSessionData(CK.E_WORLD_STORM, quests.getServer().getWorld(input).getName()); } else { - player.sendMessage(PINK + input + " " + RED + Lang.get("eventEditorInvalidWorld")); + player.sendMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED + Lang.get("eventEditorInvalidWorld")); return new StormWorldPrompt(); } @@ -1797,7 +1795,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorEnterStormDuration"); + return ChatColor.YELLOW + Lang.get("eventEditorEnterStormDuration"); } @@ -1805,7 +1803,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { protected Prompt acceptValidatedInput(ConversationContext context, Number input) { if (input.longValue() < 1000) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorAtLeastOneSecond")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorAtLeastOneSecond")); return new StormDurationPrompt(); } @@ -1826,30 +1824,30 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + Lang.get("eventEditorThunderTitle") + "\n"; + String text = ChatColor.GOLD + Lang.get("eventEditorThunderTitle") + "\n"; if (context.getSessionData(CK.E_WORLD_THUNDER) == null) { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + Lang.get("noneSet") + ")\n"; - text += GRAY + "2 - " + Lang.get("eventEditorSetDuration") + " " + Lang.get("eventEditorNoWorld") + "\n"; - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.GRAY + "2 - " + Lang.get("eventEditorSetDuration") + " " + Lang.get("eventEditorNoWorld") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } else { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + AQUA + ((String) context.getSessionData(CK.E_WORLD_THUNDER)) + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetWorld") + " (" + ChatColor.AQUA + ((String) context.getSessionData(CK.E_WORLD_THUNDER)) + ChatColor.YELLOW + ")\n"; if (context.getSessionData(CK.E_WORLD_THUNDER_DURATION) == null) { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + Lang.get("noneSet") + ")\n"; } else { Long dur = (Long) context.getSessionData(CK.E_WORLD_THUNDER_DURATION); - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + AQUA + Quests.getTime(dur) + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetDuration") + " (" + ChatColor.AQUA + Quests.getTime(dur) + ChatColor.YELLOW + ")\n"; } - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } @@ -1864,20 +1862,20 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { return new ThunderWorldPrompt(); } else if (input.equalsIgnoreCase("2")) { if (context.getSessionData(CK.E_WORLD_THUNDER) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorSetWorldFirst")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorSetWorldFirst")); return new ThunderPrompt(); } else { return new ThunderDurationPrompt(); } } else if (input.equalsIgnoreCase("3")) { - context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorThunderCleared")); + context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorThunderCleared")); context.setSessionData(CK.E_WORLD_THUNDER, null); context.setSessionData(CK.E_WORLD_THUNDER_DURATION, null); return new ThunderPrompt(); } else if (input.equalsIgnoreCase("4")) { if (context.getSessionData(CK.E_WORLD_THUNDER) != null && context.getSessionData(CK.E_WORLD_THUNDER_DURATION) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetThunderDuration")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetThunderDuration")); return new ThunderPrompt(); } else { return new CreateMenuPrompt(); @@ -1894,14 +1892,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String effects = PINK + Lang.get("eventEditorWorldsTitle") + "\n" + PURPLE; + String effects = ChatColor.LIGHT_PURPLE + Lang.get("eventEditorWorldsTitle") + "\n" + ChatColor.DARK_PURPLE; for (World w : quests.getServer().getWorlds()) { effects += w.getName() + ", "; } effects = effects.substring(0, effects.length()); - return YELLOW + effects + Lang.get("eventEditorEnterThunderWorld"); + return ChatColor.YELLOW + effects + Lang.get("eventEditorEnterThunderWorld"); } @@ -1917,7 +1915,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { context.setSessionData(CK.E_WORLD_THUNDER, quests.getServer().getWorld(input).getName()); } else { - player.sendMessage(PINK + input + " " + RED + Lang.get("eventEditorInvalidWorld")); + player.sendMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED + Lang.get("eventEditorInvalidWorld")); return new ThunderWorldPrompt(); } @@ -1932,7 +1930,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorEnterDuration"); + return ChatColor.YELLOW + Lang.get("eventEditorEnterDuration"); } @@ -1940,7 +1938,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { protected Prompt acceptValidatedInput(ConversationContext context, Number input) { if (input.longValue() < 1000) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorAtLeastOneSecond")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorAtLeastOneSecond")); return new ThunderDurationPrompt(); } else { context.setSessionData(CK.E_WORLD_THUNDER_DURATION, input.longValue()); @@ -1956,23 +1954,23 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + Lang.get("eventEditorMobSpawnsTitle") + "\n"; + String text = ChatColor.GOLD + Lang.get("eventEditorMobSpawnsTitle") + "\n"; if (context.getSessionData(CK.E_MOB_TYPES) == null) { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorAddMobTypes") + " (" + Lang.get("noneSet") + ")\n"; - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddMobTypes") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } else { @SuppressWarnings("unchecked") LinkedList types = (LinkedList) context.getSessionData(CK.E_MOB_TYPES); for (int i = 0; i < types.size(); i++) { QuestMob qm = QuestMob.fromString(types.get(i)); - text += GOLD + " " + (i + 1) + " - " + Lang.get("edit") + ": " + AQUA + qm.getType().name() + ((qm.getName() != null) ? ": " + qm.getName() : "") + GRAY + " x " + DARKAQUA + qm.getSpawnAmounts() + GRAY + " -> " + GREEN + Quests.getLocationInfo(qm.getSpawnLocation()) + "\n"; + text += ChatColor.GOLD + " " + (i + 1) + " - " + Lang.get("edit") + ": " + ChatColor.AQUA + qm.getType().name() + ((qm.getName() != null) ? ": " + qm.getName() : "") + ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + qm.getSpawnAmounts() + ChatColor.GRAY + " -> " + ChatColor.GREEN + Quests.getLocationInfo(qm.getSpawnLocation()) + "\n"; } - text += BLUE + "" + BOLD + (types.size() + 1) + RESET + YELLOW + " - " + Lang.get("eventEditorAddMobTypes") + "\n"; - text += BLUE + "" + BOLD + (types.size() + 2) + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += GREEN + "" + BOLD + (types.size() + 3) + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + (types.size() + 1) + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddMobTypes") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + (types.size() + 2) + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.GREEN + "" + ChatColor.BOLD + (types.size() + 3) + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } @@ -1987,7 +1985,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (input.equalsIgnoreCase("1")) { return new QuestMobPrompt(0, null); } else if (input.equalsIgnoreCase("2")) { - context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorMobSpawnsCleared")); + context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorMobSpawnsCleared")); context.setSessionData(CK.E_MOB_TYPES, null); return new MobPrompt(); } else if (input.equalsIgnoreCase("3")) { @@ -2000,14 +1998,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { try { inp = Integer.parseInt(input); } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorNotANumber")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorNotANumber")); return new MobPrompt(); } if (inp == types.size() + 1) { return new QuestMobPrompt(inp - 1, null); } else if (inp == types.size() + 2) { - context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorMobSpawnsCleared")); + context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorMobSpawnsCleared")); context.setSessionData(CK.E_MOB_TYPES, null); return new MobPrompt(); } else if (inp == types.size() + 3) { @@ -2037,7 +2035,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + Lang.get("eventEditorAddMobTypesTitle") + "\n"; + String text = ChatColor.GOLD + Lang.get("eventEditorAddMobTypesTitle") + "\n"; if (questMob == null) { questMob = new QuestMob(); @@ -2055,23 +2053,23 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { } - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobName") + GRAY + " (" + ((questMob.getName() == null) ? Lang.get("noneSet") : AQUA + questMob.getName()) + ")\n"; - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobType") + GRAY + " (" + ((questMob.getType() == null) ? Lang.get("eventEditorNoTypesSet") : AQUA + questMob.getType().name()) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorAddSpawnLocation") + GRAY + " (" + ((questMob.getSpawnLocation() == null) ? GRAY + Lang.get("noneSet") : AQUA + Quests.getLocationInfo(questMob.getSpawnLocation())) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobSpawnAmount") + GRAY + " (" + ((questMob.getSpawnAmounts() == null) ? GRAY + Lang.get("eventEditorNoAmountsSet") : AQUA + "" + questMob.getSpawnAmounts()) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobItemInHand") + GRAY + " (" + ((questMob.inventory[0] == null) ? GRAY + Lang.get("noneSet") : AQUA + ItemUtil.getDisplayString(questMob.inventory[0])) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobItemInHandDrop") + GRAY + " (" + ((questMob.dropChances[0] == null) ? GRAY + Lang.get("noneSet") : AQUA + "" + questMob.dropChances[0]) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobBoots") + GRAY + " (" + ((questMob.inventory[1] == null) ? GRAY + Lang.get("noneSet") : AQUA + ItemUtil.getDisplayString(questMob.inventory[1])) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobBootsDrop") + GRAY + " (" + ((questMob.dropChances[1] == null) ? GRAY + Lang.get("noneSet") : AQUA + "" + questMob.dropChances[1]) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobLeggings") + GRAY + " (" + ((questMob.inventory[2] == null) ? GRAY + Lang.get("noneSet") : AQUA + ItemUtil.getDisplayString(questMob.inventory[2])) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "10" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobLeggingsDrop") + GRAY + " (" + ((questMob.dropChances[2] == null) ? GRAY + Lang.get("noneSet") : AQUA + "" + questMob.dropChances[2]) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "11" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobChestPlate") + GRAY + " (" + ((questMob.inventory[3] == null) ? GRAY + Lang.get("noneSet") : AQUA + ItemUtil.getDisplayString(questMob.inventory[3])) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "12" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobChestPlateDrop") + GRAY + " (" + ((questMob.dropChances[3] == null) ? GRAY + Lang.get("noneSet") : AQUA + "" + questMob.dropChances[3]) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "13" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobHelmet") + GRAY + " (" + ((questMob.inventory[4] == null) ? GRAY + Lang.get("noneSet") : AQUA + ItemUtil.getDisplayString(questMob.inventory[4])) + GRAY + ")\n"; - text += BLUE + "" + BOLD + "14" + RESET + YELLOW + " - " + Lang.get("eventEditorSetMobHelmetDrop") + GRAY + " (" + ((questMob.dropChances[4] == null) ? GRAY + Lang.get("noneSet") : AQUA + "" + questMob.dropChances[4]) + GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobName") + ChatColor.GRAY + " (" + ((questMob.getName() == null) ? Lang.get("noneSet") : ChatColor.AQUA + questMob.getName()) + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobType") + ChatColor.GRAY + " (" + ((questMob.getType() == null) ? Lang.get("eventEditorNoTypesSet") : ChatColor.AQUA + questMob.getType().name()) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddSpawnLocation") + ChatColor.GRAY + " (" + ((questMob.getSpawnLocation() == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + Quests.getLocationInfo(questMob.getSpawnLocation())) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobSpawnAmount") + ChatColor.GRAY + " (" + ((questMob.getSpawnAmounts() == null) ? ChatColor.GRAY + Lang.get("eventEditorNoAmountsSet") : ChatColor.AQUA + "" + questMob.getSpawnAmounts()) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobItemInHand") + ChatColor.GRAY + " (" + ((questMob.inventory[0] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[0])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobItemInHandDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[0] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[0]) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobBoots") + ChatColor.GRAY + " (" + ((questMob.inventory[1] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[1])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobBootsDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[1] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[1]) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobLeggings") + ChatColor.GRAY + " (" + ((questMob.inventory[2] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[2])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "10" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobLeggingsDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[2] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[2]) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobChestPlate") + ChatColor.GRAY + " (" + ((questMob.inventory[3] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[3])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "12" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobChestPlateDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[3] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[3]) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "13" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobHelmet") + ChatColor.GRAY + " (" + ((questMob.inventory[4] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[4])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "14" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobHelmetDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[4] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[4]) + ChatColor.GRAY + ")\n"; - text += GREEN + "" + BOLD + "15" + RESET + YELLOW + " - " + Lang.get("done") + "\n"; - text += RED + "" + BOLD + "16" + RESET + YELLOW + " - " + Lang.get("cancel"); + text += ChatColor.GREEN + "" + ChatColor.BOLD + "15" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done") + "\n"; + text += ChatColor.RED + "" + ChatColor.BOLD + "16" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("cancel"); return text; @@ -2117,13 +2115,13 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { return new MobDropPrompt(4, mobIndex, questMob); } else if (input.equalsIgnoreCase("15")) { if (questMob.getType() == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetMobTypesFirst")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetMobTypesFirst")); return new QuestMobPrompt(mobIndex, questMob); } else if (questMob.getSpawnLocation() == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetMobLocationFirst")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetMobLocationFirst")); return new QuestMobPrompt(mobIndex, questMob); } else if (questMob.getSpawnAmounts() == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetMobAmountsFirst")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetMobAmountsFirst")); return new QuestMobPrompt(mobIndex, questMob); } if (context.getSessionData(CK.E_MOB_TYPES) == null) { @@ -2163,7 +2161,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = YELLOW + Lang.get("eventEditorSetMobNamePrompt"); + String text = ChatColor.YELLOW + Lang.get("eventEditorSetMobNamePrompt"); return text; } @@ -2196,7 +2194,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext arg0) { - String mobs = PINK + Lang.get("eventEditorMobsTitle") + "\n"; + String mobs = ChatColor.LIGHT_PURPLE + Lang.get("eventEditorMobsTitle") + "\n"; final EntityType[] mobArr = EntityType.values(); for (int i = 0; i < mobArr.length; i++) { @@ -2212,7 +2210,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { } } - return mobs + YELLOW + Lang.get("eventEditorSetMobTypesPrompt"); + return mobs + ChatColor.YELLOW + Lang.get("eventEditorSetMobTypesPrompt"); } @Override @@ -2227,7 +2225,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { questMob.setType(MiscUtil.getProperMobType(input)); } else { - player.sendMessage(PINK + input + " " + RED + Lang.get("eventEditorInvalidMob")); + player.sendMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED + Lang.get("eventEditorInvalidMob")); return new MobTypePrompt(mobIndex, questMob); } } @@ -2249,7 +2247,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorSetMobAmountsPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorSetMobAmountsPrompt"); } @@ -2265,14 +2263,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { int i = Integer.parseInt(input); if (i < 1) { - player.sendMessage(PINK + input + " " + RED + Lang.get("eventEditorNotGreaterThanZero")); + player.sendMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED + Lang.get("eventEditorNotGreaterThanZero")); return new MobAmountPrompt(mobIndex, questMob); } questMob.setSpawnAmounts(i); return new QuestMobPrompt(mobIndex, questMob); } catch (NumberFormatException e) { - player.sendMessage(PINK + input + " " + RED + Lang.get("eventEditorNotANumber")); + player.sendMessage(ChatColor.LIGHT_PURPLE + input + " " + ChatColor.RED + Lang.get("eventEditorNotANumber")); return new MobAmountPrompt(mobIndex, questMob); } @@ -2296,7 +2294,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorSetMobLocationPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorSetMobLocationPrompt"); } @@ -2316,7 +2314,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { selectedMobLocations.remove(player.getUniqueId()); } else { - player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst")); + player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst")); return new MobLocationPrompt(mobIndex, questMob); } @@ -2348,7 +2346,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = YELLOW + Lang.get("eventEditorSetDropChance"); + String text = ChatColor.YELLOW + Lang.get("eventEditorSetDropChance"); return text; } @@ -2364,11 +2362,11 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { try { chance = Float.parseFloat(input); } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorInvalidDropChance")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidDropChance")); return new MobDropPrompt(invIndex, mobIndex, questMob); } if (chance > 1 || chance < 0) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorInvalidDropChance")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorInvalidDropChance")); return new MobDropPrompt(invIndex, mobIndex, questMob); } @@ -2383,7 +2381,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorLightningPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorLightningPrompt"); } @@ -2412,7 +2410,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { selectedLightningLocations.remove(player.getUniqueId()); } else { - player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst")); + player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst")); return new LightningPrompt(); } @@ -2448,45 +2446,45 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + Lang.get("eventEditorPotionEffectsTitle") + "\n"; + String text = ChatColor.GOLD + Lang.get("eventEditorPotionEffectsTitle") + "\n"; if (context.getSessionData(CK.E_POTION_TYPES) == null) { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionEffectTypes") + " (" + Lang.get("noneSet") + ")\n"; - text += GRAY + "2 - " + Lang.get("eventEditorSetPotionDurations") + " " + Lang.get("eventEditorNoTypesSet") + "\n"; - text += GRAY + "3 - " + Lang.get("eventEditorSetPotionMagnitudes") + " " + Lang.get("eventEditorNoTypesSet") + "\n"; - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += GREEN + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetPotionEffectTypes") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.GRAY + "2 - " + Lang.get("eventEditorSetPotionDurations") + " " + Lang.get("eventEditorNoTypesSet") + "\n"; + text += ChatColor.GRAY + "3 - " + Lang.get("eventEditorSetPotionMagnitudes") + " " + Lang.get("eventEditorNoTypesSet") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.GREEN + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } else { - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionEffectTypes") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetPotionEffectTypes") + "\n"; for (String s : (LinkedList) context.getSessionData(CK.E_POTION_TYPES)) { - text += GRAY + " - " + AQUA + s + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n"; } if (context.getSessionData(CK.E_POTION_DURATIONS) == null) { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionDurations") + " (" + Lang.get("noneSet") + ")\n"; - text += GRAY + "3 - " + Lang.get("eventEditorSetPotionMagnitudes") + " " + Lang.get("eventEditorNoDurationsSet") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetPotionDurations") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.GRAY + "3 - " + Lang.get("eventEditorSetPotionMagnitudes") + " " + Lang.get("eventEditorNoDurationsSet") + "\n"; } else { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("eventEditorNoDurationsSet") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorNoDurationsSet") + "\n"; for (Long l : (LinkedList) context.getSessionData(CK.E_POTION_DURATIONS)) { - text += GRAY + " - " + DARKAQUA + Quests.getTime(l * 50L) + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.DARK_AQUA + Quests.getTime(l * 50L) + "\n"; } if (context.getSessionData(CK.E_POTION_STRENGHT) == null) { - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionMagnitudes") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetPotionMagnitudes") + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("eventEditorSetPotionMagnitudes") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetPotionMagnitudes") + "\n"; for (int i : (LinkedList) context.getSessionData(CK.E_POTION_STRENGHT)) { - text += GRAY + " - " + PURPLE + i + "\n"; + text += ChatColor.GRAY + " - " + ChatColor.DARK_PURPLE + i + "\n"; } } } - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; - text += GREEN + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("done"); + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n"; + text += ChatColor.GREEN + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done"); } @@ -2502,24 +2500,24 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { return new PotionTypesPrompt(); } else if (input.equalsIgnoreCase("2")) { if (context.getSessionData(CK.E_POTION_TYPES) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetPotionTypesFirst")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetPotionTypesFirst")); return new PotionEffectPrompt(); } else { return new PotionDurationsPrompt(); } } else if (input.equalsIgnoreCase("3")) { if (context.getSessionData(CK.E_POTION_TYPES) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetPotionTypesAndDurationsFirst")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetPotionTypesAndDurationsFirst")); return new PotionEffectPrompt(); } else if (context.getSessionData(CK.E_POTION_DURATIONS) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorMustSetPotionDurationsFirst")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetPotionDurationsFirst")); return new PotionEffectPrompt(); } else { return new PotionMagnitudesPrompt(); } } else if (input.equalsIgnoreCase("4")) { - context.getForWhom().sendRawMessage(YELLOW + Lang.get("eventEditorPotionsCleared")); + context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("eventEditorPotionsCleared")); context.setSessionData(CK.E_POTION_TYPES, null); context.setSessionData(CK.E_POTION_DURATIONS, null); context.setSessionData(CK.E_POTION_STRENGHT, null); @@ -2551,7 +2549,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (one == two && two == three) { return new CreateMenuPrompt(); } else { - context.getForWhom().sendRawMessage(RED + Lang.get("eventEditorListSizeMismatch")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorListSizeMismatch")); return new PotionEffectPrompt(); } @@ -2566,12 +2564,12 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String effs = PINK + Lang.get("eventEditorPotionTypesTitle") + "\n"; + String effs = ChatColor.LIGHT_PURPLE + Lang.get("eventEditorPotionTypesTitle") + "\n"; for (PotionEffectType pet : PotionEffectType.values()) { - effs += (pet != null && pet.getName() != null) ? (PURPLE + pet.getName() + "\n") : ""; + effs += (pet != null && pet.getName() != null) ? (ChatColor.DARK_PURPLE + pet.getName() + "\n") : ""; } - return effs + YELLOW + Lang.get("eventEditorSetPotionEffectsPrompt"); + return effs + ChatColor.YELLOW + Lang.get("eventEditorSetPotionEffectsPrompt"); } @@ -2592,7 +2590,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { context.setSessionData(CK.E_POTION_TYPES, effTypes); } else { - player.sendMessage(PINK + s + " " + RED + Lang.get("eventEditorInvalidPotionType")); + player.sendMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED + Lang.get("eventEditorInvalidPotionType")); return new PotionTypesPrompt(); } @@ -2610,7 +2608,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorSetPotionDurationsPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorSetPotionDurationsPrompt"); } @@ -2630,14 +2628,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { long l = i * 1000; if (l < 1000) { - player.sendMessage(PINK + s + " " + RED + Lang.get("eventEditorNotGreaterThanOneSecond")); + player.sendMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED + Lang.get("eventEditorNotGreaterThanOneSecond")); return new PotionDurationsPrompt(); } effDurations.add(l / 50L); } catch (NumberFormatException e) { - player.sendMessage(PINK + s + " " + RED + Lang.get("eventEditorNotANumber")); + player.sendMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED + Lang.get("eventEditorNotANumber")); return new PotionDurationsPrompt(); } @@ -2657,7 +2655,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorSetPotionMagnitudesPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorSetPotionMagnitudesPrompt"); } @@ -2676,14 +2674,14 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { int i = Integer.parseInt(s); if (i < 1) { - player.sendMessage(PINK + s + " " + RED + Lang.get("eventEditorNotGreaterThanZero")); + player.sendMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED + Lang.get("eventEditorNotGreaterThanZero")); return new PotionMagnitudesPrompt(); } magAmounts.add(i); } catch (NumberFormatException e) { - player.sendMessage(PINK + s + " " + RED + Lang.get("eventEditorNotANumber")); + player.sendMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED + Lang.get("eventEditorNotANumber")); return new PotionMagnitudesPrompt(); } @@ -2703,7 +2701,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorSetHungerPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorSetHungerPrompt"); } @@ -2713,7 +2711,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (input.intValue() != -1) { if (input.intValue() < 0) { - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("eventEditorHungerLevelAtLeastZero")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("eventEditorHungerLevelAtLeastZero")); return new HungerPrompt(); } else { context.setSessionData(CK.E_HUNGER, (Integer) input.intValue()); @@ -2733,7 +2731,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorSetSaturationPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorSetSaturationPrompt"); } @@ -2743,7 +2741,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (input.intValue() != -1) { if (input.intValue() < 0) { - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("eventEditorSaturationLevelAtLeastZero")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("eventEditorSaturationLevelAtLeastZero")); return new SaturationPrompt(); } else { context.setSessionData(CK.E_SATURATION, (Integer) input.intValue()); @@ -2763,7 +2761,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorSetHealthPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorSetHealthPrompt"); } @@ -2773,7 +2771,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { if (input.intValue() != -1) { if (input.intValue() < 0) { - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("eventEditorHealthLevelAtLeastZero")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("eventEditorHealthLevelAtLeastZero")); return new HealthPrompt(); } else { context.setSessionData(CK.E_HEALTH, (Integer) input.intValue()); @@ -2793,7 +2791,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("eventEditorSetTeleportPrompt"); + return ChatColor.YELLOW + Lang.get("eventEditorSetTeleportPrompt"); } @@ -2813,7 +2811,7 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { selectedTeleportLocations.remove(player.getUniqueId()); } else { - player.sendMessage(RED + Lang.get("eventEditorSelectBlockFirst")); + player.sendMessage(ChatColor.RED + Lang.get("eventEditorSelectBlockFirst")); return new TeleportPrompt(); } @@ -2842,8 +2840,8 @@ public class EventFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + "" + ITALIC + Lang.get("eventEditorCommandsNote"); - return YELLOW + Lang.get("eventEditorSetCommandsPrompt") + "\n" + text; + String text = ChatColor.GOLD + "" + ChatColor.ITALIC + Lang.get("eventEditorCommandsNote"); + return ChatColor.YELLOW + Lang.get("eventEditorSetCommandsPrompt") + "\n" + text; } diff --git a/src/main/java/me/blackvein/quests/PlayerListener.java b/src/main/java/me/blackvein/quests/PlayerListener.java index ec3ec8cad..87e0dac59 100644 --- a/src/main/java/me/blackvein/quests/PlayerListener.java +++ b/src/main/java/me/blackvein/quests/PlayerListener.java @@ -53,7 +53,7 @@ import org.bukkit.projectiles.ProjectileSource; import com.sk89q.worldguard.protection.managers.RegionManager; import com.sk89q.worldguard.protection.regions.ProtectedRegion; -public class PlayerListener implements Listener, ColorUtil { +public class PlayerListener implements Listener { final Quests plugin; @@ -125,7 +125,7 @@ public class PlayerListener implements Listener, ColorUtil { String msg = Lang.get("questMaxAllowed"); msg = msg.replaceAll("", String.valueOf(Quests.maxQuests)); - player.sendMessage(YELLOW + msg); + player.sendMessage(ChatColor.YELLOW + msg); } else if (quester.completedQuests.contains(quest.name) && quest.redoDelay < 0) { String completed = Lang.get("questAlreadyCompleted"); @@ -381,7 +381,7 @@ public class PlayerListener implements Listener, ColorUtil { if (evt.getRightClicked().getType() == EntityType.ITEM_FRAME) { if(ItemUtil.isJournal(evt.getPlayer().getItemInHand())) { evt.setCancelled(true); - evt.getPlayer().sendMessage(RED + Lang.get("journalDenied")); + evt.getPlayer().sendMessage(ChatColor.RED + Lang.get("journalDenied")); } } } diff --git a/src/main/java/me/blackvein/quests/QuestFactory.java b/src/main/java/me/blackvein/quests/QuestFactory.java index 4a330c794..66201b888 100644 --- a/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/src/main/java/me/blackvein/quests/QuestFactory.java @@ -1,9 +1,5 @@ package me.blackvein.quests; -import com.sk89q.worldguard.protection.managers.RegionManager; - -import me.blackvein.quests.util.ColorUtil; - import java.io.File; import java.io.IOException; import java.util.HashMap; @@ -14,15 +10,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.UUID; -import me.blackvein.quests.prompts.ItemStackPrompt; -import me.blackvein.quests.prompts.RequirementsPrompt; -import me.blackvein.quests.prompts.RewardsPrompt; -import me.blackvein.quests.prompts.StagesPrompt; -import me.blackvein.quests.util.CK; -import me.blackvein.quests.util.ItemUtil; -import me.blackvein.quests.util.Lang; -import net.citizensnpcs.api.CitizensAPI; - import org.bukkit.ChatColor; import org.bukkit.DyeColor; import org.bukkit.Location; @@ -33,13 +20,31 @@ import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.conversations.*; +import org.bukkit.conversations.ConversationAbandonedEvent; +import org.bukkit.conversations.ConversationAbandonedListener; +import org.bukkit.conversations.ConversationContext; +import org.bukkit.conversations.ConversationFactory; +import org.bukkit.conversations.FixedSetPrompt; +import org.bukkit.conversations.NumericPrompt; +import org.bukkit.conversations.Prompt; +import org.bukkit.conversations.StringPrompt; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -public class QuestFactory implements ConversationAbandonedListener, ColorUtil { +import com.sk89q.worldguard.protection.managers.RegionManager; + +import me.blackvein.quests.prompts.ItemStackPrompt; +import me.blackvein.quests.prompts.RequirementsPrompt; +import me.blackvein.quests.prompts.RewardsPrompt; +import me.blackvein.quests.prompts.StagesPrompt; +import me.blackvein.quests.util.CK; +import me.blackvein.quests.util.ItemUtil; +import me.blackvein.quests.util.Lang; +import net.citizensnpcs.api.CitizensAPI; + +public class QuestFactory implements ConversationAbandonedListener{ public Quests quests; Map editSessions = new HashMap(); @@ -94,11 +99,11 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text - = GOLD + Lang.get("questEditorTitle") + "\n" - + BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("questEditorCreate") + "\n" - + BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("questEditorEdit") + "\n" - + BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("questEditorDelete") + "\n" - + GOLD + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("exit"); + = ChatColor.GOLD + Lang.get("questEditorTitle") + "\n" + + ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorCreate") + "\n" + + ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorEdit") + "\n" + + ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorDelete") + "\n" + + ChatColor.GOLD + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("exit"); return text; @@ -114,7 +119,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.create")) { return new QuestNamePrompt(); } else { - player.sendMessage(RED + Lang.get("questEditorNoPermsCreate")); + player.sendMessage(ChatColor.RED + Lang.get("questEditorNoPermsCreate")); return new MenuPrompt(); } @@ -123,7 +128,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.edit")) { return new SelectEditPrompt(); } else { - player.sendMessage(RED + Lang.get("questEditorNoPermsCreate")); + player.sendMessage(ChatColor.RED + Lang.get("questEditorNoPermsCreate")); return new MenuPrompt(); } @@ -132,12 +137,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.delete")) { return new SelectDeletePrompt(); } else { - player.sendMessage(RED + Lang.get("questEditorNoPermsDelete")); + player.sendMessage(ChatColor.RED + Lang.get("questEditorNoPermsDelete")); return new MenuPrompt(); } } else if (input.equalsIgnoreCase("4")) { - context.getForWhom().sendRawMessage(YELLOW + Lang.get("exited")); + context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("exited")); return Prompt.END_OF_CONVERSATION; } @@ -164,29 +169,29 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text - = GOLD + "- " + Lang.get("quest") + ": " + AQUA + context.getSessionData(CK.Q_NAME) + GOLD + " -\n"; + = ChatColor.GOLD + "- " + Lang.get("quest") + ": " + ChatColor.AQUA + context.getSessionData(CK.Q_NAME) + ChatColor.GOLD + " -\n"; - text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("questEditorName") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorName") + "\n"; if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) { - text += BLUE + "" + BOLD + "2" + RESET + RED + " - " + Lang.get("questEditorAskMessage") + " " + DARKRED + "(" + Lang.get("questRequiredNoneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.RED + " - " + Lang.get("questEditorAskMessage") + " " + ChatColor.DARK_RED + "(" + Lang.get("questRequiredNoneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("questEditorAskMessage") + " (\"" + context.getSessionData(CK.Q_ASK_MESSAGE) + "\")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorAskMessage") + " (\"" + context.getSessionData(CK.Q_ASK_MESSAGE) + "\")\n"; } if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) { - text += BLUE + "" + BOLD + "3" + RESET + RED + " - " + Lang.get("questEditorFinishMessage") + " " + DARKRED + "(" + Lang.get("questRequiredNoneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.RED + " - " + Lang.get("questEditorFinishMessage") + " " + ChatColor.DARK_RED + "(" + Lang.get("questRequiredNoneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("questEditorFinishMessage") + " (\"" + context.getSessionData(CK.Q_FINISH_MESSAGE) + "\")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorFinishMessage") + " (\"" + context.getSessionData(CK.Q_FINISH_MESSAGE) + "\")\n"; } if (context.getSessionData(CK.Q_REDO_DELAY) == null) { - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("questEditorRedoDelay") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorRedoDelay") + " (" + Lang.get("noneSet") + ")\n"; } else { //something here is throwing an exception try { - text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("questEditorRedoDelay") + " (" + Quests.getTime((Long) context.getSessionData(CK.Q_REDO_DELAY)) + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorRedoDelay") + " (" + Quests.getTime((Long) context.getSessionData(CK.Q_REDO_DELAY)) + ")\n"; } catch (Exception e) { e.printStackTrace(); } @@ -195,27 +200,27 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } if (context.getSessionData(CK.Q_START_NPC) == null && quests.citizens != null) { - text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("questEditorNPCStart") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorNPCStart") + " (" + Lang.get("noneSet") + ")\n"; } else if (quests.citizens != null) { - text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("questEditorNPCStart") + " (" + CitizensAPI.getNPCRegistry().getById((Integer) context.getSessionData(CK.Q_START_NPC)).getName() + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorNPCStart") + " (" + CitizensAPI.getNPCRegistry().getById((Integer) context.getSessionData(CK.Q_START_NPC)).getName() + ")\n"; } if (context.getSessionData(CK.Q_START_BLOCK) == null) { if (quests.citizens != null) { - text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + Lang.get("noneSet") + ")\n"; } } else { if (quests.citizens != null) { Location l = (Location) context.getSessionData(CK.Q_START_BLOCK); - text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n"; } else { Location l = (Location) context.getSessionData(CK.Q_START_BLOCK); - text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorBlockStart") + " (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n"; } } @@ -225,19 +230,19 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (context.getSessionData(CK.Q_REGION) == null) { if (quests.citizens != null) { - text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + Lang.get("noneSet") + ")\n"; } } else { if (quests.citizens != null) { String s = (String) context.getSessionData(CK.Q_REGION); - text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + GREEN + s + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + ChatColor.GREEN + s + ChatColor.YELLOW + ")\n"; } else { String s = (String) context.getSessionData(CK.Q_REGION); - text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + GREEN + s + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questWGSetRegion") + " (" + ChatColor.GREEN + s + ChatColor.YELLOW + ")\n"; } } @@ -245,9 +250,9 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } else { if (quests.citizens != null) { - text += GRAY + "7 - " + Lang.get("questWGSetRegion") + " (" + Lang.get("questWGNotInstalled") + ")\n"; + text += ChatColor.GRAY + "7 - " + Lang.get("questWGSetRegion") + " (" + Lang.get("questWGNotInstalled") + ")\n"; } else { - text += GRAY + "6 - " + Lang.get("questWGSetRegion") + " (" + Lang.get("questWGNotInstalled") + ")\n"; + text += ChatColor.GRAY + "6 - " + Lang.get("questWGSetRegion") + " (" + Lang.get("questWGNotInstalled") + ")\n"; } } @@ -255,19 +260,19 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (context.getSessionData(CK.Q_INITIAL_EVENT) == null) { if (quests.citizens != null) { - text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + Lang.get("noneSet") + ")\n"; } else { - text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + Lang.get("noneSet") + ")\n"; } } else { if (quests.citizens != null) { String s = (String) context.getSessionData(CK.Q_INITIAL_EVENT); - text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + s + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + s + ")\n"; } else { String s = (String) context.getSessionData(CK.Q_INITIAL_EVENT); - text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + s + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorInitialEvent") + " (" + s + ")\n"; } } @@ -275,46 +280,46 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (quests.citizens != null) { if (context.getSessionData(CK.Q_GUIDISPLAY) == null) { - text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("questEditorSetGUI") + " (" + Lang.get("noneSet") + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorSetGUI") + " (" + Lang.get("noneSet") + ")\n"; } else { ItemStack stack = (ItemStack) context.getSessionData(CK.Q_GUIDISPLAY); - text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("questEditorSetGUI") + " (" + ItemUtil.getDisplayString(stack) + RESET + YELLOW + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorSetGUI") + " (" + ItemUtil.getDisplayString(stack) + ChatColor.RESET + ChatColor.YELLOW + ")\n"; } } else { - text += GRAY + "8 - " + Lang.get("questEditorSetGUI") + " (" + Lang.get("questCitNotInstalled") + ")\n"; + text += ChatColor.GRAY + "8 - " + Lang.get("questEditorSetGUI") + " (" + Lang.get("questCitNotInstalled") + ")\n"; } if (quests.citizens != null) { - text += BLUE + "" + BOLD + "10" + RESET + DARKAQUA + " - " + Lang.get("questEditorReqs") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "10" + ChatColor.RESET + ChatColor.DARK_AQUA + " - " + Lang.get("questEditorReqs") + "\n"; } else { - text += BLUE + "" + BOLD + "9" + RESET + DARKAQUA + " - " + Lang.get("questEditorReqs") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.DARK_AQUA + " - " + Lang.get("questEditorReqs") + "\n"; } if (quests.citizens != null) { - text += BLUE + "" + BOLD + "11" + RESET + PINK + " - " + Lang.get("questEditorStages") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.LIGHT_PURPLE + " - " + Lang.get("questEditorStages") + "\n"; } else { - text += BLUE + "" + BOLD + "10" + RESET + PINK + " - " + Lang.get("questEditorStages") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "10" + ChatColor.RESET + ChatColor.LIGHT_PURPLE + " - " + Lang.get("questEditorStages") + "\n"; } if (quests.citizens != null) { - text += BLUE + "" + BOLD + "12" + RESET + GREEN + " - " + Lang.get("questEditorRews") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "12" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("questEditorRews") + "\n"; } else { - text += BLUE + "" + BOLD + "11" + RESET + GREEN + " - " + Lang.get("questEditorRews") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("questEditorRews") + "\n"; } if (quests.citizens != null) { - text += BLUE + "" + BOLD + "13" + RESET + GOLD + " - " + Lang.get("save") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "13" + ChatColor.RESET + ChatColor.GOLD + " - " + Lang.get("save") + "\n"; } else { - text += BLUE + "" + BOLD + "12" + RESET + GOLD + " - " + Lang.get("save") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "12" + ChatColor.RESET + ChatColor.GOLD + " - " + Lang.get("save") + "\n"; } if (quests.citizens != null) { - text += BLUE + "" + BOLD + "14" + RESET + RED + " - " + Lang.get("exit") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "14" + ChatColor.RESET + ChatColor.RED + " - " + Lang.get("exit") + "\n"; } else { - text += BLUE + "" + BOLD + "13" + RESET + RED + " - " + Lang.get("exit") + "\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "13" + ChatColor.RESET + ChatColor.RED + " - " + Lang.get("exit") + "\n"; } return text; @@ -438,12 +443,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String s = GOLD + Lang.get("questEditTitle") + "\n"; + String s = ChatColor.GOLD + Lang.get("questEditTitle") + "\n"; for (Quest q : quests.getQuests()) { - s += GRAY + "- " + YELLOW + q.getName() + "\n"; + s += ChatColor.GRAY + "- " + ChatColor.YELLOW + q.getName() + "\n"; } - return s + GOLD + Lang.get("questEditorEditEnterQuestName"); + return s + ChatColor.GOLD + Lang.get("questEditorEditEnterQuestName"); } @@ -493,8 +498,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + Lang.get("questCreateTitle") + "\n"; - text += AQUA + Lang.get("questEditorCreate") + " " + GOLD + "- " + Lang.get("questEditorEnterQuestName"); + String text = ChatColor.GOLD + Lang.get("questCreateTitle") + "\n"; + text += ChatColor.AQUA + Lang.get("questEditorCreate") + " " + ChatColor.GOLD + "- " + Lang.get("questEditorEnterQuestName"); return text; @@ -651,7 +656,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } if (s != null && s.equalsIgnoreCase(input) == false) { - context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNameExists")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNameExists")); return new SetNamePrompt(); } } @@ -659,7 +664,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } if (names.contains(input)) { - context.getForWhom().sendRawMessage(RED + Lang.get("questEditorBeingEdited")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorBeingEdited")); return new SetNamePrompt(); } @@ -740,16 +745,16 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = DARKGREEN + Lang.get("eventTitle") + "\n"; + String text = ChatColor.DARK_GREEN + Lang.get("eventTitle") + "\n"; if (quests.events.isEmpty()) { - text += RED + "- " + Lang.get("none"); + text += ChatColor.RED + "- " + Lang.get("none"); } else { for (Event e : quests.events) { - text += GREEN + "- " + e.getName() + "\n"; + text += ChatColor.GREEN + "- " + e.getName() + "\n"; } } - return text + YELLOW + Lang.get("questEditorEnterInitialEvent"); + return text + ChatColor.YELLOW + Lang.get("questEditorEnterInitialEvent"); } @@ -772,7 +777,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } if (found == null) { - player.sendMessage(RED + input + YELLOW + " " + Lang.get("questEditorInvalidEventName")); + player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " + Lang.get("questEditorInvalidEventName")); return new InitialEventPrompt(); } else { context.setSessionData(CK.Q_INITIAL_EVENT, found.getName()); @@ -781,7 +786,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(CK.Q_INITIAL_EVENT, null); - player.sendMessage(YELLOW + Lang.get("questEditorEventCleared")); + player.sendMessage(ChatColor.YELLOW + Lang.get("questEditorEventCleared")); return new CreateMenuPrompt(); } else { return new CreateMenuPrompt(); @@ -813,8 +818,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (ItemUtil.compareItems(stack, quest.guiDisplay, false) == 0) { String error = Lang.get("questGUIError"); - error = error.replaceAll("", PURPLE + quest.name + RED); - context.getForWhom().sendRawMessage(RED + error); + error = error.replaceAll("", ChatColor.DARK_PURPLE + quest.name + ChatColor.RED); + context.getForWhom().sendRawMessage(ChatColor.RED + error); failed = true; break; @@ -832,16 +837,16 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } - String text = GREEN + Lang.get("questGUITitle") + "\n"; + String text = ChatColor.GREEN + Lang.get("questGUITitle") + "\n"; if (context.getSessionData(CK.Q_GUIDISPLAY) != null) { ItemStack stack = (ItemStack) context.getSessionData(CK.Q_GUIDISPLAY); - text += DARKGREEN + Lang.get("questCurrentItem") + " " + RESET + ItemUtil.getDisplayString(stack) + "\n\n"; + text += ChatColor.DARK_GREEN + Lang.get("questCurrentItem") + " " + ChatColor.RESET + ItemUtil.getDisplayString(stack) + "\n\n"; } else { - text += DARKGREEN + Lang.get("questCurrentItem") + " " + GRAY + "(" + Lang.get("none") + ")\n\n"; + text += ChatColor.DARK_GREEN + Lang.get("questCurrentItem") + " " + ChatColor.GRAY + "(" + Lang.get("none") + ")\n\n"; } - text += GREEN + "" + BOLD + "1 -" + RESET + DARKGREEN + " " + Lang.get("questSetItem") + "\n"; - text += GREEN + "" + BOLD + "2 -" + RESET + DARKGREEN + " " + Lang.get("questClearItem") + "\n"; - text += GREEN + "" + BOLD + "3 -" + RESET + GREEN + " " + Lang.get("done") + "\n"; + text += ChatColor.GREEN + "" + ChatColor.BOLD + "1 -" + ChatColor.RESET + ChatColor.DARK_GREEN + " " + Lang.get("questSetItem") + "\n"; + text += ChatColor.GREEN + "" + ChatColor.BOLD + "2 -" + ChatColor.RESET + ChatColor.DARK_GREEN + " " + Lang.get("questClearItem") + "\n"; + text += ChatColor.GREEN + "" + ChatColor.BOLD + "3 -" + ChatColor.RESET + ChatColor.GREEN + " " + Lang.get("done") + "\n"; return text; @@ -857,7 +862,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } else if (input.equalsIgnoreCase("2")) { context.setSessionData(CK.Q_GUIDISPLAY, null); - context.getForWhom().sendRawMessage(YELLOW + Lang.get("questGUICleared")); + context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("questGUICleared")); return new GUIDisplayPrompt(); } else { @@ -875,7 +880,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = DARKGREEN + Lang.get("questRegionTitle") + "\n"; + String text = ChatColor.DARK_GREEN + Lang.get("questRegionTitle") + "\n"; boolean any = false; for (World world : quests.getServer().getWorlds()) { @@ -884,7 +889,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { for (String region : rm.getRegions().keySet()) { any = true; - text += GREEN + region + ", "; + text += ChatColor.GREEN + region + ", "; } @@ -894,10 +899,10 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { text = text.substring(0, text.length() - 2); text += "\n\n"; } else { - text += GRAY + "(" + Lang.get("none") + ")\n\n"; + text += ChatColor.GRAY + "(" + Lang.get("none") + ")\n\n"; } - return text + YELLOW + Lang.get("questWGPrompt"); + return text + ChatColor.YELLOW + Lang.get("questWGPrompt"); } @@ -931,8 +936,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (found == null) { String error = Lang.get("questWGInvalidRegion"); - error = error.replaceAll("", RED + input + YELLOW); - player.sendMessage(RED + error); + error = error.replaceAll("", ChatColor.RED + input + ChatColor.YELLOW); + player.sendMessage(ChatColor.RED + error); return new RegionPrompt(); } else { context.setSessionData(CK.Q_REGION, found); @@ -941,7 +946,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { context.setSessionData(CK.Q_REGION, null); - player.sendMessage(YELLOW + Lang.get("questWGRegionCleared")); + player.sendMessage(ChatColor.YELLOW + Lang.get("questWGRegionCleared")); return new CreateMenuPrompt(); } else { return new CreateMenuPrompt(); @@ -974,13 +979,13 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { int i = Integer.parseInt(input); delay = i * 1000; } catch (NumberFormatException e) { - context.getForWhom().sendRawMessage(ITALIC + "" + RED + input + RESET + RED + " " + Lang.get("stageEditorInvalidNumber")); + context.getForWhom().sendRawMessage(ChatColor.ITALIC + "" + ChatColor.RED + input + ChatColor.RESET + ChatColor.RED + " " + Lang.get("stageEditorInvalidNumber")); //delay = MiscUtil.getTimeFromString(input); return new RedoDelayPrompt(); } if (delay < -1) { - context.getForWhom().sendRawMessage(RED + Lang.get("questEditorPositiveAmount")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorPositiveAmount")); } else if (delay == 0) { context.setSessionData(CK.Q_REDO_DELAY, null); } else if (delay != -1) { @@ -997,10 +1002,10 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GREEN + String text = ChatColor.GREEN + "1 - " + Lang.get("yesWord") + "\n" + "2 - " + Lang.get("noWord"); - return ChatColor.YELLOW + Lang.get("questEditorSave") + " \"" + AQUA + context.getSessionData(CK.Q_NAME) + YELLOW + "\"?\n" + text; + return ChatColor.YELLOW + Lang.get("questEditorSave") + " \"" + ChatColor.AQUA + context.getSessionData(CK.Q_NAME) + ChatColor.YELLOW + "\"?\n" + text; } @@ -1010,13 +1015,13 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase(Lang.get("yesWord"))) { if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNeedAskMessage")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedAskMessage")); return new CreateMenuPrompt(); } else if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) { - context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNeedFinishMessage")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedFinishMessage")); return new CreateMenuPrompt(); } else if (StagesPrompt.getStages(context) == 0) { - context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNeedStages")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedStages")); return new CreateMenuPrompt(); } @@ -1046,7 +1051,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } quests.updateData(); } - context.getForWhom().sendRawMessage(BOLD + Lang.get("questEditorSaved")); + context.getForWhom().sendRawMessage(ChatColor.BOLD + Lang.get("questEditorSaved")); } catch (IOException e) { e.printStackTrace(); @@ -1070,7 +1075,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GREEN + String text = ChatColor.GREEN + "1 - " + Lang.get("yesWord") + "\n" + "2 - " + Lang.get("noWord"); return ChatColor.YELLOW + Lang.get("questEditorExited") + "\n" + text; @@ -1082,7 +1087,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (input.equalsIgnoreCase("1") || input.equalsIgnoreCase(Lang.get("yesWord"))) { - context.getForWhom().sendRawMessage(BOLD + "" + YELLOW + Lang.get("exited")); + context.getForWhom().sendRawMessage(ChatColor.BOLD + "" + ChatColor.YELLOW + Lang.get("exited")); return Prompt.END_OF_CONVERSATION; } else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase(Lang.get("noWord"))) { @@ -2247,14 +2252,14 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + Lang.get("questDeleteTitle") + "\n"; + String text = ChatColor.GOLD + Lang.get("questDeleteTitle") + "\n"; for (Quest quest : quests.quests) { - text += AQUA + quest.name + YELLOW + ","; + text += ChatColor.AQUA + quest.name + ChatColor.YELLOW + ","; } text = text.substring(0, text.length() - 1) + "\n"; - text += YELLOW + Lang.get("questEditorEnterQuestName"); + text += ChatColor.YELLOW + Lang.get("questEditorEnterQuestName"); return text; @@ -2283,17 +2288,17 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { context.setSessionData(CK.ED_QUEST_DELETE, found.name); return new DeletePrompt(); } else { - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("questEditorQuestAsRequirement1") + " \"" + PURPLE + context.getSessionData(CK.ED_QUEST_DELETE) + RED + "\" " + Lang.get("questEditorQuestAsRequirement2")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("questEditorQuestAsRequirement1") + " \"" + ChatColor.DARK_PURPLE + context.getSessionData(CK.ED_QUEST_DELETE) + ChatColor.RED + "\" " + Lang.get("questEditorQuestAsRequirement2")); for (String s : used) { - ((Player) context.getForWhom()).sendMessage(RED + "- " + DARKRED + s); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + "- " + ChatColor.DARK_RED + s); } - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("questEditorQuestAsRequirement3")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("questEditorQuestAsRequirement3")); return new SelectDeletePrompt(); } } - ((Player) context.getForWhom()).sendMessage(RED + Lang.get("questEditorQuestNotFound")); + ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("questEditorQuestNotFound")); return new SelectDeletePrompt(); } else { @@ -2309,8 +2314,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text - = RED + Lang.get("questEditorDeleted") + " \"" + GOLD + (String) context.getSessionData(CK.ED_QUEST_DELETE) + RED + "\"?\n"; - text += YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord"); + = ChatColor.RED + Lang.get("questEditorDeleted") + " \"" + ChatColor.GOLD + (String) context.getSessionData(CK.ED_QUEST_DELETE) + ChatColor.RED + "\"?\n"; + text += ChatColor.YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord"); return text; @@ -2367,7 +2372,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { quests.reloadQuests(); - context.getForWhom().sendRawMessage(WHITE + "" + BOLD + Lang.get("questDeleted")); + context.getForWhom().sendRawMessage(ChatColor.WHITE + "" + ChatColor.BOLD + Lang.get("questDeleted")); } } diff --git a/src/main/java/me/blackvein/quests/Quests.java b/src/main/java/me/blackvein/quests/Quests.java index 3895288d3..ed6a661fd 100644 --- a/src/main/java/me/blackvein/quests/Quests.java +++ b/src/main/java/me/blackvein/quests/Quests.java @@ -88,7 +88,7 @@ import java.util.jar.JarFile; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.inventory.meta.ItemMeta; -public class Quests extends JavaPlugin implements ConversationAbandonedListener, ColorUtil { +public class Quests extends JavaPlugin implements ConversationAbandonedListener { public static Economy economy = null; public static Permission permission = null; @@ -353,7 +353,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } - return YELLOW + Lang.get("questsUnknownCommand"); + return ChatColor.YELLOW + Lang.get("questsUnknownCommand"); } else if(cmd.equalsIgnoreCase("questsadmin") || cmd.equalsIgnoreCase("questadmin")) { @@ -367,7 +367,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } - return YELLOW + Lang.get("questsUnknownAdminCommand"); + return ChatColor.YELLOW + Lang.get("questsUnknownAdminCommand"); } return "NULL"; @@ -375,13 +375,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, public String getQuestsCommandUsage(String cmd) { - return RED + Lang.get("usage") + ":" + YELLOW + "/quests " + Lang.get(Lang.getCommandKey(cmd) + "_HELP"); + return ChatColor.RED + Lang.get("usage") + ":" + ChatColor.YELLOW + "/quests " + Lang.get(Lang.getCommandKey(cmd) + "_HELP"); } public String getQuestadminCommandUsage(String cmd) { - return RED + Lang.get("usage") + ": " + YELLOW + "/questadmin " + Lang.get(Lang.getCommandKey(cmd) + "_HELP"); + return ChatColor.RED + Lang.get("usage") + ": " + ChatColor.YELLOW + "/questadmin " + Lang.get(Lang.getCommandKey(cmd) + "_HELP"); } @@ -455,7 +455,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (abandonedEvent.getContext().getForWhom() != null) { try { - abandonedEvent.getContext().getForWhom().sendRawMessage(YELLOW + Lang.get("questTimeout")); + abandonedEvent.getContext().getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("questTimeout")); } catch (Exception e) { } @@ -474,7 +474,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, @Override public String getPromptText(ConversationContext context) { - return YELLOW + Lang.get("acceptQuest") + " " + GREEN + Lang.get("yesWord") + " / " + Lang.get("noWord"); + return ChatColor.YELLOW + Lang.get("acceptQuest") + " " + ChatColor.GREEN + Lang.get("yesWord") + " / " + Lang.get("noWord"); } @@ -494,12 +494,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else if (s.equalsIgnoreCase(Lang.get("noWord"))) { - player.sendMessage(YELLOW + Lang.get("cancelled")); + player.sendMessage(ChatColor.YELLOW + Lang.get("cancelled")); return Prompt.END_OF_CONVERSATION; } else { - player.sendMessage(RED + Lang.get("questInvalidChoice")); + player.sendMessage(ChatColor.RED + Lang.get("questInvalidChoice")); return new QuestPrompt(); } @@ -512,7 +512,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, @Override public String getPrefix(ConversationContext context) { - return "" + GRAY; + return ChatColor.GRAY.toString(); } } @@ -698,56 +698,56 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, public void printHelp(Player player) { - player.sendMessage(GOLD + Lang.get("questHelpTitle")); - player.sendMessage(YELLOW + "/quests " + Lang.get("questDisplayHelp")); + player.sendMessage(ChatColor.GOLD + Lang.get("questHelpTitle")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("questDisplayHelp")); if (player.hasPermission("quests.list")) { - player.sendMessage(YELLOW + "/quests " + Lang.get("COMMAND_LIST_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("COMMAND_LIST_HELP")); } if (player.hasPermission("quests.take")) { - player.sendMessage(YELLOW + "/quests " + Lang.get("COMMAND_TAKE_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("COMMAND_TAKE_HELP")); } if (player.hasPermission("quests.quit")) { - player.sendMessage(YELLOW + "/quests " + Lang.get("COMMAND_QUIT_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("COMMAND_QUIT_HELP")); } if (player.hasPermission("quests.journal")) { - player.sendMessage(YELLOW + "/quests " + Lang.get("COMMAND_JOURNAL_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("COMMAND_JOURNAL_HELP")); } if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.editor")) { - player.sendMessage(YELLOW + "/quests " + Lang.get("COMMAND_EDITOR_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("COMMAND_EDITOR_HELP")); } if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.events.editor")) { - player.sendMessage(YELLOW + "/quests " + Lang.get("COMMAND_EVENTS_EDITOR_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("COMMAND_EVENTS_EDITOR_HELP")); } if (player.hasPermission("quests.stats")) { - player.sendMessage(YELLOW + "/quests " + Lang.get("COMMAND_STATS_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("COMMAND_STATS_HELP")); } if (player.hasPermission("quests.top")) { - player.sendMessage(YELLOW + "/quests " + Lang.get("COMMAND_TOP_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("COMMAND_TOP_HELP")); } //player.sendMessage(GOLD + "/quests party - Quest Party commands"); - player.sendMessage(YELLOW + "/quests " + Lang.get("COMMAND_INFO_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quests " + Lang.get("COMMAND_INFO_HELP")); player.sendMessage(" "); - player.sendMessage(YELLOW + "/quest " + Lang.get("COMMAND_QUEST_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quest " + Lang.get("COMMAND_QUEST_HELP")); if (player.hasPermission("quests.questinfo")) { - player.sendMessage(YELLOW + "/quest " + Lang.get("COMMAND_QUESTINFO_HELP")); + player.sendMessage(ChatColor.YELLOW + "/quest " + Lang.get("COMMAND_QUESTINFO_HELP")); } if (player.hasPermission("quests.admin.*") || player.hasPermission("quests.admin")) { - player.sendMessage(DARKRED + "/questadmin " + RED + Lang.get("COMMAND_QUESTADMIN_HELP")); + player.sendMessage(ChatColor.DARK_RED + "/questadmin " + ChatColor.RED + Lang.get("COMMAND_QUESTADMIN_HELP")); } } public void printPartyHelp(Player player) { - player.sendMessage(PURPLE + "- Quest Parties -"); - player.sendMessage(PINK + "/quests party create - Create new party"); - player.sendMessage(PINK + "/quests party leave - Leave your party"); - player.sendMessage(PINK + "/quests party info - Info about your party"); - player.sendMessage(PURPLE + "- (Leader only) -"); - player.sendMessage(PINK + "/quests party invite - Invite a player to your party"); - player.sendMessage(PINK + "/quests party kick - Kick a member from the party"); - player.sendMessage(PINK + "/quests party setleader - Set a party member as the new leader"); + player.sendMessage(ChatColor.DARK_PURPLE + "- Quest Parties -"); + player.sendMessage(ChatColor.LIGHT_PURPLE + "/quests party create - Create new party"); + player.sendMessage(ChatColor.LIGHT_PURPLE + "/quests party leave - Leave your party"); + player.sendMessage(ChatColor.LIGHT_PURPLE + "/quests party info - Info about your party"); + player.sendMessage(ChatColor.DARK_PURPLE + "- (Leader only) -"); + player.sendMessage(ChatColor.LIGHT_PURPLE + "/quests party invite - Invite a player to your party"); + player.sendMessage(ChatColor.LIGHT_PURPLE + "/quests party kick - Kick a member from the party"); + player.sendMessage(ChatColor.LIGHT_PURPLE + "/quests party setleader - Set a party member as the new leader"); } @@ -756,7 +756,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (cs instanceof Player) { if (checkQuester(((Player)cs).getUniqueId()) == true) { - cs.sendMessage(RED + Lang.get("questBlacklisted")); + cs.sendMessage(ChatColor.RED + Lang.get("questBlacklisted")); return true; } } @@ -857,7 +857,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { - cs.sendMessage(YELLOW + Lang.get("questsUnknownAdminCommand")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("questsUnknownAdminCommand")); } @@ -868,19 +868,19 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin")) { printAdminHelp(cs); } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } private void adminReload(final CommandSender cs) { if (cs.hasPermission("quests.admin.*") || cs.hasPermission("quests.admin.reload")) { reloadQuests(); - cs.sendMessage(GOLD + Lang.get("questsReloaded")); + cs.sendMessage(ChatColor.GOLD + Lang.get("questsReloaded")); String msg = Lang.get("numQuestsLoaded"); - msg = msg.replaceAll("", PURPLE + String.valueOf(quests.size()) + GOLD); - cs.sendMessage(GOLD + msg); + msg = msg.replaceAll("", ChatColor.DARK_PURPLE + String.valueOf(quests.size()) + ChatColor.GOLD); + cs.sendMessage(ChatColor.GOLD + msg); } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -892,32 +892,32 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, int i = Integer.parseInt(args[1]); if (citizens.getNPCRegistry().getById(i) == null) { String msg = Lang.get("errorNPCID"); - msg = msg.replaceAll("errorNPCID", PURPLE + "" + i + RED); - cs.sendMessage(RED + msg); + msg = msg.replaceAll("errorNPCID", ChatColor.DARK_PURPLE + "" + i + ChatColor.RED); + cs.sendMessage(ChatColor.RED + msg); } else if (questNPCGUIs.contains(i)) { questNPCGUIs.remove(questNPCGUIs.indexOf(i)); updateData(); String msg = Lang.get("disableNPCGUI"); - msg = msg.replaceAll("", PURPLE + citizens.getNPCRegistry().getById(i).getName() + YELLOW); - cs.sendMessage(YELLOW + msg); + msg = msg.replaceAll("", ChatColor.DARK_PURPLE + citizens.getNPCRegistry().getById(i).getName() + ChatColor.YELLOW); + cs.sendMessage(ChatColor.YELLOW + msg); } else { questNPCGUIs.add(i); updateData(); String msg = Lang.get("enableNPCGUI"); - msg = msg.replaceAll("", PURPLE + citizens.getNPCRegistry().getById(i).getName() + YELLOW); - cs.sendMessage(YELLOW + msg); + msg = msg.replaceAll("", ChatColor.DARK_PURPLE + citizens.getNPCRegistry().getById(i).getName() + ChatColor.YELLOW); + cs.sendMessage(ChatColor.YELLOW + msg); } } catch (NumberFormatException nfe) { - cs.sendMessage(RED + Lang.get("inputNum")); + cs.sendMessage(ChatColor.RED + Lang.get("inputNum")); } catch (Exception ex) { ex.printStackTrace(); - cs.sendMessage(RED + Lang.get("unknownError")); + cs.sendMessage(ChatColor.RED + Lang.get("unknownError")); } } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -938,7 +938,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (target == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); } else { @@ -952,19 +952,19 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, quester.questPoints += Math.abs(points); String msg1 = Lang.get("giveQuestPoints"); - msg1 = msg1.replaceAll("", GREEN + target.getName() + GOLD); - msg1 = msg1.replaceAll("", PURPLE + "" + points + GOLD); - cs.sendMessage(GOLD + msg1); + msg1 = msg1.replaceAll("", ChatColor.GREEN + target.getName() + ChatColor.GOLD); + msg1 = msg1.replaceAll("", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); + cs.sendMessage(ChatColor.GOLD + msg1); String msg2 = Lang.get("questPointsGiven"); - msg2 = msg2.replaceAll("", GREEN + cs.getName() + GOLD); - msg2 = msg2.replaceAll("", PURPLE + "" + points + GOLD); - target.sendMessage(GREEN + msg2); + msg2 = msg2.replaceAll("", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); + msg2 = msg2.replaceAll("", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); + target.sendMessage(ChatColor.GREEN + msg2); quester.saveData(); } catch (NumberFormatException e) { - cs.sendMessage(YELLOW + Lang.get("inputNum")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("inputNum")); } @@ -972,7 +972,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -994,7 +994,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (target == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); } else { @@ -1006,7 +1006,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } catch (NumberFormatException e) { - cs.sendMessage(YELLOW + Lang.get("inputNum")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("inputNum")); return; } @@ -1014,14 +1014,14 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, quester.questPoints -= Math.abs(points); String msg1 = Lang.get("takeQuestPoints"); - msg1 = msg1.replaceAll("", GREEN + target.getName() + GOLD); - msg1 = msg1.replaceAll("", PURPLE + "" + points + GOLD); - cs.sendMessage(GOLD + msg1); + msg1 = msg1.replaceAll("", ChatColor.GREEN + target.getName() + ChatColor.GOLD); + msg1 = msg1.replaceAll("", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); + cs.sendMessage(ChatColor.GOLD + msg1); String msg2 = Lang.get("questPointsTaken"); - msg2 = msg2.replaceAll("", GREEN + cs.getName() + GOLD); - msg2 = msg2.replaceAll("", PURPLE + "" + points + GOLD); + msg2 = msg2.replaceAll("", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); + msg2 = msg2.replaceAll("", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); - target.sendMessage(GREEN + msg2); + target.sendMessage(ChatColor.GREEN + msg2); quester.saveData(); @@ -1029,7 +1029,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1050,7 +1050,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (target == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); } else { @@ -1062,7 +1062,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } catch (NumberFormatException e) { - cs.sendMessage(YELLOW + Lang.get("inputNum")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("inputNum")); return; } @@ -1071,13 +1071,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, quester.questPoints = points; String msg1 = Lang.get("setQuestPoints"); - msg1 = msg1.replaceAll("", GREEN + target.getName() + GOLD); - msg1 = msg1.replaceAll("", PURPLE + "" + points + GOLD); - cs.sendMessage(GOLD + msg1); + msg1 = msg1.replaceAll("", ChatColor.GREEN + target.getName() + ChatColor.GOLD); + msg1 = msg1.replaceAll("", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); + cs.sendMessage(ChatColor.GOLD + msg1); String msg2 = Lang.get("questPointsSet"); - msg2 = msg2.replaceAll("", GREEN + cs.getName() + GOLD); - msg2 = msg2.replaceAll("", PURPLE + "" + points + GOLD); - target.sendMessage(GREEN + msg2); + msg2 = msg2.replaceAll("", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); + msg2 = msg2.replaceAll("", ChatColor.DARK_PURPLE + "" + points + ChatColor.GOLD); + target.sendMessage(ChatColor.GREEN + msg2); quester.saveData(); @@ -1085,7 +1085,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1107,7 +1107,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (target == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); } else { @@ -1137,7 +1137,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (questToGive == null) { - cs.sendMessage(YELLOW + Lang.get("questNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("questNotFound")); } else { @@ -1148,9 +1148,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if(q.getName().equalsIgnoreCase(questToGive.getName())) { String msg = Lang.get("questsPlayerHasQuestAlready"); - msg = msg.replaceAll("", ITALIC + "" + GREEN + target.getName() + RESET + YELLOW); - msg = msg.replaceAll("", ITALIC + "" + PURPLE + questToGive.getName() + RESET + YELLOW); - cs.sendMessage(YELLOW + msg); + msg = msg.replaceAll("", ChatColor.ITALIC + "" + ChatColor.GREEN + target.getName() + ChatColor.RESET + ChatColor.YELLOW); + msg = msg.replaceAll("", ChatColor.ITALIC + "" + ChatColor.DARK_PURPLE + questToGive.getName() + ChatColor.RESET + ChatColor.YELLOW); + cs.sendMessage(ChatColor.YELLOW + msg); return; } @@ -1160,13 +1160,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, quester.hardQuit(questToGive); String msg1 = Lang.get("questForceTake"); - msg1 = msg1.replaceAll("", GREEN + target.getName() + GOLD); - msg1 = msg1.replaceAll("", PURPLE + questToGive.name + GOLD); - cs.sendMessage(GOLD + msg1); + msg1 = msg1.replaceAll("", ChatColor.GREEN + target.getName() + ChatColor.GOLD); + msg1 = msg1.replaceAll("", ChatColor.DARK_PURPLE + questToGive.name + ChatColor.GOLD); + cs.sendMessage(ChatColor.GOLD + msg1); String msg2 = Lang.get("questForcedTake"); - msg2 = msg2.replaceAll("", GREEN + cs.getName() + GOLD); - msg2 = msg2.replaceAll("", PURPLE + questToGive.name + GOLD); - target.sendMessage(GREEN + msg2); + msg2 = msg2.replaceAll("", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); + msg2 = msg2.replaceAll("", ChatColor.DARK_PURPLE + questToGive.name + ChatColor.GOLD); + target.sendMessage(ChatColor.GREEN + msg2); quester.takeQuest(questToGive, true); } @@ -1175,7 +1175,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1190,12 +1190,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, amount = Integer.parseInt(args[1]); if (amount < 0) { - cs.sendMessage(RED + Lang.get("inputPosNum")); + cs.sendMessage(ChatColor.RED + Lang.get("inputPosNum")); return; } } catch (NumberFormatException e) { - cs.sendMessage(RED + Lang.get("inputNum")); + cs.sendMessage(ChatColor.RED + Lang.get("inputNum")); return; } @@ -1222,13 +1222,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (failCount < 10) { String msg = Lang.get("errorReading"); - msg = msg.replaceAll("", DARKAQUA + f.getName() + RED); - cs.sendMessage(RED + msg); + msg = msg.replaceAll("", ChatColor.DARK_AQUA + f.getName() + ChatColor.RED); + cs.sendMessage(ChatColor.RED + msg); failCount++; } else if (suppressed == false) { String msg = Lang.get("errorReadingSuppress"); - msg = msg.replaceAll("", DARKAQUA + f.getName() + RED); - cs.sendMessage(RED + msg); + msg = msg.replaceAll("", ChatColor.DARK_AQUA + f.getName() + ChatColor.RED); + cs.sendMessage(ChatColor.RED + msg); suppressed = true; } @@ -1236,13 +1236,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (failCount < 10) { String msg = Lang.get("errorReading"); - msg = msg.replaceAll("", DARKAQUA + f.getName() + RED); - cs.sendMessage(RED + msg); + msg = msg.replaceAll("", ChatColor.DARK_AQUA + f.getName() + ChatColor.RED); + cs.sendMessage(ChatColor.RED + msg); failCount++; } else if (suppressed == false) { String msg = Lang.get("errorReadingSuppress"); - msg = msg.replaceAll("", DARKAQUA + f.getName() + RED); - cs.sendMessage(RED + msg); + msg = msg.replaceAll("", ChatColor.DARK_AQUA + f.getName() + ChatColor.RED); + cs.sendMessage(ChatColor.RED + msg); suppressed = true; } @@ -1250,20 +1250,20 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } - cs.sendMessage(GREEN + Lang.get("done")); + cs.sendMessage(ChatColor.GREEN + Lang.get("done")); String msg = Lang.get("allQuestPointsSet"); - msg = msg.replaceAll("", AQUA + "" + amount + GOLD); - getServer().broadcastMessage(YELLOW + "" + GOLD + msg); + msg = msg.replaceAll("", ChatColor.AQUA + "" + amount + ChatColor.GOLD); + getServer().broadcastMessage(ChatColor.YELLOW + "" + ChatColor.GOLD + msg); } else { - cs.sendMessage(RED + Lang.get("errorDataFolder")); + cs.sendMessage(ChatColor.RED + Lang.get("errorDataFolder")); } } }); - cs.sendMessage(YELLOW + Lang.get("settingAllQuestPoints")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("settingAllQuestPoints")); for (Quester q : questers.values()) { q.questPoints = amount; @@ -1273,7 +1273,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1295,7 +1295,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (target == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); } else { @@ -1304,25 +1304,25 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, String msg = Lang.get("noCurrentQuest"); msg = msg.replaceAll("", target.getName()); - cs.sendMessage(YELLOW + msg); + cs.sendMessage(ChatColor.YELLOW + msg); } else { Quest found = findQuest(MiscUtil.concatArgArray(args, 2, args.length - 1, ' ')); if (found == null) { - cs.sendMessage(RED + Lang.get("questNotFound")); + cs.sendMessage(ChatColor.RED + Lang.get("questNotFound")); return; } String msg1 = Lang.get("questForceFinish"); - msg1 = msg1.replaceAll("", GREEN + target.getName() + GOLD); - msg1 = msg1.replaceAll("", PURPLE + found.name + GOLD); - cs.sendMessage(GOLD + msg1); + msg1 = msg1.replaceAll("", ChatColor.GREEN + target.getName() + ChatColor.GOLD); + msg1 = msg1.replaceAll("", ChatColor.DARK_PURPLE + found.name + ChatColor.GOLD); + cs.sendMessage(ChatColor.GOLD + msg1); String msg2 = Lang.get("questForcedFinish"); - msg2 = msg2.replaceAll("", GREEN + cs.getName() + GOLD); - msg2 = msg2.replaceAll("", PURPLE + found.name + GOLD); - target.sendMessage(GREEN + msg2); + msg2 = msg2.replaceAll("", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); + msg2 = msg2.replaceAll("", ChatColor.DARK_PURPLE + found.name + ChatColor.GOLD); + target.sendMessage(ChatColor.GREEN + msg2); found.completeQuest(quester); quester.saveData(); @@ -1333,7 +1333,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1368,16 +1368,16 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, try { stage = Integer.parseInt(args[2]); } catch (NumberFormatException e) { - cs.sendMessage(YELLOW + Lang.get("inputNum")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("inputNum")); } } else { - cs.sendMessage(YELLOW + Lang.get("COMMAND_QUESTADMIN_SETSTAGE_USAGE")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("COMMAND_QUESTADMIN_SETSTAGE_USAGE")); return; } if (target == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); } else { @@ -1386,14 +1386,14 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, String msg = Lang.get("noCurrentQuest"); msg = msg.replaceAll("", target.getName()); - cs.sendMessage(YELLOW + msg); + cs.sendMessage(ChatColor.YELLOW + msg); } else { Quest found = findQuest(MiscUtil.concatArgArray(args, 2, args.length - 1, ' ')); if (found == null) { - cs.sendMessage(RED + Lang.get("questNotFound")); + cs.sendMessage(ChatColor.RED + Lang.get("questNotFound")); return; } @@ -1401,7 +1401,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, found.setStage(quester, stage); } catch (InvalidStageException e) { String msg = Lang.get("invalidStageNum"); - msg = msg.replaceAll("", PURPLE + found.name + RED); + msg = msg.replaceAll("", ChatColor.DARK_PURPLE + found.name + ChatColor.RED); cs.sendMessage(ChatColor.RED + msg); } @@ -1413,7 +1413,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1435,7 +1435,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, if (target == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); } else { @@ -1444,25 +1444,25 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, String msg = Lang.get("noCurrentQuest"); msg = msg.replaceAll("", target.getName()); - cs.sendMessage(YELLOW + msg); + cs.sendMessage(ChatColor.YELLOW + msg); } else { Quest found = findQuest(MiscUtil.concatArgArray(args, 2, args.length - 1, ' ')); if (found == null) { - cs.sendMessage(RED + Lang.get("questNotFound")); + cs.sendMessage(ChatColor.RED + Lang.get("questNotFound")); return; } String msg1 = Lang.get("questForceNextStage"); - msg1 = msg1.replaceAll("", GREEN + target.getName() + GOLD); - msg1 = msg1.replaceAll("", PURPLE + found.name + GOLD); - cs.sendMessage(GOLD + msg1); + msg1 = msg1.replaceAll("", ChatColor.GREEN + target.getName() + ChatColor.GOLD); + msg1 = msg1.replaceAll("", ChatColor.DARK_PURPLE + found.name + ChatColor.GOLD); + cs.sendMessage(ChatColor.GOLD + msg1); String msg2 = Lang.get("questForcedNextStage"); - msg2 = msg2.replaceAll("", GREEN + cs.getName() + GOLD); - msg2 = msg2.replaceAll("", PURPLE + found.name + GOLD); - target.sendMessage(GREEN + msg2); + msg2 = msg2.replaceAll("", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); + msg2 = msg2.replaceAll("", ChatColor.DARK_PURPLE + found.name + ChatColor.GOLD); + target.sendMessage(ChatColor.GREEN + msg2); found.nextStage(quester); quester.saveData(); @@ -1473,7 +1473,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1495,7 +1495,7 @@ try{ if (target == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); } else { @@ -1504,27 +1504,27 @@ try{ String msg = Lang.get("noCurrentQuest"); msg = msg.replaceAll("", target.getName()); - cs.sendMessage(YELLOW + msg); + cs.sendMessage(ChatColor.YELLOW + msg); } else { Quest found = findQuest(MiscUtil.concatArgArray(args, 2, args.length - 1, ' ')); if (found == null) { - cs.sendMessage(RED + Lang.get("questNotFound")); + cs.sendMessage(ChatColor.RED + Lang.get("questNotFound")); return; } quester.hardQuit(found); String msg1 = Lang.get("questForceQuit"); - msg1 = msg1.replaceAll("", GREEN + target.getName() + GOLD); - msg1 = msg1.replaceAll("", PURPLE + found.name + GOLD); - cs.sendMessage(GOLD + msg1); + msg1 = msg1.replaceAll("", ChatColor.GREEN + target.getName() + ChatColor.GOLD); + msg1 = msg1.replaceAll("", ChatColor.DARK_PURPLE + found.name + ChatColor.GOLD); + cs.sendMessage(ChatColor.GOLD + msg1); String msg2 = Lang.get("questForcedQuit"); - msg2 = msg2.replaceAll("", GREEN + cs.getName() + GOLD); - msg2 = msg2.replaceAll("", PURPLE + found.name + GOLD); - target.sendMessage(GREEN + msg2); + msg2 = msg2.replaceAll("", ChatColor.GREEN + cs.getName() + ChatColor.GOLD); + msg2 = msg2.replaceAll("", ChatColor.DARK_PURPLE + found.name + ChatColor.GOLD); + target.sendMessage(ChatColor.GREEN + msg2); quester.saveData(); quester.updateJournal(); @@ -1535,7 +1535,7 @@ try{ } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } }catch(NullPointerException npe) { @@ -1551,7 +1551,7 @@ try{ Quester quester = getQuester(args[1]); if (quester == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); return; } @@ -1566,19 +1566,19 @@ try{ String msg = Lang.get("questPurged"); if (Bukkit.getOfflinePlayer(quester.id).getName() != null) { - msg = msg.replaceAll("", GREEN + Bukkit.getOfflinePlayer(quester.id).getName() + GOLD); + msg = msg.replaceAll("", ChatColor.GREEN + Bukkit.getOfflinePlayer(quester.id).getName() + ChatColor.GOLD); } else { - msg = msg.replaceAll("", GREEN + args[1] + GOLD); + msg = msg.replaceAll("", ChatColor.GREEN + args[1] + ChatColor.GOLD); } - cs.sendMessage(GOLD + msg); - cs.sendMessage(PURPLE + " UUID: " + DARKAQUA + quester.id); + cs.sendMessage(ChatColor.GOLD + msg); + cs.sendMessage(ChatColor.DARK_PURPLE + " UUID: " + ChatColor.DARK_AQUA + quester.id); } catch (Exception e) { getLogger().info("Data file does not exist for " + quester.id.toString()); } } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1590,7 +1590,7 @@ try{ Quester quester = getQuester(args[1]); if (quester == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); return; } UUID id = quester.id; @@ -1606,12 +1606,12 @@ try{ String msg = Lang.get("questReset"); if (Bukkit.getOfflinePlayer(id).getName() != null) { - msg = msg.replaceAll("", GREEN + Bukkit.getOfflinePlayer(id).getName() + GOLD); + msg = msg.replaceAll("", ChatColor.GREEN + Bukkit.getOfflinePlayer(id).getName() + ChatColor.GOLD); } else { - msg = msg.replaceAll("", GREEN + args[1] + GOLD); + msg = msg.replaceAll("", ChatColor.GREEN + args[1] + ChatColor.GOLD); } - cs.sendMessage(GOLD + msg); - cs.sendMessage(PURPLE + " UUID: " + DARKAQUA + id); + cs.sendMessage(ChatColor.GOLD + msg); + cs.sendMessage(ChatColor.DARK_PURPLE + " UUID: " + ChatColor.DARK_AQUA + id); } catch (Exception e) { @@ -1625,7 +1625,7 @@ try{ } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1638,7 +1638,7 @@ try{ } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1650,25 +1650,25 @@ try{ Quester quester = getQuester(args[1]); if (quester == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); return; } Quest toRemove = findQuest(MiscUtil.concatArgArray(args, 2, args.length - 1, ' ')); if (toRemove == null) { - cs.sendMessage(RED + Lang.get("questNotFound")); + cs.sendMessage(ChatColor.RED + Lang.get("questNotFound")); return; } String msg = Lang.get("questRemoved"); if (Bukkit.getOfflinePlayer(quester.id).getName() != null) { - msg = msg.replaceAll("", GREEN + Bukkit.getOfflinePlayer(quester.id).getName() + GOLD); + msg = msg.replaceAll("", ChatColor.GREEN + Bukkit.getOfflinePlayer(quester.id).getName() + ChatColor.GOLD); } else { - msg = msg.replaceAll("", GREEN + args[1] + GOLD); + msg = msg.replaceAll("", ChatColor.GREEN + args[1] + ChatColor.GOLD); } msg = msg.replaceAll("", ChatColor.DARK_PURPLE + toRemove.name + ChatColor.AQUA); - cs.sendMessage(GOLD + msg); - cs.sendMessage(PURPLE + " UUID: " + DARKAQUA + quester.id.toString()); + cs.sendMessage(ChatColor.GOLD + msg); + cs.sendMessage(ChatColor.DARK_PURPLE + " UUID: " + ChatColor.DARK_AQUA + quester.id.toString()); quester.hardRemove(toRemove); @@ -1677,7 +1677,7 @@ try{ } else { - cs.sendMessage(RED + Lang.get("questCmdNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questCmdNoPerms")); } } @@ -1731,7 +1731,7 @@ try{ } else { - cs.sendMessage(YELLOW + Lang.get("questsUnknownCommand")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("questsUnknownCommand")); return true; } @@ -1747,20 +1747,20 @@ try{ convertQuesters(); } else { - cs.sendMessage(YELLOW + Lang.get("questsUnknownCommand")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("questsUnknownCommand")); return true; } } else { - cs.sendMessage(YELLOW + "This command may only be performed in-game."); + cs.sendMessage(ChatColor.YELLOW + "This command may only be performed in-game."); return true; } } else { - cs.sendMessage(YELLOW + "This command may only be performed in-game."); + cs.sendMessage(ChatColor.YELLOW + "This command may only be performed in-game."); return true; } @@ -1769,8 +1769,8 @@ try{ } private boolean questsInfo(final CommandSender cs) { - cs.sendMessage(GOLD + Lang.get("quests") + " " + this.getDescription().getVersion()); - cs.sendMessage(GOLD + Lang.get("createdBy") + " " + DARKRED + "Blackvein"); + cs.sendMessage(ChatColor.GOLD + Lang.get("quests") + " " + this.getDescription().getVersion()); + cs.sendMessage(ChatColor.GOLD + Lang.get("createdBy") + " " + ChatColor.DARK_RED + "Blackvein"); return true; } @@ -1778,7 +1778,7 @@ try{ if (cs.hasPermission("quests.editor.*") || cs.hasPermission("quests.editor.events.editor")) { eventFactory.convoCreator.buildConversation((Conversable) cs).begin(); } else { - cs.sendMessage(RED + Lang.get("eventEditorNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("eventEditorNoPerms")); } return true; } @@ -1787,7 +1787,7 @@ try{ if (cs.hasPermission("quests.editor.*") || cs.hasPermission("quests.editor.editor")) { questFactory.convoCreator.buildConversation((Conversable) cs).begin(); } else { - cs.sendMessage(RED + Lang.get("questEditorNoPerms")); + cs.sendMessage(ChatColor.RED + Lang.get("questEditorNoPerms")); } return true; } @@ -1795,7 +1795,7 @@ try{ private boolean questsTop(final CommandSender cs, String[] args) { if (args.length == 1 || args.length > 2) { - cs.sendMessage(YELLOW + Lang.get("COMMAND_TOP_USAGE")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("COMMAND_TOP_USAGE")); } else { @@ -1807,14 +1807,14 @@ try{ } catch (NumberFormatException e) { - cs.sendMessage(YELLOW + Lang.get("inputNum")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("inputNum")); return true; } if (topNumber < 1) { - cs.sendMessage(YELLOW + Lang.get("inputPosNum")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("inputPosNum")); return true; } @@ -1849,8 +1849,8 @@ try{ int numPrinted = 0; String msg = Lang.get("topQuestersTitle"); - msg = msg.replaceAll("", PURPLE + "" + topNumber + GOLD); - cs.sendMessage(GOLD + msg); + msg = msg.replaceAll("", ChatColor.DARK_PURPLE + "" + topNumber + ChatColor.GOLD); + cs.sendMessage(ChatColor.GOLD + msg); for (String s : sortedMap.keySet()) { int i = (Integer) sortedMap.get(s); @@ -1858,7 +1858,7 @@ try{ UUID id = UUID.fromString(s); s = Bukkit.getOfflinePlayer(id).getName(); numPrinted++; - cs.sendMessage(YELLOW + String.valueOf(numPrinted) + ". " + s + " - " + PURPLE + i + YELLOW + " " + Lang.get("questPoints")); + cs.sendMessage(ChatColor.YELLOW + String.valueOf(numPrinted) + ". " + s + " - " + ChatColor.DARK_PURPLE + i + ChatColor.YELLOW + " " + Lang.get("questPoints")); if (numPrinted == topNumber) { break; @@ -1880,41 +1880,41 @@ try{ quester = getQuester(args[1]); if (quester == null) { - cs.sendMessage(YELLOW + Lang.get("playerNotFound")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("playerNotFound")); return; } else if (Bukkit.getOfflinePlayer(quester.id).getName() != null) { - cs.sendMessage(GOLD + "- " + Bukkit.getOfflinePlayer(quester.id).getName() + " -"); + cs.sendMessage(ChatColor.GOLD + "- " + Bukkit.getOfflinePlayer(quester.id).getName() + " -"); } else { - cs.sendMessage(GOLD + "- " + args[1] + " -"); + cs.sendMessage(ChatColor.GOLD + "- " + args[1] + " -"); } } else { quester = getQuester(((Player)cs).getUniqueId()); - cs.sendMessage(GOLD + "- " + ((Player)cs).getName() + " -"); + cs.sendMessage(ChatColor.GOLD + "- " + ((Player)cs).getName() + " -"); } - cs.sendMessage(YELLOW + Lang.get("questPointsDisplay") + " " + PURPLE + quester.questPoints); + cs.sendMessage(ChatColor.YELLOW + Lang.get("questPointsDisplay") + " " + ChatColor.DARK_PURPLE + quester.questPoints); if (quester.currentQuests.isEmpty()) { - cs.sendMessage(YELLOW + Lang.get("currentQuest") + " " + PURPLE + Lang.get("none")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest") + " " + ChatColor.DARK_PURPLE + Lang.get("none")); } else { - cs.sendMessage(YELLOW + Lang.get("currentQuest")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest")); for (Quest q : quester.currentQuests.keySet()) { - cs.sendMessage(PINK + " - " + PURPLE + q.name); + cs.sendMessage(ChatColor.LIGHT_PURPLE + " - " + ChatColor.DARK_PURPLE + q.name); } } String completed; if (quester.completedQuests.isEmpty()) { - completed = PURPLE + Lang.get("none"); + completed = ChatColor.DARK_PURPLE + Lang.get("none"); } else { - completed = PURPLE + ""; + completed = ChatColor.DARK_PURPLE + ""; for (String s : quester.completedQuests) { completed += s; if (quester.amountsCompleted.containsKey(s) && quester.amountsCompleted.get(s) > 1) { - completed += PINK + " (x" + quester.amountsCompleted.get(s) + ")"; + completed += ChatColor.LIGHT_PURPLE + " (x" + quester.amountsCompleted.get(s) + ")"; } if (quester.completedQuests.indexOf(s) < (quester.completedQuests.size() - 1)) { @@ -1925,7 +1925,7 @@ try{ } - cs.sendMessage(YELLOW + Lang.get("completedQuestsTitle")); + cs.sendMessage(ChatColor.YELLOW + Lang.get("completedQuestsTitle")); cs.sendMessage(completed); } @@ -1948,17 +1948,17 @@ try{ } } - player.sendMessage(YELLOW + Lang.get("journalPutAway")); + player.sendMessage(ChatColor.YELLOW + Lang.get("journalPutAway")); quester.hasJournal = false; } else if(player.getItemInHand() == null || player.getItemInHand().getType().equals(Material.AIR)) { ItemStack stack = new ItemStack(Material.WRITTEN_BOOK, 1); ItemMeta meta = stack.getItemMeta(); - meta.setDisplayName(PINK + Lang.get("journalTitle")); + meta.setDisplayName(ChatColor.LIGHT_PURPLE + Lang.get("journalTitle")); stack.setItemMeta(meta); player.setItemInHand(stack); - player.sendMessage(YELLOW + Lang.get("journalTaken")); + player.sendMessage(ChatColor.YELLOW + Lang.get("journalTaken")); quester.hasJournal = true; quester.updateJournal(); @@ -1972,10 +1972,10 @@ try{ if(arr[i] == null) { ItemStack stack = new ItemStack(Material.WRITTEN_BOOK, 1); ItemMeta meta = stack.getItemMeta(); - meta.setDisplayName(PINK + Lang.get("journalTitle")); + meta.setDisplayName(ChatColor.LIGHT_PURPLE + Lang.get("journalTitle")); stack.setItemMeta(meta); inv.setItem(i, stack); - player.sendMessage(YELLOW + Lang.get("journalTaken")); + player.sendMessage(ChatColor.YELLOW + Lang.get("journalTaken")); given = true; break; } @@ -1986,7 +1986,7 @@ try{ quester.hasJournal = true; quester.updateJournal(); }else - player.sendMessage(YELLOW + Lang.get("journalNoRoom")); + player.sendMessage(ChatColor.YELLOW + Lang.get("journalNoRoom")); } } @@ -1998,7 +1998,7 @@ try{ if (((Player) player).hasPermission("quests.quit")) { if (args.length == 1) { - player.sendMessage(RED + Lang.get("COMMAND_QUIT_HELP")); + player.sendMessage(ChatColor.RED + Lang.get("COMMAND_QUIT_HELP")); return true; } @@ -2008,15 +2008,15 @@ try{ Quest found = findQuest(MiscUtil.concatArgArray(args, 1, args.length - 1, ' ')); if (found == null) { - player.sendMessage(RED + Lang.get("questNotFound")); + player.sendMessage(ChatColor.RED + Lang.get("questNotFound")); return true; } quester.hardQuit(found); String msg = Lang.get("questQuit"); - msg = msg.replaceAll("", PURPLE + found.name + YELLOW); - player.sendMessage(YELLOW + msg); + msg = msg.replaceAll("", ChatColor.DARK_PURPLE + found.name + ChatColor.YELLOW); + player.sendMessage(ChatColor.YELLOW + msg); quester.saveData(); quester.loadData(); quester.updateJournal(); @@ -2024,20 +2024,20 @@ try{ } else { - player.sendMessage(YELLOW + Lang.get("noActiveQuest")); + player.sendMessage(ChatColor.YELLOW + Lang.get("noActiveQuest")); return true; } } else { - player.sendMessage(RED + Lang.get("questQuitNoPerms")); + player.sendMessage(ChatColor.RED + Lang.get("questQuitNoPerms")); return true; } } else { - player.sendMessage(YELLOW + Lang.get("questQuitDisabled")); + player.sendMessage(ChatColor.YELLOW + Lang.get("questQuitDisabled")); return true; } @@ -2050,7 +2050,7 @@ try{ if (args.length == 1) { - player.sendMessage(YELLOW + Lang.get("COMMAND_TAKE_USAGE")); + player.sendMessage(ChatColor.YELLOW + Lang.get("COMMAND_TAKE_USAGE")); } else { @@ -2101,22 +2101,22 @@ try{ if (quester.currentQuests.size() >= maxQuests && maxQuests > 0) { String msg = Lang.get("questMaxAllowed"); msg = msg.replaceAll("", String.valueOf(maxQuests)); - player.sendMessage(YELLOW + msg); + player.sendMessage(ChatColor.YELLOW + msg); } else if (quester.currentQuests.containsKey(q)) { String msg = Lang.get("questAlreadyOn"); - player.sendMessage(YELLOW + msg); + player.sendMessage(ChatColor.YELLOW + msg); } else if (quester.completedQuests.contains(q.name) && q.redoDelay < 0) { String msg = Lang.get("questAlreadyCompleted"); - msg = msg.replaceAll("", PURPLE + q.name + YELLOW); - player.sendMessage(YELLOW + msg); + msg = msg.replaceAll("", ChatColor.DARK_PURPLE + q.name + ChatColor.YELLOW); + player.sendMessage(ChatColor.YELLOW + msg); } else if (q.npcStart != null && allowCommandsForNpcQuests == false) { String msg = Lang.get("mustSpeakTo"); - msg = msg.replaceAll("", PURPLE + q.npcStart.getName() + YELLOW); - player.sendMessage(YELLOW + msg); + msg = msg.replaceAll("", ChatColor.DARK_PURPLE + q.npcStart.getName() + ChatColor.YELLOW); + player.sendMessage(ChatColor.YELLOW + msg); } else if (q.blockStart != null) { String msg = Lang.get("noCommandStart"); - msg = msg.replaceAll("", PURPLE + q.name + YELLOW); - player.sendMessage(YELLOW + msg); + msg = msg.replaceAll("", ChatColor.DARK_PURPLE + q.name + ChatColor.YELLOW); + player.sendMessage(ChatColor.YELLOW + msg); } else { boolean takeable = true; @@ -2127,7 +2127,7 @@ try{ String early = Lang.get("questTooEarly"); early = early.replaceAll("", ChatColor.AQUA + q.name + ChatColor.YELLOW); early = early.replaceAll("