aboutsummaryrefslogtreecommitdiffstats
path: root/src/me/fatpigsarefat/quests/obj/misc
diff options
context:
space:
mode:
authorfatpigsarefat <fatpigsarefat@outlook.com>2018-07-21 21:25:00 +0100
committerfatpigsarefat <fatpigsarefat@outlook.com>2018-07-21 21:25:01 +0100
commitbcd4d141c04768c2ed3d00d4963e4f40424b5bc4 (patch)
treeb79a965aaa19bee8f859f1de5272feae2fbb0153 /src/me/fatpigsarefat/quests/obj/misc
parent56aae6d737aa523f23160256b5022b8cce8fe9c5 (diff)
Now using Maven
- pom.xml was added - Source files moved - .gitignore adjusted to allow .xml - All Title classes changed to use Bukkit method instead
Diffstat (limited to 'src/me/fatpigsarefat/quests/obj/misc')
-rw-r--r--src/me/fatpigsarefat/quests/obj/misc/QItemStack.java114
-rw-r--r--src/me/fatpigsarefat/quests/obj/misc/QMenu.java12
-rw-r--r--src/me/fatpigsarefat/quests/obj/misc/QMenuCategory.java92
-rw-r--r--src/me/fatpigsarefat/quests/obj/misc/QMenuDaily.java121
-rw-r--r--src/me/fatpigsarefat/quests/obj/misc/QMenuQuest.java224
-rw-r--r--src/me/fatpigsarefat/quests/obj/misc/creator/QMenuCreator.java70
6 files changed, 0 insertions, 633 deletions
diff --git a/src/me/fatpigsarefat/quests/obj/misc/QItemStack.java b/src/me/fatpigsarefat/quests/obj/misc/QItemStack.java
deleted file mode 100644
index 81cefc3b..00000000
--- a/src/me/fatpigsarefat/quests/obj/misc/QItemStack.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package me.fatpigsarefat.quests.obj.misc;
-
-import me.fatpigsarefat.quests.player.questprogressfile.QuestProgress;
-import org.bukkit.Material;
-import org.bukkit.enchantments.Enchantment;
-import org.bukkit.inventory.ItemFlag;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.inventory.meta.ItemMeta;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class QItemStack {
-
- private String name;
- private List<String> loreNormal;
- private List<String> loreStarted;
- private Material type;
- private int data;
-
- public QItemStack(String name, List<String> loreNormal, List<String> loreStarted, Material type, int data) {
- this.name = name;
- this.loreNormal = loreNormal;
- this.loreStarted = loreStarted;
- this.type = type;
- this.data = data;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public List<String> getLoreNormal() {
- return loreNormal;
- }
-
- public void setLoreNormal(List<String> loreNormal) {
- this.loreNormal = loreNormal;
- }
-
- public List<String> getLoreStarted() {
- return loreStarted;
- }
-
- public void setLoreStarted(List<String> loreStarted) {
- this.loreStarted = loreStarted;
- }
-
- public Material getType() {
- return type;
- }
-
- public void setType(Material type) {
- this.type = type;
- }
-
- public int getData() {
- return data;
- }
-
- public void setData(int data) {
- this.data = data;
- }
-
- public ItemStack toItemStack(QuestProgress questProgress) {
- ItemStack is = new ItemStack(type, 1, (short) data);
- ItemMeta ism = is.getItemMeta();
- ism.setDisplayName(name);
- List<String> formattedLore = new ArrayList<>();
- List<String> tempLore = new ArrayList<>();
- tempLore.addAll(loreNormal);
- if (questProgress != null && questProgress.isStarted()) {
- tempLore.addAll(loreStarted);
- ism.addEnchant(Enchantment.ARROW_INFINITE, 1, true);
- try {
- ism.addItemFlags(ItemFlag.HIDE_ENCHANTS);
- ism.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
- } catch (Exception ignored) {
-
- }
- }
- if (questProgress != null) {
- for (String s : tempLore) {
- Matcher m = Pattern.compile("\\{([^}]+)\\}").matcher(s);
- while (m.find()) {
- String[] parts = m.group(1).split(":");
- if (parts.length > 1) {
- if (questProgress.getTaskProgress(parts[0]) == null) {
- continue;
- }
- if (parts[1].equals("progress")) {
- String str = String.valueOf(questProgress.getTaskProgress(parts[0]).getProgress());
- s = s.replace("{" + m.group(1) + "}", (str.equals("null") ? String.valueOf(0) : str));
- }
- if (parts[1].equals("complete")) {
- String str = String.valueOf(questProgress.getTaskProgress(parts[0]).isCompleted());
- s = s.replace("{" + m.group(1) + "}", str);
- }
- }
- }
- formattedLore.add(s);
- }
- }
- ism.setLore(formattedLore);
- is.setItemMeta(ism);
- return is;
- }
-}
diff --git a/src/me/fatpigsarefat/quests/obj/misc/QMenu.java b/src/me/fatpigsarefat/quests/obj/misc/QMenu.java
deleted file mode 100644
index 13629600..00000000
--- a/src/me/fatpigsarefat/quests/obj/misc/QMenu.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package me.fatpigsarefat.quests.obj.misc;
-
-import me.fatpigsarefat.quests.player.QPlayer;
-
-import java.util.HashMap;
-
-public interface QMenu {
-
- QPlayer getOwner();
- HashMap<?, ?> getSlotsToMenu();
-
-}
diff --git a/src/me/fatpigsarefat/quests/obj/misc/QMenuCategory.java b/src/me/fatpigsarefat/quests/obj/misc/QMenuCategory.java
deleted file mode 100644
index 61d1ac57..00000000
--- a/src/me/fatpigsarefat/quests/obj/misc/QMenuCategory.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package me.fatpigsarefat.quests.obj.misc;
-
-import me.fatpigsarefat.quests.Quests;
-import me.fatpigsarefat.quests.obj.Options;
-import me.fatpigsarefat.quests.player.QPlayer;
-import me.fatpigsarefat.quests.quests.Category;
-import org.bukkit.Bukkit;
-import org.bukkit.Material;
-import org.bukkit.inventory.Inventory;
-import org.bukkit.inventory.ItemStack;
-
-import java.util.HashMap;
-import java.util.List;
-
-public class QMenuCategory implements QMenu {
-
- private final int pageSize = 45;
- private HashMap<Integer, QMenuQuest> slotsToMenuQuest = new HashMap<>();
- private QPlayer owner;
-
- public QMenuCategory(QPlayer owner) {
- this.owner = owner;
- }
-
- public void populate(List<QMenuQuest> menuQuests) {
- int slot = 0;
- for (QMenuQuest qMenuQuest : menuQuests) {
- slotsToMenuQuest.put(slot, qMenuQuest);
- slot++;
- }
- }
-
- @Override
- public HashMap<Integer, QMenuQuest> getSlotsToMenu() {
- return slotsToMenuQuest;
- }
-
- @Override
- public QPlayer getOwner() {
- return owner;
- }
-
- public Inventory toInventory(int page) {
- int pageMin = pageSize * (page - 1);
- int pageMax = pageSize * page;
- String title = Options.GUITITLE_QUESTS_CATEGORY.getStringValue();
-
- ItemStack pageIs = new ItemStack(Material.DIRT);
-
- Inventory inventory = Bukkit.createInventory(null, 54, title);
-
- for (int pointer = pageMin; pointer < pageMax; pointer++) {
- if (slotsToMenuQuest.containsKey(pointer)) {
- Category category = Quests.getQuestManager().getCategoryById(slotsToMenuQuest.get(pointer).getCategoryName());
- if (category != null) {
- inventory.setItem(pointer, category.getDisplayItem());
- }
- }
- }
-
- inventory.setItem(49, pageIs);
-
- if (Options.TRIM_GUI_SIZE.getBooleanValue() && page == 1) {
- int slotsUsed = 0;
- for (int pointer = 0; pointer < pageMax; pointer++) {
- if (inventory.getItem(pointer) != null) {
- slotsUsed++;
- }
- }
-
- int inventorySize = (slotsUsed >= 54) ? 54 : slotsUsed + (9 - slotsUsed % 9) * Math.min(1, slotsUsed % 9);
- inventorySize = inventorySize <= 0 ? 9 : inventorySize;
- if (inventorySize == 54) {
- return inventory;
- }
-
- Inventory trimmedInventory = Bukkit.createInventory(null, inventorySize, title);
-
- for (int slot = 0; slot < pageMax; slot++) {
- if (slot >= trimmedInventory.getSize()){
- break;
- }
- trimmedInventory.setItem(slot, inventory.getItem(slot));
- }
- return trimmedInventory;
- } else {
- return inventory;
- }
-
- }
-
-}
diff --git a/src/me/fatpigsarefat/quests/obj/misc/QMenuDaily.java b/src/me/fatpigsarefat/quests/obj/misc/QMenuDaily.java
deleted file mode 100644
index 9b50f7ee..00000000
--- a/src/me/fatpigsarefat/quests/obj/misc/QMenuDaily.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package me.fatpigsarefat.quests.obj.misc;
-
-import me.fatpigsarefat.quests.Quests;
-import me.fatpigsarefat.quests.obj.Items;
-import me.fatpigsarefat.quests.obj.Options;
-import me.fatpigsarefat.quests.player.QPlayer;
-import me.fatpigsarefat.quests.player.questprogressfile.QuestProgress;
-import me.fatpigsarefat.quests.quests.Quest;
-import org.bukkit.Bukkit;
-import org.bukkit.inventory.Inventory;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.inventory.meta.ItemMeta;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-public class QMenuDaily implements QMenu {
-
- private HashMap<Integer, String> slotsToQuestIds = new HashMap<>();
- private int backButtonLocation = -1;
- private boolean backButtonEnabled = true;
- private QMenuCategory superMenu;
- private String categoryName;
- private final int pageSize = 45;
- private QPlayer owner;
-
- public QMenuDaily(QPlayer owner, QMenuCategory superMenu) {
- this.owner = owner;
- this.superMenu = superMenu;
- }
-
- public void populate(List<Quest> quests) {
- int slot = 11;
- for (Quest quest : quests) {
- slotsToQuestIds.put(slot, quest.getId());
- slot++;
- if (slot == 16) {
- break;
- }
- }
- }
-
- @Override
- public HashMap<Integer, String> getSlotsToMenu() {
- return slotsToQuestIds;
- }
-
- @Override
- public QPlayer getOwner() {
- return owner;
- }
-
- public String getCategoryName() {
- return categoryName;
- }
-
- public Inventory toInventory(int page) {
- int pageMin = pageSize * (page - 1);
- int pageMax = pageSize * page;
- String title = Options.GUITITLE_DAILY_QUESTS.toString();
-
- Inventory inventory = Bukkit.createInventory(null, 27, title);
-
- //TODO daily quests
-
-// int invSlot = 11;
-// for (int pointer = pageMin; pointer < pageMax; pointer++) {
-// if (slotsToQuestIds.containsKey(pointer)) {
-// Quest quest = Quests.getQuestManager().getQuestById(slotsToQuestIds.get(pointer));
-// QuestProgress questProgress = owner.getQuestProgressFile().getQuestProgress(quest);
-// long cooldown = owner.getQuestProgressFile().getCooldownFor(quest);
-// if (!owner.getQuestProgressFile().hasMetRequirements(quest)) {
-// List<String> quests = new ArrayList<>();
-// for (String requirement : quest.getRequirements()) {
-// quests.add(Quests.getQuestManager().getQuestById(requirement).getDisplayNameStripped());
-// }
-// Map<String, String> placeholders = new HashMap<>();
-// placeholders.put("{quest}", quest.getDisplayNameStripped());
-// placeholders.put("{requirements}", String.join(", ", quests));
-// ItemStack is = replaceItemStack(Items.QUEST_LOCKED.getItem(), placeholders);
-// inventory.setItem(invSlot, is);
-// } else if (!quest.isRepeatable() && questProgress.isCompletedBefore()) {
-// Map<String, String> placeholders = new HashMap<>();
-// placeholders.put("{quest}", quest.getDisplayNameStripped());
-// ItemStack is = replaceItemStack(Items.QUEST_COMPLETED.getItem(), placeholders);
-// inventory.setItem(invSlot, is);
-// } else if (cooldown > 0) {
-// Map<String, String> placeholders = new HashMap<>();
-// placeholders.put("{time}", Quests.convertToFormat(TimeUnit.MINUTES.convert(cooldown, TimeUnit.MILLISECONDS)));
-// placeholders.put("{quest}", quest.getDisplayNameStripped());
-// ItemStack is = replaceItemStack(Items.QUEST_COOLDOWN.getItem(), placeholders);
-// inventory.setItem(invSlot, is);
-// } else {
-// inventory.setItem(invSlot, Quests.getQuestManager().getQuestById(quest.getId()).getDisplayItem().toItemStack(questProgress));
-// }
-// }
-// invSlot++;
-// }
-
- return inventory;
- }
-
- public ItemStack replaceItemStack(ItemStack is, Map<String, String> placeholders) {
- ItemStack newItemStack = is.clone();
- List<String> lore = newItemStack.getItemMeta().getLore();
- List<String> newLore = new ArrayList<>();
- for (String s : lore) {
- for (Map.Entry<String, String> entry : placeholders.entrySet()) {
- s = s.replace(entry.getKey(), entry.getValue());
- }
- newLore.add(s);
- }
- ItemMeta ism = newItemStack.getItemMeta();
- ism.setLore(newLore);
- newItemStack.setItemMeta(ism);
- return newItemStack;
- }
-}
diff --git a/src/me/fatpigsarefat/quests/obj/misc/QMenuQuest.java b/src/me/fatpigsarefat/quests/obj/misc/QMenuQuest.java
deleted file mode 100644
index 50e264e7..00000000
--- a/src/me/fatpigsarefat/quests/obj/misc/QMenuQuest.java
+++ /dev/null
@@ -1,224 +0,0 @@
-package me.fatpigsarefat.quests.obj.misc;
-
-import me.fatpigsarefat.quests.Quests;
-import me.fatpigsarefat.quests.obj.Items;
-import me.fatpigsarefat.quests.obj.Options;
-import me.fatpigsarefat.quests.player.QPlayer;
-import me.fatpigsarefat.quests.player.questprogressfile.QuestProgress;
-import me.fatpigsarefat.quests.quests.Quest;
-import org.bukkit.Bukkit;
-import org.bukkit.inventory.Inventory;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.inventory.meta.ItemMeta;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-public class QMenuQuest implements QMenu {
-
- private HashMap<Integer, String> slotsToQuestIds = new HashMap<>();
- private int backButtonLocation = -1;
- private int pagePrevLocation = -1;
- private int pageNextLocation = -1;
- private int currentPage = -1;
- private boolean backButtonEnabled = true;
- private QMenuCategory superMenu;
- private String categoryName;
- private final int pageSize = 45;
- private QPlayer owner;
-
- public QMenuQuest(QPlayer owner, String categoryName, QMenuCategory superMenu) {
- this.owner = owner;
- this.categoryName = categoryName;
- this.superMenu = superMenu;
- }
-
- public void populate(List<Quest> quests) {
- int slot = 0;
- for (Quest quest : quests) {
- if (Options.GUI_HIDE_LOCKED.getBooleanValue()) {
- QuestProgress questProgress = owner.getQuestProgressFile().getQuestProgress(quest);
- long cooldown = owner.getQuestProgressFile().getCooldownFor(quest);
- if (!owner.getQuestProgressFile().hasMetRequirements(quest) || (!quest.isRepeatable() && questProgress.isCompletedBefore()) || cooldown > 0) {
- continue;
- }
- }
- slotsToQuestIds.put(slot, quest.getId());
- slot++;
- }
- }
-
- @Override
- public HashMap<Integer, String> getSlotsToMenu() {
- return slotsToQuestIds;
- }
-
- @Override
- public QPlayer getOwner() {
- return owner;
- }
-
- public String getCategoryName() {
- return categoryName;
- }
-
- public int getPagePrevLocation() {
- return pagePrevLocation;
- }
-
- public int getPageNextLocation() {
- return pageNextLocation;
- }
-
- public int getCurrentPage() {
- return currentPage;
- }
-
- public int getPageSize() {
- return pageSize;
- }
-
- public Inventory toInventory(int page) {
- currentPage = page;
- int pageMin = pageSize * (page - 1);
- int pageMax = pageSize * page;
- String title = Options.GUITITLE_QUESTS.getStringValue();
-
- ItemStack pageIs;
- ItemStack pagePrevIs;
- ItemStack pageNextIs;
- ItemStack back = Items.BACK_BUTTON.getItem();
-
- Inventory inventory = Bukkit.createInventory(null, 54, title);
-
- int invSlot = 0;
- for (int pointer = pageMin; pointer < pageMax; pointer++) {
- if (slotsToQuestIds.containsKey(pointer)) {
- Quest quest = Quests.getQuestManager().getQuestById(slotsToQuestIds.get(pointer));
- QuestProgress questProgress = owner.getQuestProgressFile().getQuestProgress(quest);
- long cooldown = owner.getQuestProgressFile().getCooldownFor(quest);
- if (!owner.getQuestProgressFile().hasMetRequirements(quest)) {
- List<String> quests = new ArrayList<>();
- for (String requirement : quest.getRequirements()) {
- quests.add(Quests.getQuestManager().getQuestById(requirement).getDisplayNameStripped());
- }
- Map<String, String> placeholders = new HashMap<>();
- placeholders.put("{quest}", quest.getDisplayNameStripped());
- placeholders.put("{requirements}", String.join(", ", quests));
- ItemStack is = replaceItemStack(Items.QUEST_LOCKED.getItem(), placeholders);
- inventory.setItem(invSlot, is);
- } else if (!quest.isRepeatable() && questProgress.isCompletedBefore()) {
- Map<String, String> placeholders = new HashMap<>();
- placeholders.put("{quest}", quest.getDisplayNameStripped());
- ItemStack is = replaceItemStack(Items.QUEST_COMPLETED.getItem(), placeholders);
- inventory.setItem(invSlot, is);
- } else if (cooldown > 0) {
- Map<String, String> placeholders = new HashMap<>();
- placeholders.put("{time}", Quests.convertToFormat(TimeUnit.MINUTES.convert(cooldown, TimeUnit.MILLISECONDS)));
- placeholders.put("{quest}", quest.getDisplayNameStripped());
- ItemStack is = replaceItemStack(Items.QUEST_COOLDOWN.getItem(), placeholders);
- inventory.setItem(invSlot, is);
- } else {
- inventory.setItem(invSlot, Quests.getQuestManager().getQuestById(quest.getId()).getDisplayItem().toItemStack(questProgress));
- }
- }
- invSlot++;
- }
-
- pageNextLocation = -1;
- pagePrevLocation = -1;
-
- Map<String, String> pageplaceholders = new HashMap<>();
- pageplaceholders.put("{prevpage}", String.valueOf(page - 1));
- pageplaceholders.put("{nextpage}", String.valueOf(page + 1));
- pageplaceholders.put("{page}", String.valueOf(page));
- pageIs = replaceItemStack(Items.PAGE_DESCRIPTION.getItem(), pageplaceholders);
- pagePrevIs = replaceItemStack(Items.PAGE_PREV.getItem(), pageplaceholders);
- pageNextIs = replaceItemStack(Items.PAGE_NEXT.getItem(), pageplaceholders);
-
- if (Options.CATEGORIES_ENABLED.getBooleanValue() && backButtonEnabled) {
- inventory.setItem(45, back);
- backButtonLocation = 45;
- }
- if (slotsToQuestIds.size() > pageSize) {
- inventory.setItem(49, pageIs);
- if (page != 1) {
- inventory.setItem(48, pagePrevIs);
- pagePrevLocation = 48;
- }
- if (Math.ceil((double) slotsToQuestIds.size() / ((double) 45)) != page) {
- inventory.setItem(50, pageNextIs);
- pageNextLocation = 50;
- }
- } else if (Options.TRIM_GUI_SIZE.getBooleanValue() && page == 1) {
- int slotsUsed = 0;
- for (int pointer = 0; pointer < pageMax; pointer++) {
- if (inventory.getItem(pointer) != null) {
- slotsUsed++;
- }
- }
-
- int inventorySize = (slotsUsed >= 54) ? 54 : slotsUsed + (9 - slotsUsed % 9) * Math.min(1, slotsUsed % 9);
- inventorySize = inventorySize <= 0 ? 9 : inventorySize;
- if (inventorySize == 54) {
- return inventory;
- } else if (Options.CATEGORIES_ENABLED.getBooleanValue() && backButtonEnabled) {
- inventorySize += 9;
- }
-
- Inventory trimmedInventory = Bukkit.createInventory(null, inventorySize, title);
-
- for (int slot = 0; slot < trimmedInventory.getSize(); slot++) {
- if (slot >= (trimmedInventory.getSize() - 9) && backButtonEnabled){
- if (Options.CATEGORIES_ENABLED.getBooleanValue()) {
- trimmedInventory.setItem(slot, back);
- backButtonLocation = slot;
- }
- break;
- }
- trimmedInventory.setItem(slot, inventory.getItem(slot));
- }
- return trimmedInventory;
- }
-
- return inventory;
- }
-
- public boolean isBackButtonEnabled() {
- return backButtonEnabled;
- }
-
- public void setBackButtonEnabled(boolean backButtonEnabled) {
- this.backButtonEnabled = backButtonEnabled;
- }
-
- public int getBackButtonLocation() {
- return backButtonLocation;
- }
-
- public QMenuCategory getSuperMenu() {
- return superMenu;
- }
-
- public ItemStack replaceItemStack(ItemStack is, Map<String, String> placeholders) {
- ItemStack newItemStack = is.clone();
- List<String> lore = newItemStack.getItemMeta().getLore();
- List<String> newLore = new ArrayList<>();
- ItemMeta ism = newItemStack.getItemMeta();
- if (lore != null) {
- for (String s : lore) {
- for (Map.Entry<String, String> entry : placeholders.entrySet()) {
- s = s.replace(entry.getKey(), entry.getValue());
- ism.setDisplayName(ism.getDisplayName().replace(entry.getKey(), entry.getValue()));
- }
- newLore.add(s);
- }
- }
- ism.setLore(newLore);
- newItemStack.setItemMeta(ism);
- return newItemStack;
- }
-}
diff --git a/src/me/fatpigsarefat/quests/obj/misc/creator/QMenuCreator.java b/src/me/fatpigsarefat/quests/obj/misc/creator/QMenuCreator.java
deleted file mode 100644
index 0436e203..00000000
--- a/src/me/fatpigsarefat/quests/obj/misc/creator/QMenuCreator.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package me.fatpigsarefat.quests.obj.misc.creator;
-
-import me.fatpigsarefat.quests.obj.misc.QMenu;
-import me.fatpigsarefat.quests.player.QPlayer;
-import org.bukkit.Bukkit;
-import org.bukkit.ChatColor;
-import org.bukkit.Material;
-import org.bukkit.inventory.Inventory;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.inventory.meta.ItemMeta;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-public class QMenuCreator implements QMenu {
-
- private QPlayer owner;
-
- public QMenuCreator(QPlayer owner) {
- this.owner = owner;
- }
-
- @Override
- public HashMap<Integer, String> getSlotsToMenu() {
- return null;
- }
-
- @Override
- public QPlayer getOwner() {
- return owner;
- }
-
- public Inventory toInventory(int page) {
- String title = "Quest Creator";
-
- Inventory inventory = Bukkit.createInventory(null, 9, title);
-
- ItemStack newQuest = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 5);
- ItemMeta newQuestM = newQuest.getItemMeta();
- List<String> newQuestL = new ArrayList<>();
- newQuestM.setDisplayName(ChatColor.GREEN.toString() + ChatColor.BOLD + "New Quest");
- newQuestL.add(ChatColor.GRAY + "Click to make a new quest.");
- newQuestM.setLore(newQuestL);
- newQuest.setItemMeta(newQuestM);
-
- ItemStack editQuest = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 1);
- ItemMeta editQuestM = editQuest.getItemMeta();
- List<String> editQuestL = new ArrayList<>();
- editQuestM.setDisplayName(ChatColor.GREEN.toString() + ChatColor.BOLD + "Edit Quest");
- editQuestL.add(ChatColor.GRAY + "Click to edit an existing quest.");
- editQuestM.setLore(editQuestL);
- editQuest.setItemMeta(editQuestM);
-
- ItemStack removeQuest = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 14);
- ItemMeta removeQuestM = removeQuest.getItemMeta();
- List<String> removeQuestL = new ArrayList<>();
- removeQuestM.setDisplayName(ChatColor.GREEN.toString() + ChatColor.BOLD + "Delete Quest");
- removeQuestL.add(ChatColor.GRAY + "Click to delete an existing quest.");
- removeQuestM.setLore(removeQuestL);
- removeQuest.setItemMeta(removeQuestM);
-
- inventory.setItem(2, newQuest);
- inventory.setItem(4, editQuest);
- inventory.setItem(6, removeQuest);
-
- return inventory;
- }
-
-}