Merge pull request #532 from GregZ123/master

Removed ColorUtil and ReflectionUtil, also pom resources now include data.yml
This commit is contained in:
FlyingPikachu 2017-06-18 16:04:54 -04:00 committed by GitHub
commit 46082dff7e
26 changed files with 1810 additions and 1877 deletions

25
.gitignore vendored
View File

@ -1,6 +1,27 @@
/target
# Ignore IDEA files # Ignore IDEA files
/.idea /.idea
*.iml *.iml
/bin/ /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*

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId> <artifactId>quests</artifactId>
<version>2.8.2</version> <version>2.8.2-04</version>
<name>quests</name> <name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url> <url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging> <packaging>jar</packaging>
@ -165,6 +165,7 @@
<include>plugin.yml</include> <include>plugin.yml</include>
<include>events.yml</include> <include>events.yml</include>
<include>quests.yml</include> <include>quests.yml</include>
<include>data.yml</include>
</includes> </includes>
</resource> </resource>
<resource> <resource>

View File

@ -1,13 +1,12 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
import org.bukkit.entity.Player; 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 { 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 { 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(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum,
ReflectionUtil.setValue(packet, "a", particleEnum); false,
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getX(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getY(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "e", offsetX); offsetX,
ReflectionUtil.setValue(packet, "f", offsetY); offsetY,
ReflectionUtil.setValue(packet, "g", offsetZ); offsetZ,
ReflectionUtil.setValue(packet, "h", speed); speed,
ReflectionUtil.setValue(packet, "i", count); count,
ReflectionUtil.setValue(packet, "k", data); data);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -1,13 +1,12 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
import org.bukkit.entity.Player; 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 { 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 { 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(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum,
ReflectionUtil.setValue(packet, "a", particleEnum); false,
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getX(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getY(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "e", offsetX); offsetX,
ReflectionUtil.setValue(packet, "f", offsetY); offsetY,
ReflectionUtil.setValue(packet, "g", offsetZ); offsetZ,
ReflectionUtil.setValue(packet, "h", speed); speed,
ReflectionUtil.setValue(packet, "i", count); count,
ReflectionUtil.setValue(packet, "k", data); data);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -1,13 +1,12 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
import org.bukkit.entity.Player; 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 { 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 { 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(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum,
ReflectionUtil.setValue(packet, "a", particleEnum); false,
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getX(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getY(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "e", offsetX); offsetX,
ReflectionUtil.setValue(packet, "f", offsetY); offsetY,
ReflectionUtil.setValue(packet, "g", offsetZ); offsetZ,
ReflectionUtil.setValue(packet, "h", speed); speed,
ReflectionUtil.setValue(packet, "i", count); count,
ReflectionUtil.setValue(packet, "k", data); data);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -1,12 +1,11 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles;
public enum Eff_1_7_R3 { public enum Eff_1_7_R3 {
HUGE_EXPLOSION("hugeexplosion"), 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 { public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count) throws Exception {
PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleName,
ReflectionUtil.setValue(packet, "a", particleName); (float) location.getX(),
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getY(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); offsetX,
ReflectionUtil.setValue(packet, "e", offsetX); offsetY,
ReflectionUtil.setValue(packet, "f", offsetY); offsetZ,
ReflectionUtil.setValue(packet, "g", offsetZ); speed,
ReflectionUtil.setValue(packet, "h", speed); count);
ReflectionUtil.setValue(packet, "i", count);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -1,12 +1,11 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles;
public enum Eff_1_7_R4 { public enum Eff_1_7_R4 {
HUGE_EXPLOSION("hugeexplosion"), 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 { public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count) throws Exception {
PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleName,
ReflectionUtil.setValue(packet, "a", particleName); (float) location.getX(),
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getY(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); offsetX,
ReflectionUtil.setValue(packet, "e", offsetX); offsetY,
ReflectionUtil.setValue(packet, "f", offsetY); offsetZ,
ReflectionUtil.setValue(packet, "g", offsetZ); speed,
ReflectionUtil.setValue(packet, "h", speed); count);
ReflectionUtil.setValue(packet, "i", count);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -1,13 +1,12 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.entity.Player; 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 { public enum Eff_1_8_R1 {
EXPLOSION(EnumParticle.EXPLOSION_NORMAL), 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 { 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(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum,
ReflectionUtil.setValue(packet, "a", particleEnum); false,
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getX(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getY(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "e", offsetX); offsetX,
ReflectionUtil.setValue(packet, "f", offsetY); offsetY,
ReflectionUtil.setValue(packet, "g", offsetZ); offsetZ,
ReflectionUtil.setValue(packet, "h", speed); speed,
ReflectionUtil.setValue(packet, "i", count); count,
ReflectionUtil.setValue(packet, "k", data); data);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -1,13 +1,12 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.entity.Player; 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 { public enum Eff_1_8_R2 {
EXPLOSION(EnumParticle.EXPLOSION_NORMAL), 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 { 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(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum,
ReflectionUtil.setValue(packet, "a", particleEnum); false,
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getX(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getY(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "e", offsetX); offsetX,
ReflectionUtil.setValue(packet, "f", offsetY); offsetY,
ReflectionUtil.setValue(packet, "g", offsetZ); offsetZ,
ReflectionUtil.setValue(packet, "h", speed); speed,
ReflectionUtil.setValue(packet, "i", count); count,
ReflectionUtil.setValue(packet, "k", data); data);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -1,13 +1,12 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Player; 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 { public enum Eff_1_8_R3 {
EXPLOSION(EnumParticle.EXPLOSION_NORMAL), 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 { 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(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum,
ReflectionUtil.setValue(packet, "a", particleEnum); false,
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getX(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getY(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "e", offsetX); offsetX,
ReflectionUtil.setValue(packet, "f", offsetY); offsetY,
ReflectionUtil.setValue(packet, "g", offsetZ); offsetZ,
ReflectionUtil.setValue(packet, "h", speed); speed,
ReflectionUtil.setValue(packet, "i", count); count,
ReflectionUtil.setValue(packet, "k", data); data);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -1,13 +1,12 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
import org.bukkit.entity.Player; 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 { public enum Eff_1_9_R1 {
EXPLOSION(EnumParticle.EXPLOSION_NORMAL), 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 { 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(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum,
ReflectionUtil.setValue(packet, "a", particleEnum); false,
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getX(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getY(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "e", offsetX); offsetX,
ReflectionUtil.setValue(packet, "f", offsetY); offsetY,
ReflectionUtil.setValue(packet, "g", offsetZ); offsetZ,
ReflectionUtil.setValue(packet, "h", speed); speed,
ReflectionUtil.setValue(packet, "i", count); count,
ReflectionUtil.setValue(packet, "k", data); data);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -1,13 +1,12 @@
package me.blackvein.particles; 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.Location;
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer;
import org.bukkit.entity.Player; 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 { public enum Eff_1_9_R2 {
EXPLOSION(EnumParticle.EXPLOSION_NORMAL), 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 { 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(); PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum,
ReflectionUtil.setValue(packet, "a", particleEnum); false,
ReflectionUtil.setValue(packet, "b", (float) location.getX()); (float) location.getX(),
ReflectionUtil.setValue(packet, "c", (float) location.getY()); (float) location.getY(),
ReflectionUtil.setValue(packet, "d", (float) location.getZ()); (float) location.getZ(),
ReflectionUtil.setValue(packet, "e", offsetX); offsetX,
ReflectionUtil.setValue(packet, "f", offsetY); offsetY,
ReflectionUtil.setValue(packet, "g", offsetZ); offsetZ,
ReflectionUtil.setValue(packet, "h", speed); speed,
ReflectionUtil.setValue(packet, "i", count); count,
ReflectionUtil.setValue(packet, "k", data); data);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }

View File

@ -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;
}

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,7 @@ import org.bukkit.projectiles.ProjectileSource;
import com.sk89q.worldguard.protection.managers.RegionManager; import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedRegion; import com.sk89q.worldguard.protection.regions.ProtectedRegion;
public class PlayerListener implements Listener, ColorUtil { public class PlayerListener implements Listener {
final Quests plugin; final Quests plugin;
@ -125,7 +125,7 @@ public class PlayerListener implements Listener, ColorUtil {
String msg = Lang.get("questMaxAllowed"); String msg = Lang.get("questMaxAllowed");
msg = msg.replaceAll("<number>", String.valueOf(Quests.maxQuests)); msg = msg.replaceAll("<number>", String.valueOf(Quests.maxQuests));
player.sendMessage(YELLOW + msg); player.sendMessage(ChatColor.YELLOW + msg);
} else if (quester.completedQuests.contains(quest.name) && quest.redoDelay < 0) { } else if (quester.completedQuests.contains(quest.name) && quest.redoDelay < 0) {
String completed = Lang.get("questAlreadyCompleted"); String completed = Lang.get("questAlreadyCompleted");
@ -381,7 +381,7 @@ public class PlayerListener implements Listener, ColorUtil {
if (evt.getRightClicked().getType() == EntityType.ITEM_FRAME) { if (evt.getRightClicked().getType() == EntityType.ITEM_FRAME) {
if(ItemUtil.isJournal(evt.getPlayer().getItemInHand())) { if(ItemUtil.isJournal(evt.getPlayer().getItemInHand())) {
evt.setCancelled(true); evt.setCancelled(true);
evt.getPlayer().sendMessage(RED + Lang.get("journalDenied")); evt.getPlayer().sendMessage(ChatColor.RED + Lang.get("journalDenied"));
} }
} }
} }

View File

@ -1,9 +1,5 @@
package me.blackvein.quests; package me.blackvein.quests;
import com.sk89q.worldguard.protection.managers.RegionManager;
import me.blackvein.quests.util.ColorUtil;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
@ -14,15 +10,6 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.UUID; 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.ChatColor;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Location; import org.bukkit.Location;
@ -33,13 +20,31 @@ import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration; 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.enchantments.Enchantment;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; 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; public Quests quests;
Map<UUID, Quest> editSessions = new HashMap<UUID, Quest>(); Map<UUID, Quest> editSessions = new HashMap<UUID, Quest>();
@ -94,11 +99,11 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text String text
= GOLD + Lang.get("questEditorTitle") + "\n" = ChatColor.GOLD + Lang.get("questEditorTitle") + "\n"
+ BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("questEditorCreate") + "\n" + ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorCreate") + "\n"
+ BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("questEditorEdit") + "\n" + ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorEdit") + "\n"
+ BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("questEditorDelete") + "\n" + ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("questEditorDelete") + "\n"
+ GOLD + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("exit"); + ChatColor.GOLD + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("exit");
return text; return text;
@ -114,7 +119,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.create")) { if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.create")) {
return new QuestNamePrompt(); return new QuestNamePrompt();
} else { } else {
player.sendMessage(RED + Lang.get("questEditorNoPermsCreate")); player.sendMessage(ChatColor.RED + Lang.get("questEditorNoPermsCreate"));
return new MenuPrompt(); return new MenuPrompt();
} }
@ -123,7 +128,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.edit")) { if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.edit")) {
return new SelectEditPrompt(); return new SelectEditPrompt();
} else { } else {
player.sendMessage(RED + Lang.get("questEditorNoPermsCreate")); player.sendMessage(ChatColor.RED + Lang.get("questEditorNoPermsCreate"));
return new MenuPrompt(); return new MenuPrompt();
} }
@ -132,12 +137,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.delete")) { if (player.hasPermission("quests.editor.*") || player.hasPermission("quests.editor.delete")) {
return new SelectDeletePrompt(); return new SelectDeletePrompt();
} else { } else {
player.sendMessage(RED + Lang.get("questEditorNoPermsDelete")); player.sendMessage(ChatColor.RED + Lang.get("questEditorNoPermsDelete"));
return new MenuPrompt(); return new MenuPrompt();
} }
} else if (input.equalsIgnoreCase("4")) { } 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; return Prompt.END_OF_CONVERSATION;
} }
@ -164,29 +169,29 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text 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) { 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 { } 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) { 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 { } 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) { 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 { } else {
//something here is throwing an exception //something here is throwing an exception
try { 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) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -195,27 +200,27 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} }
if (context.getSessionData(CK.Q_START_NPC) == null && quests.citizens != null) { 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) { } 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 (context.getSessionData(CK.Q_START_BLOCK) == null) {
if (quests.citizens != 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 { } 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 { } else {
if (quests.citizens != null) { if (quests.citizens != null) {
Location l = (Location) context.getSessionData(CK.Q_START_BLOCK); 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 { } else {
Location l = (Location) context.getSessionData(CK.Q_START_BLOCK); 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 (context.getSessionData(CK.Q_REGION) == null) {
if (quests.citizens != 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 { } 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 { } else {
if (quests.citizens != null) { if (quests.citizens != null) {
String s = (String) context.getSessionData(CK.Q_REGION); 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 { } else {
String s = (String) context.getSessionData(CK.Q_REGION); 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 { } else {
if (quests.citizens != null) { 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 { } 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 (context.getSessionData(CK.Q_INITIAL_EVENT) == null) {
if (quests.citizens != 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 { } 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 { } else {
if (quests.citizens != null) { if (quests.citizens != null) {
String s = (String) context.getSessionData(CK.Q_INITIAL_EVENT); 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 { } else {
String s = (String) context.getSessionData(CK.Q_INITIAL_EVENT); 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 (quests.citizens != null) {
if (context.getSessionData(CK.Q_GUIDISPLAY) == 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 { } else {
ItemStack stack = (ItemStack) context.getSessionData(CK.Q_GUIDISPLAY); 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 { } 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) { 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 { } 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) { 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 { } 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) { 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 { } 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) { 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 { } 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) { 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 { } 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; return text;
@ -438,12 +443,12 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { 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()) { 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 @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = GOLD + Lang.get("questCreateTitle") + "\n"; String text = ChatColor.GOLD + Lang.get("questCreateTitle") + "\n";
text += AQUA + Lang.get("questEditorCreate") + " " + GOLD + "- " + Lang.get("questEditorEnterQuestName"); text += ChatColor.AQUA + Lang.get("questEditorCreate") + " " + ChatColor.GOLD + "- " + Lang.get("questEditorEnterQuestName");
return text; return text;
@ -651,7 +656,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} }
if (s != null && s.equalsIgnoreCase(input) == false) { 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(); return new SetNamePrompt();
} }
} }
@ -659,7 +664,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} }
if (names.contains(input)) { if (names.contains(input)) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorBeingEdited")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorBeingEdited"));
return new SetNamePrompt(); return new SetNamePrompt();
} }
@ -740,16 +745,16 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { 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()) { if (quests.events.isEmpty()) {
text += RED + "- " + Lang.get("none"); text += ChatColor.RED + "- " + Lang.get("none");
} else { } else {
for (Event e : quests.events) { 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) { if (found == null) {
player.sendMessage(RED + input + YELLOW + " " + Lang.get("questEditorInvalidEventName")); player.sendMessage(ChatColor.RED + input + ChatColor.YELLOW + " " + Lang.get("questEditorInvalidEventName"));
return new InitialEventPrompt(); return new InitialEventPrompt();
} else { } else {
context.setSessionData(CK.Q_INITIAL_EVENT, found.getName()); 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"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
context.setSessionData(CK.Q_INITIAL_EVENT, null); context.setSessionData(CK.Q_INITIAL_EVENT, null);
player.sendMessage(YELLOW + Lang.get("questEditorEventCleared")); player.sendMessage(ChatColor.YELLOW + Lang.get("questEditorEventCleared"));
return new CreateMenuPrompt(); return new CreateMenuPrompt();
} else { } else {
return new CreateMenuPrompt(); return new CreateMenuPrompt();
@ -813,8 +818,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
if (ItemUtil.compareItems(stack, quest.guiDisplay, false) == 0) { if (ItemUtil.compareItems(stack, quest.guiDisplay, false) == 0) {
String error = Lang.get("questGUIError"); String error = Lang.get("questGUIError");
error = error.replaceAll("<quest>", PURPLE + quest.name + RED); error = error.replaceAll("<quest>", ChatColor.DARK_PURPLE + quest.name + ChatColor.RED);
context.getForWhom().sendRawMessage(RED + error); context.getForWhom().sendRawMessage(ChatColor.RED + error);
failed = true; failed = true;
break; 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) { if (context.getSessionData(CK.Q_GUIDISPLAY) != null) {
ItemStack stack = (ItemStack) context.getSessionData(CK.Q_GUIDISPLAY); 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 { } 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 += ChatColor.GREEN + "" + ChatColor.BOLD + "1 -" + ChatColor.RESET + ChatColor.DARK_GREEN + " " + Lang.get("questSetItem") + "\n";
text += GREEN + "" + BOLD + "2 -" + RESET + DARKGREEN + " " + Lang.get("questClearItem") + "\n"; text += ChatColor.GREEN + "" + ChatColor.BOLD + "2 -" + ChatColor.RESET + ChatColor.DARK_GREEN + " " + Lang.get("questClearItem") + "\n";
text += GREEN + "" + BOLD + "3 -" + RESET + GREEN + " " + Lang.get("done") + "\n"; text += ChatColor.GREEN + "" + ChatColor.BOLD + "3 -" + ChatColor.RESET + ChatColor.GREEN + " " + Lang.get("done") + "\n";
return text; return text;
@ -857,7 +862,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} else if (input.equalsIgnoreCase("2")) { } else if (input.equalsIgnoreCase("2")) {
context.setSessionData(CK.Q_GUIDISPLAY, null); context.setSessionData(CK.Q_GUIDISPLAY, null);
context.getForWhom().sendRawMessage(YELLOW + Lang.get("questGUICleared")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("questGUICleared"));
return new GUIDisplayPrompt(); return new GUIDisplayPrompt();
} else { } else {
@ -875,7 +880,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = DARKGREEN + Lang.get("questRegionTitle") + "\n"; String text = ChatColor.DARK_GREEN + Lang.get("questRegionTitle") + "\n";
boolean any = false; boolean any = false;
for (World world : quests.getServer().getWorlds()) { for (World world : quests.getServer().getWorlds()) {
@ -884,7 +889,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
for (String region : rm.getRegions().keySet()) { for (String region : rm.getRegions().keySet()) {
any = true; 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 = text.substring(0, text.length() - 2);
text += "\n\n"; text += "\n\n";
} else { } 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) { if (found == null) {
String error = Lang.get("questWGInvalidRegion"); String error = Lang.get("questWGInvalidRegion");
error = error.replaceAll("<region>", RED + input + YELLOW); error = error.replaceAll("<region>", ChatColor.RED + input + ChatColor.YELLOW);
player.sendMessage(RED + error); player.sendMessage(ChatColor.RED + error);
return new RegionPrompt(); return new RegionPrompt();
} else { } else {
context.setSessionData(CK.Q_REGION, found); context.setSessionData(CK.Q_REGION, found);
@ -941,7 +946,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
context.setSessionData(CK.Q_REGION, null); context.setSessionData(CK.Q_REGION, null);
player.sendMessage(YELLOW + Lang.get("questWGRegionCleared")); player.sendMessage(ChatColor.YELLOW + Lang.get("questWGRegionCleared"));
return new CreateMenuPrompt(); return new CreateMenuPrompt();
} else { } else {
return new CreateMenuPrompt(); return new CreateMenuPrompt();
@ -974,13 +979,13 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
int i = Integer.parseInt(input); int i = Integer.parseInt(input);
delay = i * 1000; delay = i * 1000;
} catch (NumberFormatException e) { } 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); //delay = MiscUtil.getTimeFromString(input);
return new RedoDelayPrompt(); return new RedoDelayPrompt();
} }
if (delay < -1) { if (delay < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorPositiveAmount")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorPositiveAmount"));
} else if (delay == 0) { } else if (delay == 0) {
context.setSessionData(CK.Q_REDO_DELAY, null); context.setSessionData(CK.Q_REDO_DELAY, null);
} else if (delay != -1) { } else if (delay != -1) {
@ -997,10 +1002,10 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = GREEN String text = ChatColor.GREEN
+ "1 - " + Lang.get("yesWord") + "\n" + "1 - " + Lang.get("yesWord") + "\n"
+ "2 - " + Lang.get("noWord"); + "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 (input.equalsIgnoreCase("1") || input.equalsIgnoreCase(Lang.get("yesWord"))) {
if (context.getSessionData(CK.Q_ASK_MESSAGE) == null) { 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(); return new CreateMenuPrompt();
} else if (context.getSessionData(CK.Q_FINISH_MESSAGE) == null) { } 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(); return new CreateMenuPrompt();
} else if (StagesPrompt.getStages(context) == 0) { } else if (StagesPrompt.getStages(context) == 0) {
context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNeedStages")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNeedStages"));
return new CreateMenuPrompt(); return new CreateMenuPrompt();
} }
@ -1046,7 +1051,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
} }
quests.updateData(); quests.updateData();
} }
context.getForWhom().sendRawMessage(BOLD + Lang.get("questEditorSaved")); context.getForWhom().sendRawMessage(ChatColor.BOLD + Lang.get("questEditorSaved"));
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -1070,7 +1075,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = GREEN String text = ChatColor.GREEN
+ "1 - " + Lang.get("yesWord") + "\n" + "1 - " + Lang.get("yesWord") + "\n"
+ "2 - " + Lang.get("noWord"); + "2 - " + Lang.get("noWord");
return ChatColor.YELLOW + Lang.get("questEditorExited") + "\n" + text; 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"))) { 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; return Prompt.END_OF_CONVERSATION;
} else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase(Lang.get("noWord"))) { } else if (input.equalsIgnoreCase("2") || input.equalsIgnoreCase(Lang.get("noWord"))) {
@ -2247,14 +2252,14 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { 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) { 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 = text.substring(0, text.length() - 1) + "\n";
text += YELLOW + Lang.get("questEditorEnterQuestName"); text += ChatColor.YELLOW + Lang.get("questEditorEnterQuestName");
return text; return text;
@ -2283,17 +2288,17 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
context.setSessionData(CK.ED_QUEST_DELETE, found.name); context.setSessionData(CK.ED_QUEST_DELETE, found.name);
return new DeletePrompt(); return new DeletePrompt();
} else { } 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) { 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(); return new SelectDeletePrompt();
} }
} }
((Player) context.getForWhom()).sendMessage(RED + Lang.get("questEditorQuestNotFound")); ((Player) context.getForWhom()).sendMessage(ChatColor.RED + Lang.get("questEditorQuestNotFound"));
return new SelectDeletePrompt(); return new SelectDeletePrompt();
} else { } else {
@ -2309,8 +2314,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text String text
= RED + Lang.get("questEditorDeleted") + " \"" + GOLD + (String) context.getSessionData(CK.ED_QUEST_DELETE) + RED + "\"?\n"; = ChatColor.RED + Lang.get("questEditorDeleted") + " \"" + ChatColor.GOLD + (String) context.getSessionData(CK.ED_QUEST_DELETE) + ChatColor.RED + "\"?\n";
text += YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord"); text += ChatColor.YELLOW + Lang.get("yesWord") + "/" + Lang.get("noWord");
return text; return text;
@ -2367,7 +2372,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
quests.reloadQuests(); quests.reloadQuests();
context.getForWhom().sendRawMessage(WHITE + "" + BOLD + Lang.get("questDeleted")); context.getForWhom().sendRawMessage(ChatColor.WHITE + "" + ChatColor.BOLD + Lang.get("questDeleted"));
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -8,11 +8,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.ColorUtil;
import me.blackvein.quests.util.Lang;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.ConversationContext;
@ -24,7 +19,11 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil { import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.Lang;
public class ItemStackPrompt extends FixedSetPrompt {
//Stores itemstack in "tempStack" context data. //Stores itemstack in "tempStack" context data.
//Stores name in "tempName" //Stores name in "tempName"
@ -44,7 +43,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String menu = YELLOW + Lang.get("createItemTitle") + "\n"; String menu = ChatColor.YELLOW + Lang.get("createItemTitle") + "\n";
if (cc.getSessionData("tempName") != null) { if (cc.getSessionData("tempName") != null) {
String stackData = getItemData(cc); String stackData = getItemData(cc);
if (stackData != null) { if (stackData != null) {
@ -53,15 +52,15 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
} else { } else {
menu += "\n"; menu += "\n";
} }
menu += GOLD + "" + BOLD + "0. " + RESET + "" + YELLOW + Lang.get("itemCreateLoadHand") + "\n"; menu += ChatColor.GOLD + "" + ChatColor.BOLD + "0. " + ChatColor.RESET + "" + ChatColor.YELLOW + Lang.get("itemCreateLoadHand") + "\n";
menu += YELLOW + "" + BOLD + "1. " + RESET + "" + GOLD + Lang.get("itemCreateSetName") + "\n"; menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "1. " + ChatColor.RESET + "" + ChatColor.GOLD + Lang.get("itemCreateSetName") + "\n";
menu += YELLOW + "" + BOLD + "2. " + RESET + "" + GOLD + Lang.get("itemCreateSetAmount") + "\n"; menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "2. " + ChatColor.RESET + "" + ChatColor.GOLD + Lang.get("itemCreateSetAmount") + "\n";
menu += YELLOW + "" + BOLD + "3. " + RESET + "" + GOLD + Lang.get("itemCreateSetDurab") + "\n"; menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "3. " + ChatColor.RESET + "" + ChatColor.GOLD + Lang.get("itemCreateSetDurab") + "\n";
menu += YELLOW + "" + BOLD + "4. " + RESET + "" + GOLD + Lang.get("itemCreateSetEnchs") + "\n"; menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "4. " + ChatColor.RESET + "" + ChatColor.GOLD + Lang.get("itemCreateSetEnchs") + "\n";
menu += YELLOW + "" + BOLD + "5. " + RESET + "" + ITALIC + GOLD + Lang.get("itemCreateSetDisplay") + "\n"; menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "5. " + ChatColor.RESET + "" + ChatColor.ITALIC + ChatColor.GOLD + Lang.get("itemCreateSetDisplay") + "\n";
menu += YELLOW + "" + BOLD + "6. " + RESET + "" + ITALIC + GOLD + Lang.get("itemCreateSetLore") + "\n"; menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "6. " + ChatColor.RESET + "" + ChatColor.ITALIC + ChatColor.GOLD + Lang.get("itemCreateSetLore") + "\n";
menu += YELLOW + "" + BOLD + "7. " + RESET + "" + RED + Lang.get("cancel") + "\n"; menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "7. " + ChatColor.RESET + "" + ChatColor.RED + Lang.get("cancel") + "\n";
menu += YELLOW + "" + BOLD + "8. " + RESET + "" + GREEN + Lang.get("done") + "\n"; menu += ChatColor.YELLOW + "" + ChatColor.BOLD + "8. " + ChatColor.RESET + "" + ChatColor.GREEN + Lang.get("done") + "\n";
return menu; return menu;
} }
@ -76,7 +75,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
ItemStack is = player.getItemInHand(); ItemStack is = player.getItemInHand();
if (is == null || is.getType().equals(Material.AIR)) { if (is == null || is.getType().equals(Material.AIR)) {
player.sendMessage(RED + Lang.get("itemCreateNoItem")); player.sendMessage(ChatColor.RED + Lang.get("itemCreateNoItem"));
return new ItemStackPrompt(oldPrompt); return new ItemStackPrompt(oldPrompt);
} else { } else {
@ -108,7 +107,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
} }
player.sendMessage(GREEN + Lang.get("itemCreateLoaded")); player.sendMessage(ChatColor.GREEN + Lang.get("itemCreateLoaded"));
return new ItemStackPrompt(oldPrompt); return new ItemStackPrompt(oldPrompt);
} }
@ -120,7 +119,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null) { if (cc.getSessionData("tempName") != null) {
return new AmountPrompt(); return new AmountPrompt();
} else { } else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoName")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoName"));
return new ItemStackPrompt(oldPrompt); return new ItemStackPrompt(oldPrompt);
} }
@ -129,7 +128,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) { if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) {
return new DataPrompt(); return new DataPrompt();
} else { } else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoIDAmount")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoIDAmount"));
return new ItemStackPrompt(oldPrompt); return new ItemStackPrompt(oldPrompt);
} }
@ -138,7 +137,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) { if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) {
return new EnchantmentPrompt(); return new EnchantmentPrompt();
} else { } else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoIDAmount")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoIDAmount"));
return new ItemStackPrompt(oldPrompt); return new ItemStackPrompt(oldPrompt);
} }
@ -147,7 +146,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) { if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) {
return new DisplayPrompt(); return new DisplayPrompt();
} else { } else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoNameAmount")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoNameAmount"));
return new ItemStackPrompt(oldPrompt); return new ItemStackPrompt(oldPrompt);
} }
@ -156,7 +155,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) { if (cc.getSessionData("tempName") != null && cc.getSessionData("tempAmount") != null) {
return new LorePrompt(); return new LorePrompt();
} else { } else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoNameAmount")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoNameAmount"));
return new ItemStackPrompt(oldPrompt); return new ItemStackPrompt(oldPrompt);
} }
@ -222,7 +221,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
cc.setSessionData("tempStack", stack); cc.setSessionData("tempStack", stack);
cc.setSessionData("newItem", Boolean.TRUE); cc.setSessionData("newItem", Boolean.TRUE);
} else { } else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNoNameAmount")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNoNameAmount"));
return new ItemStackPrompt(oldPrompt); return new ItemStackPrompt(oldPrompt);
} }
@ -231,7 +230,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
try { try {
return oldPrompt; return oldPrompt;
} catch (Exception e) { } catch (Exception e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateCriticalError")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateCriticalError"));
return Prompt.END_OF_CONVERSATION; return Prompt.END_OF_CONVERSATION;
} }
} }
@ -240,7 +239,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterName"); return ChatColor.YELLOW + Lang.get("itemCreateEnterName");
} }
@Override @Override
@ -258,7 +257,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
Material mat = Material.matchMaterial(input.toUpperCase().replace(" ", "_")); Material mat = Material.matchMaterial(input.toUpperCase().replace(" ", "_"));
if (mat == null) { if (mat == null) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidName")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidName"));
return new NamePrompt(); return new NamePrompt();
} else { } else {
cc.setSessionData("tempName", mat.name()); cc.setSessionData("tempName", mat.name());
@ -269,7 +268,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
short data = Short.parseShort(dataString); short data = Short.parseShort(dataString);
cc.setSessionData("tempData", data); cc.setSessionData("tempData", data);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidData")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidData"));
return new NamePrompt(); return new NamePrompt();
} }
} }
@ -289,7 +288,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterAmount"); return ChatColor.YELLOW + Lang.get("itemCreateEnterAmount");
} }
@Override @Override
@ -300,7 +299,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
int amt = Integer.parseInt(input); int amt = Integer.parseInt(input);
if (amt < 1 || amt > 64) { if (amt < 1 || amt > 64) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidAmount")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidAmount"));
return new AmountPrompt(); return new AmountPrompt();
} else { } else {
cc.setSessionData("tempAmount", Integer.parseInt(input)); cc.setSessionData("tempAmount", Integer.parseInt(input));
@ -308,7 +307,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidInput")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
return new AmountPrompt(); return new AmountPrompt();
} }
@ -325,7 +324,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterDurab"); return ChatColor.YELLOW + Lang.get("itemCreateEnterDurab");
} }
@Override @Override
@ -336,7 +335,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
int amt = Integer.parseInt(input); int amt = Integer.parseInt(input);
if (amt < 1) { if (amt < 1) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidDurab")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidDurab"));
return new DataPrompt(); return new DataPrompt();
} else { } else {
cc.setSessionData("tempData", Short.parseShort(input)); cc.setSessionData("tempData", Short.parseShort(input));
@ -344,7 +343,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidInput")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
return new DataPrompt(); return new DataPrompt();
} }
@ -365,15 +364,15 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = PINK + Lang.get("enchantmentsTitle") + "\n"; String text = ChatColor.LIGHT_PURPLE + Lang.get("enchantmentsTitle") + "\n";
for (Enchantment e : Enchantment.values()) { for (Enchantment e : Enchantment.values()) {
text += GREEN + Quester.prettyEnchantmentString(e) + ", "; text += ChatColor.GREEN + Quester.prettyEnchantmentString(e) + ", ";
} }
text = text.substring(0, text.length() - 1); text = text.substring(0, text.length() - 1);
return text + "\n" + YELLOW + Lang.get("itemCreateEnterEnch"); return text + "\n" + ChatColor.YELLOW + Lang.get("itemCreateEnterEnch");
} }
@ -390,7 +389,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
} else { } else {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidEnch")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidEnch"));
return new EnchantmentPrompt(); return new EnchantmentPrompt();
} }
@ -414,7 +413,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = Lang.get("itemCreateEnterLevel"); String text = Lang.get("itemCreateEnterLevel");
text = text.replaceAll("<enchantment>", enchantment); text = text.replaceAll("<enchantment>", enchantment);
return AQUA + text; return ChatColor.AQUA + text;
} }
@Override @Override
@ -424,7 +423,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
int num = Integer.parseInt(input); int num = Integer.parseInt(input);
if (num < 1) { if (num < 1) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateInvalidLevel")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidLevel"));
return new LevelPrompt(enchantment); return new LevelPrompt(enchantment);
} else { } else {
@ -446,7 +445,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
cc.getForWhom().sendRawMessage(RED + Lang.get("itemCreateNotNumber")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateNotNumber"));
return new LevelPrompt(enchantment); return new LevelPrompt(enchantment);
} }
@ -460,7 +459,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterName"); return ChatColor.YELLOW + Lang.get("itemCreateEnterName");
} }
@Override @Override
@ -487,7 +486,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
return YELLOW + Lang.get("itemCreateEnterLore"); return ChatColor.YELLOW + Lang.get("itemCreateEnterLore");
} }
@Override @Override
@ -521,28 +520,28 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
if (cc.getSessionData("tempDisplay") == null) { if (cc.getSessionData("tempDisplay") == null) {
String name = (String) cc.getSessionData("tempName"); String name = (String) cc.getSessionData("tempName");
item = AQUA + Quester.prettyItemString(name); item = ChatColor.AQUA + Quester.prettyItemString(name);
if (cc.getSessionData("tempData") != null) { if (cc.getSessionData("tempData") != null) {
item += ":" + BLUE + (Short) cc.getSessionData("tempData"); item += ":" + ChatColor.BLUE + (Short) cc.getSessionData("tempData");
} }
} else { } else {
item = PINK + "" + ITALIC + (String) cc.getSessionData("tempDisplay") + RESET + "" + GRAY + " ("; item = ChatColor.LIGHT_PURPLE + "" + ChatColor.ITALIC + (String) cc.getSessionData("tempDisplay") + ChatColor.RESET + "" + ChatColor.GRAY + " (";
String name = (String) cc.getSessionData("tempName"); String name = (String) cc.getSessionData("tempName");
item += AQUA + Quester.prettyItemString(name); item += ChatColor.AQUA + Quester.prettyItemString(name);
if (cc.getSessionData("tempData") != null) { if (cc.getSessionData("tempData") != null) {
item += ":" + BLUE + (Short) cc.getSessionData("tempData"); item += ":" + ChatColor.BLUE + (Short) cc.getSessionData("tempData");
} }
item += GRAY + ")"; item += ChatColor.GRAY + ")";
} }
if (cc.getSessionData("tempAmount") != null) { if (cc.getSessionData("tempAmount") != null) {
item += GRAY + " x " + DARKAQUA + (Integer) cc.getSessionData("tempAmount"); item += ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + (Integer) cc.getSessionData("tempAmount");
} else { } else {
item += GRAY + " x " + DARKAQUA + "1"; item += ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + "1";
} }
item += "\n"; item += "\n";
@ -553,7 +552,7 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
Map<Enchantment, Integer> enchantments = (Map<Enchantment, Integer>) cc.getSessionData("tempEnchantments"); Map<Enchantment, Integer> enchantments = (Map<Enchantment, Integer>) cc.getSessionData("tempEnchantments");
for (Entry<Enchantment, Integer> e : enchantments.entrySet()) { for (Entry<Enchantment, Integer> e : enchantments.entrySet()) {
item += GRAY + " - " + RED + Quester.prettyEnchantmentString(e.getKey()) + " " + Quests.getNumeral(e.getValue()) + "\n"; item += ChatColor.GRAY + " - " + ChatColor.RED + Quester.prettyEnchantmentString(e.getKey()) + " " + Quests.getNumeral(e.getValue()) + "\n";
} }
@ -564,13 +563,13 @@ public class ItemStackPrompt extends FixedSetPrompt implements ColorUtil {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<String> lore = (List<String>) cc.getSessionData("tempLore"); List<String> lore = (List<String>) cc.getSessionData("tempLore");
item += DARKGREEN + "(Lore)\n\""; item += ChatColor.DARK_GREEN + "(Lore)\n\"";
for (String s : lore) { for (String s : lore) {
if (lore.indexOf(s) != (lore.size() - 1)) { if (lore.indexOf(s) != (lore.size() - 1)) {
item += DARKGREEN + "" + ITALIC + s + "\n"; item += ChatColor.DARK_GREEN + "" + ChatColor.ITALIC + s + "\n";
} else { } else {
item += DARKGREEN + "" + ITALIC + s + "\"\n"; item += ChatColor.DARK_GREEN + "" + ChatColor.ITALIC + s + "\"\n";
} }
} }

View File

@ -3,12 +3,6 @@ package me.blackvein.quests.prompts;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.LinkedList; import java.util.LinkedList;
import me.blackvein.quests.util.ColorUtil;
import me.blackvein.quests.Quest;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.Lang;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.conversations.Conversable; import org.bukkit.conversations.Conversable;
@ -17,7 +11,12 @@ import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt; import org.bukkit.conversations.StringPrompt;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class QuestAcceptPrompt extends StringPrompt implements ColorUtil { import me.blackvein.quests.Quest;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.Lang;
public class QuestAcceptPrompt extends StringPrompt {
final Quests plugin; final Quests plugin;
Quester quester; Quester quester;
@ -42,15 +41,15 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
Quest quest = quests.get(i - 1); Quest quest = quests.get(i - 1);
if (quester.completedQuests.contains(quest.getName())) { if (quester.completedQuests.contains(quest.getName())) {
menu += DARKGREEN + "" + BOLD + "" + i + ". " + RESET + "" + GREEN + "" + ITALIC + quest.getName() + RESET + "" + GREEN + " (" + Lang.get("completed") + ")\n"; menu += ChatColor.DARK_GREEN + "" + ChatColor.BOLD + "" + i + ". " + ChatColor.RESET + "" + ChatColor.GREEN + "" + ChatColor.ITALIC + quest.getName() + ChatColor.RESET + "" + ChatColor.GREEN + " (" + Lang.get("completed") + ")\n";
} else { } else {
menu += GOLD + "" + BOLD + "" + i + ". " + RESET + "" + YELLOW + "" + ITALIC + quest.getName() + "\n"; menu += ChatColor.GOLD + "" + ChatColor.BOLD + "" + i + ". " + ChatColor.RESET + "" + ChatColor.YELLOW + "" + ChatColor.ITALIC + quest.getName() + "\n";
} }
} }
menu += GOLD + "" + BOLD + "" + (quests.size() + 1) + ". " + RESET + "" + ColorUtil.GRAY + Lang.get("cancel") + "\n"; menu += ChatColor.GOLD + "" + ChatColor.BOLD + "" + (quests.size() + 1) + ". " + ChatColor.RESET + "" + ChatColor.GRAY + Lang.get("cancel") + "\n";
menu += WHITE + Lang.get("enterAnOption"); menu += ChatColor.WHITE + Lang.get("enterAnOption");
return menu; return menu;
} }
@ -66,7 +65,7 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
} }
if (input.equalsIgnoreCase(Lang.get("cancel")) || numInput == (quests.size() + 1)) { if (input.equalsIgnoreCase(Lang.get("cancel")) || numInput == (quests.size() + 1)) {
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("cancelled")); cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("cancelled"));
return Prompt.END_OF_CONVERSATION; return Prompt.END_OF_CONVERSATION;
} else { } else {
@ -104,7 +103,7 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
} }
if (q == null) { if (q == null) {
cc.getForWhom().sendRawMessage(RED + Lang.get("invalidSelection")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidSelection"));
return new QuestAcceptPrompt(plugin); return new QuestAcceptPrompt(plugin);
} else { } else {
@ -134,7 +133,7 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
String msg = Lang.get("questMaxAllowed"); String msg = Lang.get("questMaxAllowed");
msg = msg.replaceAll("<number>", String.valueOf(Quests.maxQuests)); msg = msg.replaceAll("<number>", String.valueOf(Quests.maxQuests));
player.sendMessage(YELLOW + msg); player.sendMessage(ChatColor.YELLOW + msg);
} }
@ -166,7 +165,7 @@ public class QuestAcceptPrompt extends StringPrompt implements ColorUtil {
String msg = Lang.get("questMaxAllowed"); String msg = Lang.get("questMaxAllowed");
msg = msg.replaceAll("<number>", String.valueOf(Quests.maxQuests)); msg = msg.replaceAll("<number>", String.valueOf(Quests.maxQuests));
player.sendMessage(YELLOW + msg); player.sendMessage(ChatColor.YELLOW + msg);
} }

View File

@ -1,8 +1,5 @@
package me.blackvein.quests.prompts; package me.blackvein.quests.prompts;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.herocraftonline.heroes.characters.classes.HeroClass;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
@ -10,8 +7,18 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.bukkit.ChatColor;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.FixedSetPrompt;
import org.bukkit.conversations.NumericPrompt;
import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.herocraftonline.heroes.characters.classes.HeroClass;
import me.blackvein.quests.CustomRequirement; import me.blackvein.quests.CustomRequirement;
import me.blackvein.quests.util.ColorUtil;
import me.blackvein.quests.Quest; import me.blackvein.quests.Quest;
import me.blackvein.quests.QuestFactory; import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.Quests; import me.blackvein.quests.Quests;
@ -20,14 +27,7 @@ import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang; import me.blackvein.quests.util.Lang;
import me.blackvein.quests.util.MiscUtil; import me.blackvein.quests.util.MiscUtil;
import org.bukkit.conversations.ConversationContext; public class RequirementsPrompt extends FixedSetPrompt {
import org.bukkit.conversations.FixedSetPrompt;
import org.bukkit.conversations.NumericPrompt;
import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;
import org.bukkit.inventory.ItemStack;
public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
Quests quests; Quests quests;
final QuestFactory factory; final QuestFactory factory;
@ -47,59 +47,59 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
String text; String text;
String lang = Lang.get("requirementsTitle"); String lang = Lang.get("requirementsTitle");
lang = lang.replaceAll("<quest>", AQUA + (String) context.getSessionData(CK.Q_NAME) + DARKAQUA); lang = lang.replaceAll("<quest>", ChatColor.AQUA + (String) context.getSessionData(CK.Q_NAME) + ChatColor.DARK_AQUA);
text = DARKAQUA + lang + "\n"; text = ChatColor.DARK_AQUA + lang + "\n";
if (context.getSessionData(CK.REQ_MONEY) == null) { if (context.getSessionData(CK.REQ_MONEY) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqSetMoney") + " " + GRAY + "(" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetMoney") + " " + ChatColor.GRAY + "(" + Lang.get("noneSet") + ")\n";
} else { } else {
int moneyReq = (Integer) context.getSessionData(CK.REQ_MONEY); int moneyReq = (Integer) context.getSessionData(CK.REQ_MONEY);
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqSetMoney") + " (" + moneyReq + " " + (moneyReq > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetMoney") + " (" + moneyReq + " " + (moneyReq > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n";
} }
if (context.getSessionData(CK.REQ_QUEST_POINTS) == null) { if (context.getSessionData(CK.REQ_QUEST_POINTS) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetQuestPoints") + " " + GRAY + "(" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuestPoints") + " " + ChatColor.GRAY + "(" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetQuestPoints") + " " + GRAY + "(" + AQUA + context.getSessionData(CK.REQ_QUEST_POINTS) + " " + Lang.get("questPoints") + GRAY + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuestPoints") + " " + ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.REQ_QUEST_POINTS) + " " + Lang.get("questPoints") + ChatColor.GRAY + ")\n";
} }
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("reqSetItem") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetItem") + "\n";
if (context.getSessionData(CK.REQ_PERMISSION) == null) { if (context.getSessionData(CK.REQ_PERMISSION) == null) {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("reqSetPerms") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetPerms") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("reqSetPerms") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetPerms") + "\n";
List<String> perms = (List<String>) context.getSessionData(CK.REQ_PERMISSION); List<String> perms = (List<String>) context.getSessionData(CK.REQ_PERMISSION);
for (String s : perms) { for (String s : perms) {
text += GRAY + " - " + AQUA + s + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
} }
} }
if (context.getSessionData(CK.REQ_QUEST) == null) { if (context.getSessionData(CK.REQ_QUEST) == null) {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("reqSetQuest") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuest") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("reqSetQuest") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuest") + "\n";
List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST); List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST);
for (String s : qs) { for (String s : qs) {
text += GRAY + " - " + AQUA + s + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
} }
} }
if (context.getSessionData(CK.REQ_QUEST_BLOCK) == null) { if (context.getSessionData(CK.REQ_QUEST_BLOCK) == null) {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("reqSetQuestBlocks") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuestBlocks") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("reqSetQuestBlocks") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetQuestBlocks") + "\n";
List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST_BLOCK); List<String> qs = (List<String>) context.getSessionData(CK.REQ_QUEST_BLOCK);
for (String s : qs) { for (String s : qs) {
text += GRAY + " - " + AQUA + s + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
} }
} }
@ -107,62 +107,62 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (Quests.mcmmo != null) { if (Quests.mcmmo != null) {
if (context.getSessionData(CK.REQ_MCMMO_SKILLS) == null) { if (context.getSessionData(CK.REQ_MCMMO_SKILLS) == null) {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("reqSetMcMMO") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetMcMMO") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("reqSetMcMMO") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetMcMMO") + "\n";
List<String> skills = (List<String>) context.getSessionData(CK.REQ_MCMMO_SKILLS); List<String> skills = (List<String>) context.getSessionData(CK.REQ_MCMMO_SKILLS);
List<Integer> amounts = (List<Integer>) context.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS); List<Integer> amounts = (List<Integer>) context.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS);
for (String s : skills) { for (String s : skills) {
text += GRAY + " - " + DARKGREEN + s + RESET + YELLOW + " " + Lang.get("mcMMOLevel") + " " + GREEN + amounts.get(skills.indexOf(s)) + "\n"; text += ChatColor.GRAY + " - " + ChatColor.DARK_GREEN + s + ChatColor.RESET + ChatColor.YELLOW + " " + Lang.get("mcMMOLevel") + " " + ChatColor.GREEN + amounts.get(skills.indexOf(s)) + "\n";
} }
} }
} else { } else {
text += GRAY + "6 - " + Lang.get("reqSetMcMMO") + " (" + Lang.get("reqNoMcMMO") + ")\n"; text += ChatColor.GRAY + "6 - " + Lang.get("reqSetMcMMO") + " (" + Lang.get("reqNoMcMMO") + ")\n";
} }
if (Quests.heroes != null) { if (Quests.heroes != null) {
if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null && context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null) { if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null && context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null) {
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("reqSetHeroes") + " " + GRAY + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetHeroes") + " " + ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("reqSetHeroes") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetHeroes") + "\n";
if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) != null) { if (context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) != null) {
text += AQUA + " " + Lang.get("reqHeroesPrimaryDisplay") + " " + BLUE + (String) context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) + "\n"; text += ChatColor.AQUA + " " + Lang.get("reqHeroesPrimaryDisplay") + " " + ChatColor.BLUE + (String) context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) + "\n";
} }
if (context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null) { if (context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null) {
text += AQUA + " " + Lang.get("reqHeroesSecondaryDisplay") + " " + BLUE + (String) context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) + "\n"; text += ChatColor.AQUA + " " + Lang.get("reqHeroesSecondaryDisplay") + " " + ChatColor.BLUE + (String) context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) + "\n";
} }
} }
} else { } else {
text += GRAY + "8 - " + Lang.get("reqSetHeroes") + " (" + Lang.get("reqNoHeroes") + ")\n"; text += ChatColor.GRAY + "8 - " + Lang.get("reqSetHeroes") + " (" + Lang.get("reqNoHeroes") + ")\n";
} }
if (context.getSessionData(CK.REQ_CUSTOM) == null) { if (context.getSessionData(CK.REQ_CUSTOM) == null) {
text += BLUE + "" + BOLD + "9 - " + RESET + ITALIC + PURPLE + Lang.get("reqSetCustom") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "9 - " + ChatColor.RESET + ChatColor.ITALIC + ChatColor.DARK_PURPLE + Lang.get("reqSetCustom") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "9 - " + RESET + ITALIC + PURPLE + Lang.get("reqSetCustom") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "9 - " + ChatColor.RESET + ChatColor.ITALIC + ChatColor.DARK_PURPLE + Lang.get("reqSetCustom") + "\n";
LinkedList<String> customReqs = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM); LinkedList<String> customReqs = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM);
for (String s : customReqs) { for (String s : customReqs) {
text += RESET + "" + PURPLE + " - " + PINK + s + "\n"; text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s + "\n";
} }
} }
if (context.getSessionData(CK.REQ_MONEY) == null && context.getSessionData(CK.REQ_QUEST_POINTS) == null && context.getSessionData(CK.REQ_QUEST_BLOCK) == null && context.getSessionData(CK.REQ_ITEMS) == null && context.getSessionData(CK.REQ_PERMISSION) == null && context.getSessionData(CK.REQ_QUEST) == null && context.getSessionData(CK.REQ_QUEST_BLOCK) == null && context.getSessionData(CK.REQ_MCMMO_SKILLS) == null && context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null && context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null && context.getSessionData(CK.REQ_CUSTOM) == null) { if (context.getSessionData(CK.REQ_MONEY) == null && context.getSessionData(CK.REQ_QUEST_POINTS) == null && context.getSessionData(CK.REQ_QUEST_BLOCK) == null && context.getSessionData(CK.REQ_ITEMS) == null && context.getSessionData(CK.REQ_PERMISSION) == null && context.getSessionData(CK.REQ_QUEST) == null && context.getSessionData(CK.REQ_QUEST_BLOCK) == null && context.getSessionData(CK.REQ_MCMMO_SKILLS) == null && context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null && context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null && context.getSessionData(CK.REQ_CUSTOM) == null) {
text += GRAY + "" + BOLD + "10 - " + RESET + GRAY + Lang.get("reqSetFail") + " (" + Lang.get("reqNone") + ")\n"; text += ChatColor.GRAY + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.GRAY + Lang.get("reqSetFail") + " (" + Lang.get("reqNone") + ")\n";
} else if (context.getSessionData(CK.Q_FAIL_MESSAGE) == null) { } else if (context.getSessionData(CK.Q_FAIL_MESSAGE) == null) {
text += RED + "" + BOLD + "10 - " + RESET + RED + Lang.get("reqSetFail") + " (" + Lang.get("questRequiredNoneSet") + ")\n"; text += ChatColor.RED + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.RED + Lang.get("reqSetFail") + " (" + Lang.get("questRequiredNoneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "10 - " + RESET + YELLOW + Lang.get("reqSetFail") + GRAY + "(" + AQUA + "\"" + context.getSessionData(CK.Q_FAIL_MESSAGE) + "\"" + GRAY + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.YELLOW + Lang.get("reqSetFail") + ChatColor.GRAY + "(" + ChatColor.AQUA + "\"" + context.getSessionData(CK.Q_FAIL_MESSAGE) + "\"" + ChatColor.GRAY + ")\n";
} }
text += GREEN + "" + BOLD + "11" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.GREEN + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
return text; return text;
@ -203,7 +203,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (context.getSessionData(CK.REQ_MONEY) != null || context.getSessionData(CK.REQ_QUEST_POINTS) != null || context.getSessionData(CK.REQ_ITEMS) != null || context.getSessionData(CK.REQ_PERMISSION) != null || context.getSessionData(CK.REQ_QUEST) != null || context.getSessionData(CK.REQ_QUEST_BLOCK) != null || context.getSessionData(CK.REQ_MCMMO_SKILLS) != null || context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) != null || context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null || context.getSessionData(CK.REQ_CUSTOM) != null) { if (context.getSessionData(CK.REQ_MONEY) != null || context.getSessionData(CK.REQ_QUEST_POINTS) != null || context.getSessionData(CK.REQ_ITEMS) != null || context.getSessionData(CK.REQ_PERMISSION) != null || context.getSessionData(CK.REQ_QUEST) != null || context.getSessionData(CK.REQ_QUEST_BLOCK) != null || context.getSessionData(CK.REQ_MCMMO_SKILLS) != null || context.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) != null || context.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) != null || context.getSessionData(CK.REQ_CUSTOM) != null) {
if (context.getSessionData(CK.Q_FAIL_MESSAGE) == null) { if (context.getSessionData(CK.Q_FAIL_MESSAGE) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("reqNoMessage")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNoMessage"));
return new RequirementsPrompt(quests, factory); return new RequirementsPrompt(quests, factory);
} }
@ -221,8 +221,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = Lang.get("reqMoneyPrompt"); String text = Lang.get("reqMoneyPrompt");
text = text.replaceAll("<money>", PURPLE + ((Quests.economy.currencyNamePlural().isEmpty() ? Lang.get("money") : Quests.economy.currencyNamePlural())) + YELLOW); text = text.replaceAll("<money>", ChatColor.DARK_PURPLE + ((Quests.economy.currencyNamePlural().isEmpty() ? Lang.get("money") : Quests.economy.currencyNamePlural())) + ChatColor.YELLOW);
return YELLOW + text; return ChatColor.YELLOW + text;
} }
@ -230,7 +230,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) { protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) { if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("reqGreaterThanZero")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqGreaterThanZero"));
return new MoneyPrompt(); return new MoneyPrompt();
} else if (input.intValue() == -1) { } else if (input.intValue() == -1) {
return new RequirementsPrompt(quests, factory); return new RequirementsPrompt(quests, factory);
@ -250,7 +250,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqQuestPointsPrompt"); return ChatColor.YELLOW + Lang.get("reqQuestPointsPrompt");
} }
@ -258,7 +258,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) { protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) { if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("reqGreaterThanZero")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqGreaterThanZero"));
return new QuestPointsPrompt(); return new QuestPointsPrompt();
} else if (input.intValue() == -1) { } else if (input.intValue() == -1) {
return new RequirementsPrompt(quests, factory); return new RequirementsPrompt(quests, factory);
@ -284,7 +284,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = PINK + Lang.get("questListTitle") + "\n" + PURPLE; String text = ChatColor.LIGHT_PURPLE + Lang.get("questListTitle") + "\n" + ChatColor.DARK_PURPLE;
boolean none = true; boolean none = true;
for (Quest q : quests.getQuests()) { for (Quest q : quests.getQuests()) {
@ -302,8 +302,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} }
String lang = Lang.get("reqQuestPrompt"); String lang = Lang.get("reqQuestPrompt");
lang = lang.replaceAll("<comma>", RED + "" + BOLD + Lang.get("comma") + RESET + YELLOW); lang = lang.replaceAll("<comma>", ChatColor.RED + "" + ChatColor.BOLD + Lang.get("comma") + ChatColor.RESET + ChatColor.YELLOW);
text += YELLOW + lang; text += ChatColor.YELLOW + lang;
return text; return text;
@ -322,7 +322,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (quests.getQuest(s) == null) { if (quests.getQuest(s) == null) {
String text = Lang.get("reqNotAQuestName"); String text = Lang.get("reqNotAQuestName");
text = text.replaceAll("<quest>", PINK + s + RED); text = text.replaceAll("<quest>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
context.getForWhom().sendRawMessage(text); context.getForWhom().sendRawMessage(text);
return new QuestListPrompt(isRequiredQuest); return new QuestListPrompt(isRequiredQuest);
@ -330,7 +330,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (questNames.contains(s)) { if (questNames.contains(s)) {
context.getForWhom().sendRawMessage(RED + Lang.get("listDuplicate")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listDuplicate"));
return new QuestListPrompt(isRequiredQuest); return new QuestListPrompt(isRequiredQuest);
} }
@ -397,37 +397,37 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} }
String text = GOLD + Lang.get("itemRequirementsTitle") + "\n"; String text = ChatColor.GOLD + Lang.get("itemRequirementsTitle") + "\n";
if (context.getSessionData(CK.REQ_ITEMS) == null) { if (context.getSessionData(CK.REQ_ITEMS) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqAddItem") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += GRAY + "2 - " + Lang.get("reqSetRemoveItems") + " (" + Lang.get("reqNoItemsSet") + ")\n"; text += ChatColor.GRAY + "2 - " + Lang.get("reqSetRemoveItems") + " (" + Lang.get("reqNoItemsSet") + ")\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} else { } else {
for (ItemStack is : getItems(context)) { 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("reqAddItem") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqAddItem") + "\n";
if (context.getSessionData(CK.REQ_ITEMS_REMOVE) == null) { if (context.getSessionData(CK.REQ_ITEMS_REMOVE) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetRemoveItems") + " (" + Lang.get("reqNoValuesSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetRemoveItems") + " (" + Lang.get("reqNoValuesSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetRemoveItems") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetRemoveItems") + "\n";
for (Boolean b : getRemoveItems(context)) { for (Boolean b : getRemoveItems(context)) {
text += GRAY + " - " + AQUA + (b.equals(Boolean.TRUE) ? Lang.get("yesWord") : Lang.get("noWord")) + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + (b.equals(Boolean.TRUE) ? Lang.get("yesWord") : Lang.get("noWord")) + "\n";
} }
} }
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} }
@ -443,13 +443,13 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
return new ItemStackPrompt(ItemListPrompt.this); return new ItemStackPrompt(ItemListPrompt.this);
} else if (input.equalsIgnoreCase("2")) { } else if (input.equalsIgnoreCase("2")) {
if (context.getSessionData(CK.REQ_ITEMS) == null) { if (context.getSessionData(CK.REQ_ITEMS) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("reqMustAddItem")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqMustAddItem"));
return new ItemListPrompt(); return new ItemListPrompt();
} else { } else {
return new RemoveItemsPrompt(); return new RemoveItemsPrompt();
} }
} else if (input.equalsIgnoreCase("3")) { } else if (input.equalsIgnoreCase("3")) {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("reqItemCleared")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqItemCleared"));
context.setSessionData(CK.REQ_ITEMS, null); context.setSessionData(CK.REQ_ITEMS, null);
context.setSessionData(CK.REQ_ITEMS_REMOVE, null); context.setSessionData(CK.REQ_ITEMS_REMOVE, null);
return new ItemListPrompt(); return new ItemListPrompt();
@ -473,7 +473,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (one == two) { if (one == two) {
return new RequirementsPrompt(quests, factory); return new RequirementsPrompt(quests, factory);
} else { } else {
context.getForWhom().sendRawMessage(RED + Lang.get("reqListsNotSameSize")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqListsNotSameSize"));
return new ItemListPrompt(); return new ItemListPrompt();
} }
} }
@ -496,7 +496,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqRemoveItemsPrompt"); return ChatColor.YELLOW + Lang.get("reqRemoveItemsPrompt");
} }
@Override @Override
@ -515,8 +515,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
booleans.add(false); booleans.add(false);
} else { } else {
String text = Lang.get("reqTrueFalseError"); String text = Lang.get("reqTrueFalseError");
text = text.replaceAll("<input>", PINK + s + RED); text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
context.getForWhom().sendRawMessage(RED + text); context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new RemoveItemsPrompt(); return new RemoveItemsPrompt();
} }
@ -535,7 +535,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqPermissionsPrompt"); return ChatColor.YELLOW + Lang.get("reqPermissionsPrompt");
} }
@Override @Override
@ -562,16 +562,16 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = PINK + Lang.get("customRequirementsTitle") + "\n"; String text = ChatColor.LIGHT_PURPLE + Lang.get("customRequirementsTitle") + "\n";
if (quests.customRequirements.isEmpty()) { if (quests.customRequirements.isEmpty()) {
text += BOLD + "" + PURPLE + "(" + Lang.get("stageEditorNoModules") + ")"; text += ChatColor.BOLD + "" + ChatColor.DARK_PURPLE + "(" + Lang.get("stageEditorNoModules") + ")";
} else { } else {
for (CustomRequirement cr : quests.customRequirements) { for (CustomRequirement cr : quests.customRequirements) {
text += PURPLE + " - " + cr.getName() + "\n"; text += ChatColor.DARK_PURPLE + " - " + cr.getName() + "\n";
} }
} }
return text + YELLOW + Lang.get("reqCustomPrompt"); return text + ChatColor.YELLOW + Lang.get("reqCustomPrompt");
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -608,7 +608,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
context.setSessionData(CK.REQ_CUSTOM, list); context.setSessionData(CK.REQ_CUSTOM, list);
context.setSessionData(CK.REQ_CUSTOM_DATA, datamapList); context.setSessionData(CK.REQ_CUSTOM_DATA, datamapList);
} else { } else {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("reqCustomAlreadyAdded")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqCustomAlreadyAdded"));
return new CustomRequirementsPrompt(); return new CustomRequirementsPrompt();
} }
} else { } else {
@ -630,7 +630,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
// //
} else { } else {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("reqCustomNotFound")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqCustomNotFound"));
return new CustomRequirementsPrompt(); return new CustomRequirementsPrompt();
} }
@ -638,7 +638,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
context.setSessionData(CK.REQ_CUSTOM, null); context.setSessionData(CK.REQ_CUSTOM, null);
context.setSessionData(CK.REQ_CUSTOM_DATA, null); context.setSessionData(CK.REQ_CUSTOM_DATA, null);
context.setSessionData(CK.REQ_CUSTOM_DATA_TEMP, null); context.setSessionData(CK.REQ_CUSTOM_DATA_TEMP, null);
context.getForWhom().sendRawMessage(YELLOW + Lang.get("reqCustomCleared")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqCustomCleared"));
} }
return new RequirementsPrompt(quests, factory); return new RequirementsPrompt(quests, factory);
@ -652,7 +652,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = BOLD + "" + AQUA + "- "; String text = ChatColor.BOLD + "" + ChatColor.AQUA + "- ";
LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM); LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REQ_CUSTOM);
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA); LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA);
@ -671,18 +671,18 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
for (String dataKey : datamapKeys) { for (String dataKey : datamapKeys) {
text += BOLD + "" + DARKBLUE + index + " - " + RESET + BLUE + dataKey; text += ChatColor.BOLD + "" + ChatColor.DARK_BLUE + index + " - " + ChatColor.RESET + ChatColor.BLUE + dataKey;
if (datamap.get(dataKey) != null) { if (datamap.get(dataKey) != null) {
text += GREEN + " (" + (String) datamap.get(dataKey) + ")\n"; text += ChatColor.GREEN + " (" + (String) datamap.get(dataKey) + ")\n";
} else { } else {
text += RED + " (" + Lang.get("valRequired") + ")\n"; text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n";
} }
index++; index++;
} }
text += BOLD + "" + DARKBLUE + index + " - " + AQUA + Lang.get("finish"); text += ChatColor.BOLD + "" + ChatColor.DARK_BLUE + index + " - " + ChatColor.AQUA + Lang.get("finish");
return text; return text;
} }
@ -742,12 +742,12 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REQ_CUSTOM_DATA_DESCRIPTIONS); Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REQ_CUSTOM_DATA_DESCRIPTIONS);
if (descriptions.get(temp) != null) { if (descriptions.get(temp) != null) {
text += GOLD + descriptions.get(temp) + "\n"; text += ChatColor.GOLD + descriptions.get(temp) + "\n";
} }
String lang = Lang.get("stageEditorCustomDataPrompt"); String lang = Lang.get("stageEditorCustomDataPrompt");
lang = lang.replaceAll("<data>", temp); lang = lang.replaceAll("<data>", temp);
text += YELLOW + lang; text += ChatColor.YELLOW + lang;
return text; return text;
} }
@ -772,30 +772,30 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = DARKGREEN + Lang.get("mcMMORequirementsTitle") + "\n"; String text = ChatColor.DARK_GREEN + Lang.get("mcMMORequirementsTitle") + "\n";
if (cc.getSessionData(CK.REQ_MCMMO_SKILLS) == null) { if (cc.getSessionData(CK.REQ_MCMMO_SKILLS) == null) {
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqSetSkills") + "(" + Lang.get("noneSet") + ")\n"; text += ChatColor.BOLD + "" + ChatColor.GREEN + "1" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqSetSkills") + "(" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqSetSkills") + "\n"; text += ChatColor.BOLD + "" + ChatColor.GREEN + "1" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqSetSkills") + "\n";
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
LinkedList<String> skills = (LinkedList<String>) cc.getSessionData(CK.REQ_MCMMO_SKILLS); LinkedList<String> skills = (LinkedList<String>) cc.getSessionData(CK.REQ_MCMMO_SKILLS);
for (String skill : skills) { for (String skill : skills) {
text += GRAY + " - " + AQUA + skill + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + skill + "\n";
} }
} }
if (cc.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS) == null) { if (cc.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS) == null) {
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BOLD + "" + ChatColor.GREEN + "2" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqSetSkillAmounts") + "\n"; text += ChatColor.BOLD + "" + ChatColor.GREEN + "2" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqSetSkillAmounts") + "\n";
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
LinkedList<Integer> amounts = (LinkedList<Integer>) cc.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS); LinkedList<Integer> amounts = (LinkedList<Integer>) cc.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS);
for (int i : amounts) { for (int i : amounts) {
text += GRAY + " - " + AQUA + i + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + i + "\n";
} }
} }
text += BOLD + "" + GREEN + "3" + RESET + GREEN + " - " + Lang.get("done"); text += ChatColor.BOLD + "" + ChatColor.GREEN + "3" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("done");
return text; return text;
} }
@ -821,19 +821,19 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String skillList = DARKGREEN + Lang.get("skillListTitle") + "\n"; String skillList = ChatColor.DARK_GREEN + Lang.get("skillListTitle") + "\n";
SkillType[] skills = SkillType.values(); SkillType[] skills = SkillType.values();
for (int i = 0; i < skills.length; i++) { for (int i = 0; i < skills.length; i++) {
if (i == (skills.length - 1)) { if (i == (skills.length - 1)) {
skillList += GREEN + skills[i].getName() + "\n"; skillList += ChatColor.GREEN + skills[i].getName() + "\n";
} else { } else {
skillList += GREEN + skills[i].getName() + "\n\n"; skillList += ChatColor.GREEN + skills[i].getName() + "\n\n";
} }
} }
return skillList + YELLOW + Lang.get("reqMcMMOPrompt"); return skillList + ChatColor.YELLOW + Lang.get("reqMcMMOPrompt");
} }
@Override @Override
@ -850,12 +850,12 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
if (Quests.getMcMMOSkill(formatted) != null) { if (Quests.getMcMMOSkill(formatted) != null) {
skills.add(formatted); skills.add(formatted);
} else if (skills.contains(formatted)) { } else if (skills.contains(formatted)) {
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("listDuplicate")); cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("listDuplicate"));
return new mcMMOSkillsPrompt(); return new mcMMOSkillsPrompt();
} else { } else {
String text = Lang.get("reqMcMMOError"); String text = Lang.get("reqMcMMOError");
text = text.replaceAll("<input>", RED + s + YELLOW); text = text.replaceAll("<input>", ChatColor.RED + s + ChatColor.YELLOW);
cc.getForWhom().sendRawMessage(YELLOW + text); cc.getForWhom().sendRawMessage(ChatColor.YELLOW + text);
return new mcMMOSkillsPrompt(); return new mcMMOSkillsPrompt();
} }
@ -865,7 +865,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
return new mcMMOPrompt(); return new mcMMOPrompt();
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("reqMcMMOCleared")); cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqMcMMOCleared"));
cc.setSessionData(CK.REQ_MCMMO_SKILLS, null); cc.setSessionData(CK.REQ_MCMMO_SKILLS, null);
return new mcMMOPrompt(); return new mcMMOPrompt();
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
@ -883,7 +883,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqMcMMOAmountsPrompt"); return ChatColor.YELLOW + Lang.get("reqMcMMOAmountsPrompt");
} }
@Override @Override
@ -902,8 +902,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} catch (NumberFormatException nfe) { } catch (NumberFormatException nfe) {
String text = Lang.get("reqNotANumber"); String text = Lang.get("reqNotANumber");
text = text.replaceAll("<input>", RED + s + YELLOW); text = text.replaceAll("<input>", ChatColor.RED + s + ChatColor.YELLOW);
cc.getForWhom().sendRawMessage(YELLOW + text); cc.getForWhom().sendRawMessage(ChatColor.YELLOW + text);
return new mcMMOAmountsPrompt(); return new mcMMOAmountsPrompt();
} }
@ -913,7 +913,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
return new mcMMOPrompt(); return new mcMMOPrompt();
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("reqMcMMOAmountsCleared")); cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqMcMMOAmountsCleared"));
cc.setSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS, null); cc.setSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS, null);
return new mcMMOPrompt(); return new mcMMOPrompt();
} else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
@ -935,20 +935,20 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = DARKGREEN + Lang.get("heroesRequirementsTitle") + "\n"; String text = ChatColor.DARK_GREEN + Lang.get("heroesRequirementsTitle") + "\n";
if (cc.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null) { if (cc.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) == null) {
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqHeroesSetPrimary") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BOLD + "" + ChatColor.GREEN + "1" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqHeroesSetPrimary") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqHeroesSetPrimary") + " (" + AQUA + (String) cc.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) + GREEN + ")\n"; text += ChatColor.BOLD + "" + ChatColor.GREEN + "1" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqHeroesSetPrimary") + " (" + ChatColor.AQUA + (String) cc.getSessionData(CK.REQ_HEROES_PRIMARY_CLASS) + ChatColor.GREEN + ")\n";
} }
if (cc.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null) { if (cc.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) == null) {
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqHeroesSetSecondary") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BOLD + "" + ChatColor.GREEN + "2" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqHeroesSetSecondary") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqHeroesSetSecondary") + " (" + AQUA + (String) cc.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) + GREEN + ")\n"; text += ChatColor.BOLD + "" + ChatColor.GREEN + "2" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("reqHeroesSetSecondary") + " (" + ChatColor.AQUA + (String) cc.getSessionData(CK.REQ_HEROES_SECONDARY_CLASS) + ChatColor.GREEN + ")\n";
} }
text += BOLD + "" + GREEN + "3" + RESET + GREEN + " - " + Lang.get("done"); text += ChatColor.BOLD + "" + ChatColor.GREEN + "3" + ChatColor.RESET + ChatColor.GREEN + " - " + Lang.get("done");
return text; return text;
} }
@ -974,7 +974,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = PURPLE + Lang.get("heroesPrimaryTitle") + "\n"; String text = ChatColor.DARK_PURPLE + Lang.get("heroesPrimaryTitle") + "\n";
LinkedList<String> list = new LinkedList<String>(); LinkedList<String> list = new LinkedList<String>();
for (HeroClass hc : Quests.heroes.getClassManager().getClasses()) { for (HeroClass hc : Quests.heroes.getClassManager().getClasses()) {
if (hc.isPrimary()) { if (hc.isPrimary()) {
@ -983,18 +983,18 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} }
if (list.isEmpty()) { if (list.isEmpty()) {
text += GRAY + "(" + Lang.get("none") + ")\n"; text += ChatColor.GRAY + "(" + Lang.get("none") + ")\n";
} else { } else {
Collections.sort(list); Collections.sort(list);
for (String s : list) { for (String s : list) {
text += PURPLE + "- " + PINK + s + "\n"; text += ChatColor.DARK_PURPLE + "- " + ChatColor.LIGHT_PURPLE + s + "\n";
} }
} }
text += YELLOW + Lang.get("reqHeroesPrimaryPrompt"); text += ChatColor.YELLOW + Lang.get("reqHeroesPrimaryPrompt");
return text; return text;
} }
@ -1014,20 +1014,20 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} else { } else {
String text = Lang.get("reqHeroesNotPrimary"); String text = Lang.get("reqHeroesNotPrimary");
text = text.replaceAll("<class>", PINK + hc.getName() + RED); text = text.replaceAll("<class>", ChatColor.LIGHT_PURPLE + hc.getName() + ChatColor.RED);
cc.getForWhom().sendRawMessage(RED + text); cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new HeroesPrimaryPrompt(); return new HeroesPrimaryPrompt();
} }
} else { } else {
cc.getForWhom().sendRawMessage(RED + Lang.get("reqHeroesClassNotFound")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqHeroesClassNotFound"));
return new HeroesPrimaryPrompt(); return new HeroesPrimaryPrompt();
} }
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
cc.setSessionData(CK.REQ_HEROES_PRIMARY_CLASS, null); cc.setSessionData(CK.REQ_HEROES_PRIMARY_CLASS, null);
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("reqHeroesPrimaryCleared")); cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqHeroesPrimaryCleared"));
return new HeroesPrompt(); return new HeroesPrompt();
} else { } else {
@ -1044,7 +1044,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = PURPLE + Lang.get("heroesSecondaryTitle") + "\n"; String text = ChatColor.DARK_PURPLE + Lang.get("heroesSecondaryTitle") + "\n";
LinkedList<String> list = new LinkedList<String>(); LinkedList<String> list = new LinkedList<String>();
for (HeroClass hc : Quests.heroes.getClassManager().getClasses()) { for (HeroClass hc : Quests.heroes.getClassManager().getClasses()) {
if (hc.isSecondary()) { if (hc.isSecondary()) {
@ -1053,18 +1053,18 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} }
if (list.isEmpty()) { if (list.isEmpty()) {
text += GRAY + "(" + Lang.get("none") + ")\n"; text += ChatColor.GRAY + "(" + Lang.get("none") + ")\n";
} else { } else {
Collections.sort(list); Collections.sort(list);
for (String s : list) { for (String s : list) {
text += PURPLE + "- " + PINK + s + "\n"; text += ChatColor.DARK_PURPLE + "- " + ChatColor.LIGHT_PURPLE + s + "\n";
} }
} }
text += YELLOW + Lang.get("reqHeroesSecondaryPrompt"); text += ChatColor.YELLOW + Lang.get("reqHeroesSecondaryPrompt");
return text; return text;
} }
@ -1085,20 +1085,20 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
} else { } else {
String text = Lang.get("reqHeroesNotSecondary"); String text = Lang.get("reqHeroesNotSecondary");
text = text.replaceAll("<class>", PINK + hc.getName() + RED); text = text.replaceAll("<class>", ChatColor.LIGHT_PURPLE + hc.getName() + ChatColor.RED);
cc.getForWhom().sendRawMessage(RED + text); cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new HeroesSecondaryPrompt(); return new HeroesSecondaryPrompt();
} }
} else { } else {
cc.getForWhom().sendRawMessage(RED + Lang.get("reqHeroesClassNotFound")); cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqHeroesClassNotFound"));
return new HeroesSecondaryPrompt(); return new HeroesSecondaryPrompt();
} }
} else if (input.equalsIgnoreCase(Lang.get("clear"))) { } else if (input.equalsIgnoreCase(Lang.get("clear"))) {
cc.setSessionData(CK.REQ_HEROES_SECONDARY_CLASS, null); cc.setSessionData(CK.REQ_HEROES_SECONDARY_CLASS, null);
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("reqHeroesSecondaryCleared")); cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("reqHeroesSecondaryCleared"));
return new HeroesPrompt(); return new HeroesPrompt();
} else { } else {
@ -1114,7 +1114,7 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqFailMessagePrompt"); return ChatColor.YELLOW + Lang.get("reqFailMessagePrompt");
} }
@Override @Override

View File

@ -1,25 +1,12 @@
package me.blackvein.quests.prompts; package me.blackvein.quests.prompts;
import com.codisimus.plugins.phatloots.PhatLoot;
import com.codisimus.plugins.phatloots.PhatLootsAPI;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.herocraftonline.heroes.characters.classes.HeroClass;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import me.blackvein.quests.CustomReward; import org.bukkit.ChatColor;
import me.blackvein.quests.util.ColorUtil;
import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.FixedSetPrompt; import org.bukkit.conversations.FixedSetPrompt;
import org.bukkit.conversations.NumericPrompt; import org.bukkit.conversations.NumericPrompt;
@ -27,7 +14,20 @@ import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt; import org.bukkit.conversations.StringPrompt;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
public class RewardsPrompt extends FixedSetPrompt implements ColorUtil { import com.codisimus.plugins.phatloots.PhatLoot;
import com.codisimus.plugins.phatloots.PhatLootsAPI;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.herocraftonline.heroes.characters.classes.HeroClass;
import me.blackvein.quests.CustomReward;
import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
public class RewardsPrompt extends FixedSetPrompt {
final Quests quests; final Quests quests;
@ -48,52 +48,52 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
String text; String text;
String lang = Lang.get("rewardsTitle"); String lang = Lang.get("rewardsTitle");
lang = lang.replaceAll("<quest>", AQUA + (String) context.getSessionData(CK.Q_NAME) + DARKAQUA); lang = lang.replaceAll("<quest>", ChatColor.AQUA + (String) context.getSessionData(CK.Q_NAME) + ChatColor.DARK_AQUA);
text = DARKAQUA + lang + "\n"; text = ChatColor.DARK_AQUA + lang + "\n";
if (context.getSessionData(CK.REW_MONEY) == null) { if (context.getSessionData(CK.REW_MONEY) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("rewSetMoney") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetMoney") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY); int moneyRew = (Integer) context.getSessionData(CK.REW_MONEY);
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("rewSetMoney") + " (" + moneyRew + " " + (moneyRew > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetMoney") + " (" + moneyRew + " " + (moneyRew > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n";
} }
if (context.getSessionData(CK.REW_QUEST_POINTS) == null) { if (context.getSessionData(CK.REW_QUEST_POINTS) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("rewSetQuestPoints") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetQuestPoints") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("rewSetQuestPoints") + " (" + context.getSessionData(CK.REW_QUEST_POINTS) + " " + Lang.get("questPoints") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetQuestPoints") + " (" + context.getSessionData(CK.REW_QUEST_POINTS) + " " + Lang.get("questPoints") + ")\n";
} }
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("rewSetItems") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetItems") + "\n";
if (context.getSessionData(CK.REW_EXP) == null) { if (context.getSessionData(CK.REW_EXP) == null) {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("rewSetExperience") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetExperience") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("rewSetExperience") + " (" + context.getSessionData(CK.REW_EXP) + " " + Lang.get("points") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetExperience") + " (" + context.getSessionData(CK.REW_EXP) + " " + Lang.get("points") + ")\n";
} }
if (context.getSessionData(CK.REW_COMMAND) == null) { if (context.getSessionData(CK.REW_COMMAND) == null) {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("rewSetCommands") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetCommands") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - " + Lang.get("rewSetCommands") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetCommands") + "\n";
List<String> commands = (List<String>) context.getSessionData(CK.REW_COMMAND); List<String> commands = (List<String>) context.getSessionData(CK.REW_COMMAND);
for (String cmd : commands) { for (String cmd : commands) {
text += GRAY + " - " + AQUA + cmd + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + cmd + "\n";
} }
} }
if (context.getSessionData(CK.REW_PERMISSION) == null) { if (context.getSessionData(CK.REW_PERMISSION) == null) {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("rewSetPermission") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetPermission") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - " + Lang.get("rewSetPermission") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetPermission") + "\n";
List<String> permissions = (List<String>) context.getSessionData(CK.REW_PERMISSION); List<String> permissions = (List<String>) context.getSessionData(CK.REW_PERMISSION);
for (String perm : permissions) { for (String perm : permissions) {
text += GRAY + " - " + AQUA + perm + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + perm + "\n";
} }
} }
@ -101,81 +101,81 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (Quests.mcmmo != null) { if (Quests.mcmmo != null) {
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) { if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("rewSetMcMMO") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetMcMMO") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "7" + RESET + YELLOW + " - " + Lang.get("rewSetMcMMO") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetMcMMO") + "\n";
List<String> skills = (List<String>) context.getSessionData(CK.REW_MCMMO_SKILLS); List<String> skills = (List<String>) context.getSessionData(CK.REW_MCMMO_SKILLS);
List<Integer> amounts = (List<Integer>) context.getSessionData(CK.REW_MCMMO_AMOUNTS); List<Integer> amounts = (List<Integer>) context.getSessionData(CK.REW_MCMMO_AMOUNTS);
for (String skill : skills) { for (String skill : skills) {
text += GRAY + " - " + AQUA + skill + GRAY + " x " + DARKAQUA + amounts.get(skills.indexOf(skill)) + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + skill + ChatColor.GRAY + " x " + ChatColor.DARK_AQUA + amounts.get(skills.indexOf(skill)) + "\n";
} }
} }
} else { } else {
text += GRAY + "7 - " + Lang.get("rewSetMcMMO") + " (" + Lang.get("reqNoMcMMO") + ")\n"; text += ChatColor.GRAY + "7 - " + Lang.get("rewSetMcMMO") + " (" + Lang.get("reqNoMcMMO") + ")\n";
} }
if (Quests.heroes != null) { if (Quests.heroes != null) {
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) { if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("rewSetHeroes") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroes") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "8" + RESET + YELLOW + " - " + Lang.get("rewSetHeroes") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroes") + "\n";
List<String> heroClasses = (List<String>) context.getSessionData(CK.REW_HEROES_CLASSES); List<String> heroClasses = (List<String>) context.getSessionData(CK.REW_HEROES_CLASSES);
List<Double> amounts = (List<Double>) context.getSessionData(CK.REW_HEROES_AMOUNTS); List<Double> amounts = (List<Double>) context.getSessionData(CK.REW_HEROES_AMOUNTS);
for (String heroClass : heroClasses) { for (String heroClass : heroClasses) {
text += GRAY + " - " + AQUA + amounts.get(heroClasses.indexOf(heroClass)) + " " + DARKAQUA + heroClass + " " + Lang.get("experience") + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + amounts.get(heroClasses.indexOf(heroClass)) + " " + ChatColor.DARK_AQUA + heroClass + " " + Lang.get("experience") + "\n";
} }
} }
} else { } else {
text += GRAY + "8 - " + Lang.get("rewSetHeroes") + " (" + Lang.get("rewNoHeroes") + ")\n"; text += ChatColor.GRAY + "8 - " + Lang.get("rewSetHeroes") + " (" + Lang.get("rewNoHeroes") + ")\n";
} }
if (Quests.phatLoots != null) { if (Quests.phatLoots != null) {
if (context.getSessionData(CK.REW_PHAT_LOOTS) == null) { if (context.getSessionData(CK.REW_PHAT_LOOTS) == null) {
text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("rewSetPhat") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetPhat") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "9" + RESET + YELLOW + " - " + Lang.get("rewSetPhat") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetPhat") + "\n";
List<String> phatLoots = (List<String>) context.getSessionData(CK.REW_PHAT_LOOTS); List<String> phatLoots = (List<String>) context.getSessionData(CK.REW_PHAT_LOOTS);
for (String phatLoot : phatLoots) { for (String phatLoot : phatLoots) {
text += GRAY + " - " + AQUA + phatLoot + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + phatLoot + "\n";
} }
} }
} else { } else {
text += GRAY + "9 - " + Lang.get("rewSetPhat") + " (" + Lang.get("rewNoPhat") + ")\n"; text += ChatColor.GRAY + "9 - " + Lang.get("rewSetPhat") + " (" + Lang.get("rewNoPhat") + ")\n";
} }
if (context.getSessionData(CK.REW_CUSTOM) == null) { if (context.getSessionData(CK.REW_CUSTOM) == null) {
text += BLUE + "" + BOLD + "10 - " + RESET + ITALIC + PURPLE + Lang.get("rewSetCustom") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.ITALIC + ChatColor.DARK_PURPLE + Lang.get("rewSetCustom") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "10 - " + RESET + ITALIC + PURPLE + Lang.get("rewSetCustom") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "10 - " + ChatColor.RESET + ChatColor.ITALIC + ChatColor.DARK_PURPLE + Lang.get("rewSetCustom") + "\n";
LinkedList<String> customRews = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM); LinkedList<String> customRews = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM);
for (String s : customRews) { for (String s : customRews) {
text += RESET + "" + PURPLE + " - " + PINK + s + "\n"; text += ChatColor.RESET + "" + ChatColor.DARK_PURPLE + " - " + ChatColor.LIGHT_PURPLE + s + "\n";
} }
} }
text += GREEN + "" + BOLD + "11" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.GREEN + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
return text; return text;
@ -229,8 +229,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = Lang.get("rewMoneyPrompt"); String text = Lang.get("rewMoneyPrompt");
text = text.replaceAll("<money>", AQUA + (Quests.economy.currencyNamePlural().isEmpty() ? Lang.get("money") : Quests.economy.currencyNamePlural()) + YELLOW); text = text.replaceAll("<money>", ChatColor.AQUA + (Quests.economy.currencyNamePlural().isEmpty() ? Lang.get("money") : Quests.economy.currencyNamePlural()) + ChatColor.YELLOW);
return YELLOW + text; return ChatColor.YELLOW + text;
} }
@ -238,7 +238,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) { protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) { if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("inputPosNum")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
return new MoneyPrompt(); return new MoneyPrompt();
} else if (input.intValue() == 0) { } else if (input.intValue() == 0) {
context.setSessionData(CK.REW_MONEY, null); context.setSessionData(CK.REW_MONEY, null);
@ -257,7 +257,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("rewExperiencePrompt"); return ChatColor.YELLOW + Lang.get("rewExperiencePrompt");
} }
@ -265,7 +265,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) { protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) { if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("inputPosNum")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
return new ExperiencePrompt(); return new ExperiencePrompt();
} else if (input.intValue() == -1) { } else if (input.intValue() == -1) {
context.setSessionData(CK.REW_EXP, null); context.setSessionData(CK.REW_EXP, null);
@ -284,7 +284,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("rewQuestPointsPrompt"); return ChatColor.YELLOW + Lang.get("rewQuestPointsPrompt");
} }
@ -292,7 +292,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
protected Prompt acceptValidatedInput(ConversationContext context, Number input) { protected Prompt acceptValidatedInput(ConversationContext context, Number input) {
if (input.intValue() < -1) { if (input.intValue() < -1) {
context.getForWhom().sendRawMessage(RED + Lang.get("inputPosNum")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
return new QuestPointsPrompt(); return new QuestPointsPrompt();
} else if (input.intValue() == -1) { } else if (input.intValue() == -1) {
context.setSessionData(CK.REW_QUEST_POINTS, null); context.setSessionData(CK.REW_QUEST_POINTS, null);
@ -334,22 +334,22 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
} }
String text = GOLD + Lang.get("itemRewardsTitle") + "\n"; String text = ChatColor.GOLD + Lang.get("itemRewardsTitle") + "\n";
if (context.getSessionData(CK.REW_ITEMS) == null) { if (context.getSessionData(CK.REW_ITEMS) == null) {
text += GRAY + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.GRAY + " (" + Lang.get("noneSet") + ")\n";
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqAddItem") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} else { } else {
for (ItemStack is : getItems(context)) { 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("reqAddItem") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqAddItem") + "\n";
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} }
@ -363,7 +363,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (input.equalsIgnoreCase("1")) { if (input.equalsIgnoreCase("1")) {
return new ItemStackPrompt(ItemListPrompt.this); return new ItemStackPrompt(ItemListPrompt.this);
} else if (input.equalsIgnoreCase("2")) { } else if (input.equalsIgnoreCase("2")) {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewItemsCleared")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewItemsCleared"));
context.setSessionData(CK.REW_ITEMS, null); context.setSessionData(CK.REW_ITEMS, null);
return new ItemListPrompt(); return new ItemListPrompt();
} else if (input.equalsIgnoreCase("3")) { } else if (input.equalsIgnoreCase("3")) {
@ -385,9 +385,9 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String lang1 = Lang.get("rewCommandPrompt"); String lang1 = Lang.get("rewCommandPrompt");
lang1 = lang1.replaceAll("<comma>", BOLD + "" + RED + "comma" + RESET + YELLOW); lang1 = lang1.replaceAll("<comma>", ChatColor.BOLD + "" + ChatColor.RED + "comma" + ChatColor.RESET + ChatColor.YELLOW);
String lang2 = Lang.get("rewCommandPromptHint"); String lang2 = Lang.get("rewCommandPromptHint");
return YELLOW + lang1 + "\n" + lang2; return ChatColor.YELLOW + lang1 + "\n" + lang2;
} }
@Override @Override
@ -423,7 +423,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("rewPermissionsPrompt"); return ChatColor.YELLOW + Lang.get("rewPermissionsPrompt");
} }
@Override @Override
@ -459,36 +459,36 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = GOLD + Lang.get("mcMMORewardsTitle") + "\n"; String text = ChatColor.GOLD + Lang.get("mcMMORewardsTitle") + "\n";
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) { if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqSetSkills") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetSkills") + " (" + Lang.get("noneSet") + ")\n";
text += GRAY + "2 - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("rewNoMcMMOSkills") + ")\n"; text += ChatColor.GRAY + "2 - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("rewNoMcMMOSkills") + ")\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} else { } else {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("reqSetSkills") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetSkills") + "\n";
for (String s : getSkills(context)) { for (String s : getSkills(context)) {
text += GRAY + " - " + AQUA + s + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
} }
if (context.getSessionData(CK.REW_MCMMO_AMOUNTS) == null) { if (context.getSessionData(CK.REW_MCMMO_AMOUNTS) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("reqSetSkillAmounts") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("reqSetSkillAmounts") + "\n";
for (Integer i : getSkillAmounts(context)) { for (Integer i : getSkillAmounts(context)) {
text += GRAY + " - " + AQUA + i + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + i + "\n";
} }
} }
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} }
@ -504,13 +504,13 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
return new mcMMOSkillsPrompt(); return new mcMMOSkillsPrompt();
} else if (input.equalsIgnoreCase("2")) { } else if (input.equalsIgnoreCase("2")) {
if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) { if (context.getSessionData(CK.REW_MCMMO_SKILLS) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("rewSetMcMMOSkillsFirst")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewSetMcMMOSkillsFirst"));
return new mcMMOListPrompt(); return new mcMMOListPrompt();
} else { } else {
return new mcMMOAmountsPrompt(); return new mcMMOAmountsPrompt();
} }
} else if (input.equalsIgnoreCase("3")) { } else if (input.equalsIgnoreCase("3")) {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewMcMMOCleared")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewMcMMOCleared"));
context.setSessionData(CK.REW_MCMMO_SKILLS, null); context.setSessionData(CK.REW_MCMMO_SKILLS, null);
context.setSessionData(CK.REW_MCMMO_AMOUNTS, null); context.setSessionData(CK.REW_MCMMO_AMOUNTS, null);
return new mcMMOListPrompt(); return new mcMMOListPrompt();
@ -534,7 +534,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (one == two) { if (one == two) {
return new RewardsPrompt(quests, factory); return new RewardsPrompt(quests, factory);
} else { } else {
context.getForWhom().sendRawMessage(RED + Lang.get("rewMcMMOListsNotSameSize")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewMcMMOListsNotSameSize"));
return new mcMMOListPrompt(); return new mcMMOListPrompt();
} }
} }
@ -559,19 +559,19 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String skillList = DARKGREEN + Lang.get("skillListTitle") + "\n"; String skillList = ChatColor.DARK_GREEN + Lang.get("skillListTitle") + "\n";
SkillType[] skills = SkillType.values(); SkillType[] skills = SkillType.values();
for (int i = 0; i < skills.length; i++) { for (int i = 0; i < skills.length; i++) {
if (i == (skills.length - 1)) { if (i == (skills.length - 1)) {
skillList += GREEN + skills[i].getName() + "\n"; skillList += ChatColor.GREEN + skills[i].getName() + "\n";
} else { } else {
skillList += GREEN + skills[i].getName() + "\n\n"; skillList += ChatColor.GREEN + skills[i].getName() + "\n\n";
} }
} }
return skillList + Lang.get("rewMcMMOPrompt") + "\n" + GOLD + Lang.get("rewMcMMOPromptHint"); return skillList + Lang.get("rewMcMMOPrompt") + "\n" + ChatColor.GOLD + Lang.get("rewMcMMOPromptHint");
} }
@Override @Override
@ -588,14 +588,14 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (skills.contains(s) == false) { if (skills.contains(s) == false) {
skills.add(Quester.getCapitalized(s)); skills.add(Quester.getCapitalized(s));
} else { } else {
context.getForWhom().sendRawMessage(RED + Lang.get("listDuplicate")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("listDuplicate"));
return new mcMMOSkillsPrompt(); return new mcMMOSkillsPrompt();
} }
} else { } else {
String text = Lang.get("reqMcMMOError"); String text = Lang.get("reqMcMMOError");
text = text.replaceAll("<input>", PINK + s + RED); text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
context.getForWhom().sendRawMessage(RED + text); context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new mcMMOSkillsPrompt(); return new mcMMOSkillsPrompt();
} }
@ -615,7 +615,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
return YELLOW + Lang.get("reqMcMMOAmountsPrompt"); return ChatColor.YELLOW + Lang.get("reqMcMMOAmountsPrompt");
} }
@Override @Override
@ -633,8 +633,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
String text = Lang.get("reqNotANumber"); String text = Lang.get("reqNotANumber");
text = text.replaceAll("<input>", PINK + s + RED); text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
context.getForWhom().sendRawMessage(RED + text); context.getForWhom().sendRawMessage(ChatColor.RED + text);
return new mcMMOAmountsPrompt(); return new mcMMOAmountsPrompt();
} }
@ -661,36 +661,36 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = GOLD + Lang.get("heroesRewardsTitle") + "\n"; String text = ChatColor.GOLD + Lang.get("heroesRewardsTitle") + "\n";
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) { if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("rewSetHeroesClasses") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroesClasses") + " (" + Lang.get("noneSet") + ")\n";
text += GRAY + "2 - " + Lang.get("rewSetHeroesAmounts") + "(" + Lang.get("rewNoHeroesClasses") + ")\n"; text += ChatColor.GRAY + "2 - " + Lang.get("rewSetHeroesAmounts") + "(" + Lang.get("rewNoHeroesClasses") + ")\n";
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} else { } else {
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - " + Lang.get("rewSetHeroesClasses") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "1" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroesClasses") + "\n";
for (String s : getClasses(context)) { for (String s : getClasses(context)) {
text += GRAY + " - " + AQUA + s + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + s + "\n";
} }
if (context.getSessionData(CK.REW_HEROES_AMOUNTS) == null) { if (context.getSessionData(CK.REW_HEROES_AMOUNTS) == null) {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("rewSetHeroesAmounts") + " (" + Lang.get("noneSet") + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroesAmounts") + " (" + Lang.get("noneSet") + ")\n";
} else { } else {
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - " + Lang.get("rewSetHeroesAmounts") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("rewSetHeroesAmounts") + "\n";
for (Double d : getClassAmounts(context)) { for (Double d : getClassAmounts(context)) {
text += GRAY + " - " + AQUA + d + "\n"; text += ChatColor.GRAY + " - " + ChatColor.AQUA + d + "\n";
} }
} }
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - " + Lang.get("clear") + "\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("clear") + "\n";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - " + Lang.get("done"); text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done");
} }
@ -706,13 +706,13 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
return new HeroesClassesPrompt(); return new HeroesClassesPrompt();
} else if (input.equalsIgnoreCase("2")) { } else if (input.equalsIgnoreCase("2")) {
if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) { if (context.getSessionData(CK.REW_HEROES_CLASSES) == null) {
context.getForWhom().sendRawMessage(RED + Lang.get("rewSetHeroesClassesFirst")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewSetHeroesClassesFirst"));
return new HeroesListPrompt(); return new HeroesListPrompt();
} else { } else {
return new HeroesExperiencePrompt(); return new HeroesExperiencePrompt();
} }
} else if (input.equalsIgnoreCase("3")) { } else if (input.equalsIgnoreCase("3")) {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewHeroesCleared")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewHeroesCleared"));
context.setSessionData(CK.REW_HEROES_CLASSES, null); context.setSessionData(CK.REW_HEROES_CLASSES, null);
context.setSessionData(CK.REW_HEROES_AMOUNTS, null); context.setSessionData(CK.REW_HEROES_AMOUNTS, null);
return new HeroesListPrompt(); return new HeroesListPrompt();
@ -736,7 +736,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (one == two) { if (one == two) {
return new RewardsPrompt(quests, factory); return new RewardsPrompt(quests, factory);
} else { } else {
context.getForWhom().sendRawMessage(RED + Lang.get("rewHeroesListsNotSameSize")); context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("rewHeroesListsNotSameSize"));
return new HeroesListPrompt(); return new HeroesListPrompt();
} }
} }
@ -761,27 +761,27 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = PURPLE + Lang.get("heroesClassesTitle") + "\n"; String text = ChatColor.DARK_PURPLE + Lang.get("heroesClassesTitle") + "\n";
LinkedList<String> list = new LinkedList<String>(); LinkedList<String> list = new LinkedList<String>();
for (HeroClass hc : Quests.heroes.getClassManager().getClasses()) { for (HeroClass hc : Quests.heroes.getClassManager().getClasses()) {
list.add(hc.getName()); list.add(hc.getName());
} }
if (list.isEmpty()) { if (list.isEmpty()) {
text += GRAY + "(" + Lang.get("none") + ")\n"; text += ChatColor.GRAY + "(" + Lang.get("none") + ")\n";
} else { } else {
Collections.sort(list); Collections.sort(list);
for (String s : list) { for (String s : list) {
text += PINK + s + ", "; text += ChatColor.LIGHT_PURPLE + s + ", ";
} }
text = text.substring(0, text.length() - 2) + "\n"; text = text.substring(0, text.length() - 2) + "\n";
} }
text += YELLOW + Lang.get("rewHeroesClassesPrompt"); text += ChatColor.YELLOW + Lang.get("rewHeroesClassesPrompt");
return text; return text;
} }
@ -799,8 +799,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
HeroClass hc = Quests.heroes.getClassManager().getClass(s); HeroClass hc = Quests.heroes.getClassManager().getClass(s);
if (hc == null) { if (hc == null) {
String text = Lang.get("rewHeroesInvalidClass"); String text = Lang.get("rewHeroesInvalidClass");
text = text.replaceAll("<input>", PINK + s + RED); text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
cc.getForWhom().sendRawMessage(RED + text); cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new HeroesClassesPrompt(); return new HeroesClassesPrompt();
} else { } else {
classes.add(hc.getName()); classes.add(hc.getName());
@ -826,7 +826,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
String text = Lang.get("heroesExperienceTitle") + "\n"; String text = Lang.get("heroesExperienceTitle") + "\n";
text += YELLOW + Lang.get("rewHeroesExperiencePrompt"); text += ChatColor.YELLOW + Lang.get("rewHeroesExperiencePrompt");
return text; return text;
} }
@ -848,8 +848,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
} catch (NumberFormatException nfe) { } catch (NumberFormatException nfe) {
String text = Lang.get("reqNotANumber"); String text = Lang.get("reqNotANumber");
text = text.replaceAll("<input>", PINK + s + RED); text = text.replaceAll("<input>", ChatColor.LIGHT_PURPLE + s + ChatColor.RED);
cc.getForWhom().sendRawMessage(RED + text); cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new HeroesExperiencePrompt(); return new HeroesExperiencePrompt();
} }
@ -870,15 +870,15 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = DARKAQUA + Lang.get("phatLootsRewardsTitle") + "\n"; String text = ChatColor.DARK_AQUA + Lang.get("phatLootsRewardsTitle") + "\n";
for (PhatLoot pl : PhatLootsAPI.getAllPhatLoots()) { for (PhatLoot pl : PhatLootsAPI.getAllPhatLoots()) {
text += GRAY + "- " + BLUE + pl.name + "\n"; text += ChatColor.GRAY + "- " + ChatColor.BLUE + pl.name + "\n";
} }
text += YELLOW + Lang.get("rewPhatLootsPrompt"); text += ChatColor.YELLOW + Lang.get("rewPhatLootsPrompt");
return text; return text;
} }
@ -895,8 +895,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
if (PhatLootsAPI.getPhatLoot(s) == null) { if (PhatLootsAPI.getPhatLoot(s) == null) {
String text = Lang.get("rewPhatLootsInvalid"); String text = Lang.get("rewPhatLootsInvalid");
text = text.replaceAll("<input>", DARKRED + s + RED); text = text.replaceAll("<input>", ChatColor.DARK_RED + s + ChatColor.RED);
cc.getForWhom().sendRawMessage(RED + text); cc.getForWhom().sendRawMessage(ChatColor.RED + text);
return new PhatLootsPrompt(); return new PhatLootsPrompt();
} }
@ -909,7 +909,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) { } else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
cc.setSessionData(CK.REW_PHAT_LOOTS, null); cc.setSessionData(CK.REW_PHAT_LOOTS, null);
cc.getForWhom().sendRawMessage(YELLOW + Lang.get("rewPhatLootsCleared")); cc.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewPhatLootsCleared"));
return new RewardsPrompt(quests, factory); return new RewardsPrompt(quests, factory);
} else { } else {
@ -923,16 +923,16 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = PINK + Lang.get("customRewardsTitle") + "\n"; String text = ChatColor.LIGHT_PURPLE + Lang.get("customRewardsTitle") + "\n";
if (quests.customRewards.isEmpty()) { if (quests.customRewards.isEmpty()) {
text += BOLD + "" + PURPLE + "(" + Lang.get("stageEditorNoModules") + ")"; text += ChatColor.BOLD + "" + ChatColor.DARK_PURPLE + "(" + Lang.get("stageEditorNoModules") + ")";
} else { } else {
for (CustomReward cr : quests.customRewards) { for (CustomReward cr : quests.customRewards) {
text += PURPLE + " - " + cr.getName() + "\n"; text += ChatColor.DARK_PURPLE + " - " + cr.getName() + "\n";
} }
} }
return text + YELLOW + Lang.get("rewCustomRewardPrompt"); return text + ChatColor.YELLOW + Lang.get("rewCustomRewardPrompt");
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -969,7 +969,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
context.setSessionData(CK.REW_CUSTOM, list); context.setSessionData(CK.REW_CUSTOM, list);
context.setSessionData(CK.REW_CUSTOM_DATA, datamapList); context.setSessionData(CK.REW_CUSTOM_DATA, datamapList);
} else { } else {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewCustomAlreadyAdded")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewCustomAlreadyAdded"));
return new CustomRewardsPrompt(); return new CustomRewardsPrompt();
} }
} else { } else {
@ -991,7 +991,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
// //
} else { } else {
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewCustomNotFound")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewCustomNotFound"));
return new CustomRewardsPrompt(); return new CustomRewardsPrompt();
} }
@ -999,7 +999,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
context.setSessionData(CK.REW_CUSTOM, null); context.setSessionData(CK.REW_CUSTOM, null);
context.setSessionData(CK.REW_CUSTOM_DATA, null); context.setSessionData(CK.REW_CUSTOM_DATA, null);
context.setSessionData(CK.REW_CUSTOM_DATA_TEMP, null); context.setSessionData(CK.REW_CUSTOM_DATA_TEMP, null);
context.getForWhom().sendRawMessage(YELLOW + Lang.get("rewCustomCleared")); context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("rewCustomCleared"));
} }
return new RewardsPrompt(quests, factory); return new RewardsPrompt(quests, factory);
@ -1013,7 +1013,7 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String text = BOLD + "" + AQUA + "- "; String text = ChatColor.BOLD + "" + ChatColor.AQUA + "- ";
LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM); LinkedList<String> list = (LinkedList<String>) context.getSessionData(CK.REW_CUSTOM);
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA); LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA);
@ -1032,18 +1032,18 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
for (String dataKey : datamapKeys) { for (String dataKey : datamapKeys) {
text += BOLD + "" + DARKBLUE + index + " - " + RESET + BLUE + dataKey; text += ChatColor.BOLD + "" + ChatColor.DARK_BLUE + index + " - " + ChatColor.RESET + ChatColor.BLUE + dataKey;
if (datamap.get(dataKey) != null) { if (datamap.get(dataKey) != null) {
text += GREEN + " (" + (String) datamap.get(dataKey) + ")\n"; text += ChatColor.GREEN + " (" + (String) datamap.get(dataKey) + ")\n";
} else { } else {
text += RED + " (" + Lang.get("valRequired") + ")\n"; text += ChatColor.RED + " (" + Lang.get("valRequired") + ")\n";
} }
index++; index++;
} }
text += BOLD + "" + DARKBLUE + index + " - " + AQUA + Lang.get("finish"); text += ChatColor.BOLD + "" + ChatColor.DARK_BLUE + index + " - " + ChatColor.AQUA + Lang.get("finish");
return text; return text;
} }
@ -1103,12 +1103,12 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REW_CUSTOM_DATA_DESCRIPTIONS); Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REW_CUSTOM_DATA_DESCRIPTIONS);
if (descriptions.get(temp) != null) { if (descriptions.get(temp) != null) {
text += GOLD + descriptions.get(temp) + "\n"; text += ChatColor.GOLD + descriptions.get(temp) + "\n";
} }
String lang = Lang.get("stageEditorCustomDataPrompt"); String lang = Lang.get("stageEditorCustomDataPrompt");
lang = lang.replaceAll("<data>", temp); lang = lang.replaceAll("<data>", temp);
text += YELLOW + lang; text += ChatColor.YELLOW + lang;
return text; return text;
} }

View File

@ -1,15 +1,15 @@
package me.blackvein.quests.prompts; package me.blackvein.quests.prompts;
import me.blackvein.quests.util.ColorUtil; import org.bukkit.ChatColor;
import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.Lang;
import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt; import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt; import org.bukkit.conversations.StringPrompt;
public class StagesPrompt extends StringPrompt implements ColorUtil { import me.blackvein.quests.QuestFactory;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.Lang;
public class StagesPrompt extends StringPrompt {
private final QuestFactory questFactory; private final QuestFactory questFactory;
@ -22,20 +22,20 @@ public class StagesPrompt extends StringPrompt implements ColorUtil {
@Override @Override
public String getPromptText(ConversationContext cc) { public String getPromptText(ConversationContext cc) {
String text = PINK + "- " + PURPLE + Lang.get("stageEditorStages") + PINK + " -\n"; String text = ChatColor.LIGHT_PURPLE + "- " + ChatColor.DARK_PURPLE + Lang.get("stageEditorStages") + ChatColor.LIGHT_PURPLE + " -\n";
int stages = getStages(cc); int stages = getStages(cc);
for (int i = 1; i <= stages; i++) { for (int i = 1; i <= stages; i++) {
text += BOLD + "" + GREEN + i + ". " + RESET + GOLD + Lang.get("stageEditorEditStage") + " " + i + "\n"; text += ChatColor.BOLD + "" + ChatColor.GREEN + i + ". " + ChatColor.RESET + ChatColor.GOLD + Lang.get("stageEditorEditStage") + " " + i + "\n";
} }
stages++; stages++;
text += "\n" + BOLD + "" + GREEN + stages + ". " + RESET + YELLOW + Lang.get("stageEditorNewStage"); text += "\n" + ChatColor.BOLD + "" + ChatColor.GREEN + stages + ". " + ChatColor.RESET + ChatColor.YELLOW + Lang.get("stageEditorNewStage");
stages++; stages++;
text += "\n" + BOLD + "" + BLUE + stages + ". " + RESET + YELLOW + Lang.get("done"); text += "\n" + ChatColor.BOLD + "" + ChatColor.BLUE + stages + ". " + ChatColor.RESET + ChatColor.YELLOW + Lang.get("done");
return text; return text;
} }

View File

@ -1,30 +0,0 @@
package me.blackvein.quests.util;
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;
}

View File

@ -14,7 +14,7 @@ import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
public class ItemUtil implements ColorUtil { public class ItemUtil {
static Quests plugin; static Quests plugin;
@ -172,17 +172,17 @@ public class ItemUtil implements ColorUtil {
return null; return null;
} }
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) { if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName() + RESET + AQUA + " x " + is.getAmount(); text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName() + ChatColor.RESET + ChatColor.AQUA + " x " + is.getAmount();
} else { } else {
text = AQUA + Quester.prettyItemString(is.getType().name()); text = ChatColor.AQUA + Quester.prettyItemString(is.getType().name());
if (is.getDurability() != 0) { if (is.getDurability() != 0) {
text += AQUA + ":" + is.getDurability(); text += ChatColor.AQUA + ":" + is.getDurability();
} }
text += AQUA + " x " + is.getAmount(); text += ChatColor.AQUA + " x " + is.getAmount();
if (is.getEnchantments().isEmpty() == false) { if (is.getEnchantments().isEmpty() == false) {
text += " " + PURPLE + Lang.get("enchantedItem"); text += " " + ChatColor.DARK_PURPLE + Lang.get("enchantedItem");
} }
} }
@ -196,14 +196,14 @@ public class ItemUtil implements ColorUtil {
String text; String text;
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) { if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName() + RESET + AQUA + " x " + is.getAmount(); text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName() + ChatColor.RESET + ChatColor.AQUA + " x " + is.getAmount();
} else { } else {
text = AQUA + Quester.prettyItemString(is.getType().name()); text = ChatColor.AQUA + Quester.prettyItemString(is.getType().name());
if (is.getDurability() != 0) { if (is.getDurability() != 0) {
text += AQUA + ":" + is.getDurability(); text += ChatColor.AQUA + ":" + is.getDurability();
} }
text += AQUA + " x " + is.getAmount(); text += ChatColor.AQUA + " x " + is.getAmount();
} }
@ -216,10 +216,10 @@ public class ItemUtil implements ColorUtil {
String text = ""; String text = "";
if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) { if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) {
text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName(); text = "" + ChatColor.DARK_AQUA + ChatColor.ITALIC + is.getItemMeta().getDisplayName();
} else { } else {
try { try {
text = AQUA + Items.itemByStack(is).getName(); text = ChatColor.AQUA + Items.itemByStack(is).getName();
} catch (NullPointerException ne) { } catch (NullPointerException ne) {
Bukkit.getLogger().severe("This error is caused by an incompatible version of Vault. Please update!"); Bukkit.getLogger().severe("This error is caused by an incompatible version of Vault. Please update!");
ne.printStackTrace(); ne.printStackTrace();
@ -253,7 +253,7 @@ public class ItemUtil implements ColorUtil {
if(is.getItemMeta().hasDisplayName() == false) if(is.getItemMeta().hasDisplayName() == false)
return false; return false;
return is.getItemMeta().getDisplayName().equals(PINK + Lang.get("journalTitle")); return is.getItemMeta().getDisplayName().equals(ChatColor.LIGHT_PURPLE + Lang.get("journalTitle"));
} }

View File

@ -1,18 +0,0 @@
package me.blackvein.quests.util;
import java.lang.reflect.Field;
public class ReflectionUtil {
public static void setValue(Object instance, String fieldName, Object value) throws Exception {
Field field = instance.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
field.set(instance, value);
}
public static Object getValue(Object instance, String fieldName) throws Exception {
Field field = instance.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
return field.get(instance);
}
}