diff --git a/src/main/java/me/blackvein/quests/Event.java b/src/main/java/me/blackvein/quests/Event.java index 17d382841..549627cc4 100644 --- a/src/main/java/me/blackvein/quests/Event.java +++ b/src/main/java/me/blackvein/quests/Event.java @@ -35,7 +35,6 @@ import org.bukkit.potion.PotionEffect; import me.blackvein.quests.timers.EventTimer; import me.blackvein.quests.util.ItemUtil; import me.blackvein.quests.util.Lang; -import me.blackvein.quests.util.QuestMob; public class Event { @@ -563,8 +562,8 @@ public class Event { inventory[4] = ItemUtil.readItemStack(section.getString(s + ".helmet")); dropChances[4] = (float) section.getDouble(s + ".helmet-drop-chance"); QuestMob questMob = new QuestMob(type, spawnLocation, mobAmount); - questMob.inventory = inventory; - questMob.dropChances = dropChances; + questMob.setInventory(inventory); + questMob.setDropChances(dropChances); questMob.setName(mobName); event.mobSpawns.add(questMob); } diff --git a/src/main/java/me/blackvein/quests/EventFactory.java b/src/main/java/me/blackvein/quests/EventFactory.java index 1e4969731..c6c3f3832 100644 --- a/src/main/java/me/blackvein/quests/EventFactory.java +++ b/src/main/java/me/blackvein/quests/EventFactory.java @@ -51,7 +51,6 @@ import me.blackvein.quests.util.CK; import me.blackvein.quests.util.ItemUtil; import me.blackvein.quests.util.Lang; import me.blackvein.quests.util.MiscUtil; -import me.blackvein.quests.util.QuestMob; public class EventFactory implements ConversationAbandonedListener { @@ -827,16 +826,16 @@ public class EventFactory implements ConversationAbandonedListener { ss.set("spawn-location", Quests.getLocationInfo(questMob.getSpawnLocation())); ss.set("mob-type", questMob.getType().name()); ss.set("spawn-amounts", questMob.getSpawnAmounts()); - ss.set("held-item", ItemUtil.serializeItemStack(questMob.inventory[0])); - ss.set("held-item-drop-chance", questMob.dropChances[0]); - ss.set("boots", ItemUtil.serializeItemStack(questMob.inventory[1])); - ss.set("boots-drop-chance", questMob.dropChances[1]); - ss.set("leggings", ItemUtil.serializeItemStack(questMob.inventory[2])); - ss.set("leggings-drop-chance", questMob.dropChances[2]); - ss.set("chest-plate", ItemUtil.serializeItemStack(questMob.inventory[3])); - ss.set("chest-plate-drop-chance", questMob.dropChances[3]); - ss.set("helmet", ItemUtil.serializeItemStack(questMob.inventory[4])); - ss.set("helmet-drop-chance", questMob.dropChances[4]); + ss.set("held-item", ItemUtil.serializeItemStack(questMob.getInventory()[0])); + ss.set("held-item-drop-chance", questMob.getDropChances()[0]); + ss.set("boots", ItemUtil.serializeItemStack(questMob.getInventory()[1])); + ss.set("boots-drop-chance", questMob.getDropChances()[1]); + ss.set("leggings", ItemUtil.serializeItemStack(questMob.getInventory()[2])); + ss.set("leggings-drop-chance", questMob.getDropChances()[2]); + ss.set("chest-plate", ItemUtil.serializeItemStack(questMob.getInventory()[3])); + ss.set("chest-plate-drop-chance", questMob.getDropChances()[3]); + ss.set("helmet", ItemUtil.serializeItemStack(questMob.getInventory()[4])); + ss.set("helmet-drop-chance", questMob.getDropChances()[4]); count++; } } @@ -1540,7 +1539,7 @@ public class EventFactory implements ConversationAbandonedListener { // Check/add newly made item if (context.getSessionData("newItem") != null) { if (itemIndex >= 0) { - questMob.inventory[itemIndex] = ((ItemStack) context.getSessionData("tempStack")); + questMob.getInventory()[itemIndex] = ((ItemStack) context.getSessionData("tempStack")); itemIndex = -1; } context.setSessionData("newItem", null); @@ -1550,16 +1549,16 @@ public class EventFactory implements ConversationAbandonedListener { text += ChatColor.BLUE + "" + ChatColor.BOLD + "2" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobType") + ChatColor.GRAY + " (" + ((questMob.getType() == null) ? Lang.get("noneSet") : ChatColor.AQUA + questMob.getType().name()) + ChatColor.GRAY + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "3" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorAddSpawnLocation") + ChatColor.GRAY + " (" + ((questMob.getSpawnLocation() == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + Quests.getLocationInfo(questMob.getSpawnLocation())) + ChatColor.GRAY + ")\n"; text += ChatColor.BLUE + "" + ChatColor.BOLD + "4" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobSpawnAmount") + ChatColor.GRAY + " (" + ((questMob.getSpawnAmounts() == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.getSpawnAmounts()) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobItemInHand") + ChatColor.GRAY + " (" + ((questMob.inventory[0] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[0])) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobItemInHandDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[0] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[0]) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobBoots") + ChatColor.GRAY + " (" + ((questMob.inventory[1] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[1])) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobBootsDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[1] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[1]) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobLeggings") + ChatColor.GRAY + " (" + ((questMob.inventory[2] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[2])) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "10" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobLeggingsDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[2] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[2]) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobChestPlate") + ChatColor.GRAY + " (" + ((questMob.inventory[3] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[3])) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "12" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobChestPlateDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[3] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[3]) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "13" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobHelmet") + ChatColor.GRAY + " (" + ((questMob.inventory[4] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.inventory[4])) + ChatColor.GRAY + ")\n"; - text += ChatColor.BLUE + "" + ChatColor.BOLD + "14" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobHelmetDrop") + ChatColor.GRAY + " (" + ((questMob.dropChances[4] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.dropChances[4]) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "5" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobItemInHand") + ChatColor.GRAY + " (" + ((questMob.getInventory()[0] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.getInventory()[0])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "6" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobItemInHandDrop") + ChatColor.GRAY + " (" + ((questMob.getDropChances()[0] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.getDropChances()[0]) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "7" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobBoots") + ChatColor.GRAY + " (" + ((questMob.getInventory()[1] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.getInventory()[1])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "8" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobBootsDrop") + ChatColor.GRAY + " (" + ((questMob.getDropChances()[1] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.getDropChances()[1]) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "9" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobLeggings") + ChatColor.GRAY + " (" + ((questMob.getInventory()[2] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.getInventory()[2])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "10" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobLeggingsDrop") + ChatColor.GRAY + " (" + ((questMob.getDropChances()[2] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.getDropChances()[2]) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "11" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobChestPlate") + ChatColor.GRAY + " (" + ((questMob.getInventory()[3] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.getInventory()[3])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "12" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobChestPlateDrop") + ChatColor.GRAY + " (" + ((questMob.getDropChances()[3] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.getDropChances()[3]) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "13" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobHelmet") + ChatColor.GRAY + " (" + ((questMob.getInventory()[4] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + ItemUtil.getDisplayString(questMob.getInventory()[4])) + ChatColor.GRAY + ")\n"; + text += ChatColor.BLUE + "" + ChatColor.BOLD + "14" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("eventEditorSetMobHelmetDrop") + ChatColor.GRAY + " (" + ((questMob.getDropChances()[4] == null) ? ChatColor.GRAY + Lang.get("noneSet") : ChatColor.AQUA + "" + questMob.getDropChances()[4]) + ChatColor.GRAY + ")\n"; text += ChatColor.GREEN + "" + ChatColor.BOLD + "15" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("done") + "\n"; text += ChatColor.RED + "" + ChatColor.BOLD + "16" + ChatColor.RESET + ChatColor.YELLOW + " - " + Lang.get("cancel"); return text; @@ -1819,7 +1818,9 @@ public class EventFactory implements ConversationAbandonedListener { .replace("", "0.0").replace("", "1.0")); return new MobDropPrompt(invIndex, mobIndex, questMob); } - questMob.dropChances[invIndex] = chance; + Float[] temp = questMob.getDropChances(); + temp[invIndex] = chance; + questMob.setDropChances(temp); return new QuestMobPrompt(mobIndex, questMob); } } diff --git a/src/main/java/me/blackvein/quests/QuestFactory.java b/src/main/java/me/blackvein/quests/QuestFactory.java index 2e382a148..5f25e3a1d 100644 --- a/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/src/main/java/me/blackvein/quests/QuestFactory.java @@ -1402,8 +1402,7 @@ public class QuestFactory implements ConversationAbandonedListener { if (pln.getCooldown() != -1) { cc.setSessionData(CK.PLN_COOLDOWN, pln.getCooldown()); } - // - // Stages + // Stages (Objectives) int index = 1; for (Stage stage : q.getStages()) { final String pref = "stage" + index; diff --git a/src/main/java/me/blackvein/quests/util/QuestMob.java b/src/main/java/me/blackvein/quests/QuestMob.java similarity index 91% rename from src/main/java/me/blackvein/quests/util/QuestMob.java rename to src/main/java/me/blackvein/quests/QuestMob.java index 03336afbf..009472cb5 100644 --- a/src/main/java/me/blackvein/quests/util/QuestMob.java +++ b/src/main/java/me/blackvein/quests/QuestMob.java @@ -10,7 +10,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************************************/ -package me.blackvein.quests.util; +package me.blackvein.quests; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -20,7 +20,7 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.ItemStack; -import me.blackvein.quests.Quests; +import me.blackvein.quests.util.ItemUtil; public class QuestMob { @@ -28,8 +28,11 @@ public class QuestMob { private EntityType entityType = null; private Location spawnLocation = null; private Integer spawnAmounts = null; - public ItemStack[] inventory = new ItemStack[5]; - public Float[] dropChances = new Float[5]; + private ItemStack[] inventory = new ItemStack[5]; + private Float[] dropChances = new Float[5]; + + public QuestMob(){ + } public QuestMob(EntityType entityType, Location spawnLocation, int spawnAmounts) { this.entityType = entityType; @@ -37,39 +40,52 @@ public class QuestMob { this.spawnAmounts = spawnAmounts; } - public QuestMob() { + public String getName() { + return name; } - - public void setSpawnLocation(Location spawnLocation) { - this.spawnLocation = spawnLocation; + + public void setName(String name) { + this.name = name; + } + + public EntityType getType() { + return entityType; + } + + public void setType(EntityType entityType) { + this.entityType = entityType; } public Location getSpawnLocation() { return spawnLocation; } - - public void setType(EntityType entityType) { - this.entityType = entityType; - } - - public EntityType getType() { - return entityType; - } - - public void setSpawnAmounts(int spawnAmounts) { - this.spawnAmounts = spawnAmounts; + + public void setSpawnLocation(Location spawnLocation) { + this.spawnLocation = spawnLocation; } public Integer getSpawnAmounts() { return spawnAmounts; } - public void setName(String name) { - this.name = name; + public void setSpawnAmounts(int spawnAmounts) { + this.spawnAmounts = spawnAmounts; } - public String getName() { - return name; + public ItemStack[] getInventory() { + return inventory; + } + + public void setInventory(ItemStack[] inventory) { + this.inventory = inventory; + } + + public Float[] getDropChances() { + return dropChances; + } + + public void setDropChances(Float[] dropChances) { + this.dropChances = dropChances; } public void setHelmet(ItemStack helmet, float dropChance) { diff --git a/src/main/java/me/blackvein/quests/Quester.java b/src/main/java/me/blackvein/quests/Quester.java index 8663d3a48..44ed85df7 100644 --- a/src/main/java/me/blackvein/quests/Quester.java +++ b/src/main/java/me/blackvein/quests/Quester.java @@ -1349,7 +1349,7 @@ public class Quester { } } - public void sayPass(Quest quest, AsyncPlayerChatEvent evt) { + public void sayPassword(Quest quest, AsyncPlayerChatEvent evt) { boolean done; for (LinkedList passes : getCurrentStage(quest).passwordPhrases) { done = false; diff --git a/src/main/java/me/blackvein/quests/Quests.java b/src/main/java/me/blackvein/quests/Quests.java index 20fcf710b..00a2ba01d 100644 --- a/src/main/java/me/blackvein/quests/Quests.java +++ b/src/main/java/me/blackvein/quests/Quests.java @@ -306,7 +306,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener loadEvents(); getLogger().log(Level.INFO, "" + quests.size() + " Quest(s) loaded."); getLogger().log(Level.INFO, "" + events.size() + " Event(s) loaded."); - getLogger().log(Level.INFO, "" + Lang.getPhrases() + " Phrase(s) loaded."); + getLogger().log(Level.INFO, "" + Lang.size() + " Phrase(s) loaded."); questers.putAll(getOnlineQuesters()); } }, 5L); @@ -537,9 +537,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener killDelay = config.getInt("kill-delay", 600); if (config.getString("language").equalsIgnoreCase("en")) { //Legacy - lang.iso = "en-US"; + lang.setISO("en-US"); } else { - lang.iso = config.getString("language", "en-US"); + lang.setISO(config.getString("language", "en-US")); } maxQuests = config.getInt("max-quests", maxQuests); npcEffects = config.getBoolean("npc-effects.enabled", true); @@ -2154,7 +2154,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener // Reload config from disc in-case a setting was changed reloadConfig(); loadConfig(); - Lang.clearPhrases(); + Lang.clear(); try { lang.loadLang(); } catch (InvalidConfigurationException e) { diff --git a/src/main/java/me/blackvein/quests/listeners/PlayerListener.java b/src/main/java/me/blackvein/quests/listeners/PlayerListener.java index e97c8c383..9240850c2 100644 --- a/src/main/java/me/blackvein/quests/listeners/PlayerListener.java +++ b/src/main/java/me/blackvein/quests/listeners/PlayerListener.java @@ -335,7 +335,7 @@ public class PlayerListener implements Listener { } } if (quester.containsObjective(quest, "password")) { - quester.sayPass(quest, evt); + quester.sayPassword(quest, evt); } } } diff --git a/src/main/java/me/blackvein/quests/prompts/DateTimePrompt.java b/src/main/java/me/blackvein/quests/prompts/DateTimePrompt.java index d8c8e6d7c..0d9ccd8f1 100644 --- a/src/main/java/me/blackvein/quests/prompts/DateTimePrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/DateTimePrompt.java @@ -18,9 +18,9 @@ import org.bukkit.conversations.StringPrompt; public class DateTimePrompt extends FixedSetPrompt { - Quests quests; - final Prompt oldPrompt; - String source = ""; + private Quests quests; + private final Prompt oldPrompt; + private String source = ""; public DateTimePrompt(Quests plugin, Prompt old, String origin) { super("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); @@ -65,7 +65,7 @@ public class DateTimePrompt extends FixedSetPrompt { } TimeZone tz = TimeZone.getTimeZone((String) cc.getSessionData("tempZone")); cal.setTimeZone(tz); - String[] iso = quests.lang.iso.split("-"); + String[] iso = quests.lang.getISO().split("-"); Locale loc = new Locale(iso[0], iso[1]); Double hour = (double) (cal.getTimeZone().getRawOffset() / 60 / 60 / 1000); String[] sep = String.valueOf(hour).replace("-", "").split("\\."); diff --git a/src/main/java/me/blackvein/quests/prompts/ItemStackPrompt.java b/src/main/java/me/blackvein/quests/prompts/ItemStackPrompt.java index e8f67f73e..45e685f76 100644 --- a/src/main/java/me/blackvein/quests/prompts/ItemStackPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/ItemStackPrompt.java @@ -48,7 +48,7 @@ public class ItemStackPrompt extends FixedSetPrompt { // Stores display name in "tempDisplay" // Stores lore in "tempLore" // Stores metadata in "tempMeta" - final Prompt oldPrompt; + private final Prompt oldPrompt; public ItemStackPrompt(Prompt old) { super("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); diff --git a/src/main/java/me/blackvein/quests/prompts/PlannerPrompt.java b/src/main/java/me/blackvein/quests/prompts/PlannerPrompt.java index b6c854b13..7032e9725 100644 --- a/src/main/java/me/blackvein/quests/prompts/PlannerPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/PlannerPrompt.java @@ -31,8 +31,8 @@ import org.bukkit.conversations.StringPrompt; public class PlannerPrompt extends FixedSetPrompt { - final Quests quests; - final QuestFactory factory; + private final Quests quests; + private final QuestFactory factory; public PlannerPrompt(Quests plugin, QuestFactory qf) { super("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"); @@ -178,7 +178,7 @@ public class PlannerPrompt extends FixedSetPrompt { TimeZone tz = TimeZone.getTimeZone(date[6]); cal.setTimeZone(tz); - String[] iso = quests.lang.iso.split("-"); + String[] iso = quests.lang.getISO().split("-"); Locale loc = new Locale(iso[0], iso[1]); Double zhour = (double) (cal.getTimeZone().getRawOffset() / 60 / 60 / 1000); String[] sep = String.valueOf(zhour).replace("-", "").split("\\."); diff --git a/src/main/java/me/blackvein/quests/prompts/QuestAcceptPrompt.java b/src/main/java/me/blackvein/quests/prompts/QuestAcceptPrompt.java index 12b55db74..b9bf1b3d3 100644 --- a/src/main/java/me/blackvein/quests/prompts/QuestAcceptPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/QuestAcceptPrompt.java @@ -30,9 +30,9 @@ import me.blackvein.quests.util.Lang; public class QuestAcceptPrompt extends StringPrompt { - final Quests plugin; - Quester quester; - LinkedList quests; + private final Quests plugin; + private Quester quester; + private LinkedList quests; public QuestAcceptPrompt(Quests plugin) { this.plugin = plugin; diff --git a/src/main/java/me/blackvein/quests/prompts/RequirementsPrompt.java b/src/main/java/me/blackvein/quests/prompts/RequirementsPrompt.java index fd17dca19..61748fe9a 100644 --- a/src/main/java/me/blackvein/quests/prompts/RequirementsPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/RequirementsPrompt.java @@ -40,8 +40,8 @@ import me.blackvein.quests.util.MiscUtil; public class RequirementsPrompt extends FixedSetPrompt { - Quests quests; - final QuestFactory factory; + private Quests quests; + private final QuestFactory factory; public RequirementsPrompt(Quests plugin, QuestFactory qf) { super("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"); diff --git a/src/main/java/me/blackvein/quests/prompts/RewardsPrompt.java b/src/main/java/me/blackvein/quests/prompts/RewardsPrompt.java index 8ddfca341..21ab8d1da 100644 --- a/src/main/java/me/blackvein/quests/prompts/RewardsPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/RewardsPrompt.java @@ -40,8 +40,8 @@ import me.blackvein.quests.util.Lang; public class RewardsPrompt extends FixedSetPrompt { - final Quests quests; - final QuestFactory factory; + private final Quests quests; + private final QuestFactory factory; public RewardsPrompt(Quests plugin, QuestFactory qf) { super("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"); diff --git a/src/main/java/me/blackvein/quests/util/CK.java b/src/main/java/me/blackvein/quests/util/CK.java index e7ffc42e6..99617522d 100644 --- a/src/main/java/me/blackvein/quests/util/CK.java +++ b/src/main/java/me/blackvein/quests/util/CK.java @@ -154,5 +154,5 @@ public class CK { public static final String E_TIMER = "evtTimer"; public static final String E_CANCEL_TIMER = "evtCancelTimer"; // Party - public static final String P_INVITER = "inviter"; + //public static final String P_INVITER = "inviter"; } \ No newline at end of file diff --git a/src/main/java/me/blackvein/quests/util/ItemUtil.java b/src/main/java/me/blackvein/quests/util/ItemUtil.java index 357f318c8..238eb793c 100644 --- a/src/main/java/me/blackvein/quests/util/ItemUtil.java +++ b/src/main/java/me/blackvein/quests/util/ItemUtil.java @@ -36,7 +36,7 @@ import me.blackvein.quests.Quester; public class ItemUtil { /** - * Compare two stacks by name, amount, durability, display name, lore, enchantments and stored enchants + * Compare two stacks by name, amount, durability, display name, lore, enchantments, stored enchants and item flags * * * @param one first ItemStack to compare against second diff --git a/src/main/java/me/blackvein/quests/util/Lang.java b/src/main/java/me/blackvein/quests/util/Lang.java index b79fe430e..82795f4df 100644 --- a/src/main/java/me/blackvein/quests/util/Lang.java +++ b/src/main/java/me/blackvein/quests/util/Lang.java @@ -16,6 +16,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; +import java.util.Collection; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; @@ -32,9 +33,9 @@ import me.clip.placeholderapi.PlaceholderAPI; public class Lang { - public String iso = "en-US"; + private String iso = "en-US"; private static final LangToken tokens = new LangToken(); - public static final LinkedHashMap langMap = new LinkedHashMap(); + private static final LinkedHashMap langMap = new LinkedHashMap(); private final Quests plugin; public Lang(Quests plugin) { @@ -42,6 +43,18 @@ public class Lang { this.plugin = plugin; } + public String getISO() { + return iso; + } + + public void setISO(String iso) { + this.iso = iso; + } + + public Collection values() { + return langMap.values(); + } + /** * Get lang string AND pass Player for use with PlaceholderAPI, if installed * @@ -91,11 +104,11 @@ public class Lang { return "NULL"; } - public static void clearPhrases() { + public static void clear() { langMap.clear(); } - public static int getPhrases() { + public static int size() { return langMap.size(); }