public class QuestRewardChooser extends java.lang.Object implements WauzInventory
WauzQuest
Modifier and Type | Field and Description |
---|---|
private org.bukkit.inventory.Inventory |
choiceDialog
The inventory instance to hold the selectable choices.
|
private java.lang.Integer |
chosenRewardIndex
The index of the chosen reward item stack.
|
private WauzPlayerEventQuestComplete |
completeEvent
The complete event to execute.
|
private WauzQuest |
quest
The quest that has been completed.
|
Constructor and Description |
---|
QuestRewardChooser(WauzQuest quest,
WauzPlayerEventQuestComplete completeEvent)
Creates a new chooser with an event to execute after the choice was made.
|
Modifier and Type | Method and Description |
---|---|
private static org.bukkit.inventory.ItemStack |
generateUnavailableChoiceItem(int itemNumber)
Generates an item stack, displaying an unavailable choice.
|
java.lang.String |
getInventoryId() |
private static boolean |
isRewardChoice(org.bukkit.inventory.ItemStack itemStack)
Checks if an item stack is a reward choice, by looking for the prefix.
|
private static org.bukkit.inventory.ItemStack |
makeRewardChoice(org.bukkit.inventory.ItemStack choiceItemStack)
Transforms an item stack into a reward choice, by adding a prefix to it.
|
static void |
open(org.bukkit.entity.Player player,
WauzQuest quest,
WauzPlayerEventQuestComplete completeEvent)
Opens the menu for the given player.
|
void |
selectMenuPoint(org.bukkit.event.inventory.InventoryClickEvent event)
Checks if an event in this inventory was triggered by a player click.
|
void |
setChoiceDialog(org.bukkit.inventory.Inventory choiceDialog) |
void |
updateChoiceSelection()
Updates the selection of the reward.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroyInventory, getGamemodes, openInstance
private WauzQuest quest
private WauzPlayerEventQuestComplete completeEvent
private org.bukkit.inventory.Inventory choiceDialog
private java.lang.Integer chosenRewardIndex
public QuestRewardChooser(WauzQuest quest, WauzPlayerEventQuestComplete completeEvent)
quest
- The quest that has been completed.completeEvent
- The complete event to execute.public java.lang.String getInventoryId()
getInventoryId
in interface WauzInventory
public static void open(org.bukkit.entity.Player player, WauzQuest quest, WauzPlayerEventQuestComplete completeEvent)
player
- The player that should view the inventory.quest
- The quest that has been completed.completeEvent
- The complete event to execute.private static org.bukkit.inventory.ItemStack generateUnavailableChoiceItem(int itemNumber)
itemNumber
- The number in the title.private static org.bukkit.inventory.ItemStack makeRewardChoice(org.bukkit.inventory.ItemStack choiceItemStack)
choiceItemStack
- The item stack to transform.private static boolean isRewardChoice(org.bukkit.inventory.ItemStack itemStack)
itemStack
- The item stack to check.public void selectMenuPoint(org.bukkit.event.inventory.InventoryClickEvent event)
selectMenuPoint
in interface WauzInventory
event
- The inventory click event.WauzPlayerEventQuestComplete.execute(Player)
public void updateChoiceSelection()
public void setChoiceDialog(org.bukkit.inventory.Inventory choiceDialog)
choiceDialog
- The new inventory instance to hold the selectable choices.