Class PlayerQuestsInterface
java.lang.Object
com.ordwen.odailyquests.tools.externals.ExternalItemGetter
com.ordwen.odailyquests.commands.interfaces.playerinterface.items.getters.ItemGetter
com.ordwen.odailyquests.commands.interfaces.playerinterface.items.getters.InterfaceItemGetter
com.ordwen.odailyquests.commands.interfaces.playerinterface.PlayerQuestsInterface
- All Implemented Interfaces:
IInterfaceItem,IItemGetter,IExternalItemGetter
Handles the loading, preparation and dynamic rendering of the player quests interface.
This class is responsible for:
- Parsing the player interface configuration file
- Loading static items (fillers, buttons, command triggers...)
- Assigning quests to inventory slots
- Replacing placeholders dynamically for each player
- Applying custom model data and item model identifiers
- Building the final inventory instance for a specific player
- Executing associated commands when specific items are clicked
- Custom textures (heads)
- Vanilla materials
- Namespaced items (ItemsAdder/Oraxen/etc.)
- PAPI placeholders in name and lore
- Quest progression placeholders: %progress%, %required%, %progressBar%...
playerQuestsInventoryBase, while dynamic quest items
and PAPI-dependent items are merged into a fresh cloned inventory for each player.-
Constructor Summary
ConstructorsConstructorDescriptionPlayerQuestsInterface(PlayerInterfaceFile playerInterfaceFile) Creates a new player quests interface loader. -
Method Summary
Modifier and TypeMethodDescriptionGet the achieved string defined in the configuration.Get the complete get type string defined in the configuration.getConsoleCommands(int slot) Get all console commands that can be executed by the item in the given slot.getInterfaceName(org.bukkit.entity.Player player) Get the corresponding text for the interface name.getPlayerCommands(int slot) Get all player commands that can be executed by the item in the given slot.org.bukkit.inventory.InventorygetPlayerQuestsInterface(org.bukkit.entity.Player player) Builds and returns the complete, fully-rendered quests inventory for a specific player.Get the status string defined in the configuration.booleanisCloseItem(org.bukkit.inventory.ItemStack itemStack) Check if the item is used to close the inventory.booleanisConsoleCommandItem(int slot) Check if the item is used to execute a command as a console.booleanisFillItem(org.bukkit.inventory.ItemStack itemStack) Check if the item is used to fill the inventory.booleanisPlayerCommandItem(int slot) Check if the item is used to execute a command as a player.voidload()Loads and parses the entire player interface definition.Methods inherited from class com.ordwen.odailyquests.commands.interfaces.playerinterface.items.getters.InterfaceItemGetter
configurationError, getCustomHead, getCustomModelDataItem, getItem, getItemsAdderItem, getMMOItemsItem, getNexoItem, getOraxenItemMethods inherited from class com.ordwen.odailyquests.commands.interfaces.playerinterface.items.getters.ItemGetter
getCustomModelDataItemMethods inherited from class com.ordwen.odailyquests.tools.externals.ExternalItemGetter
getCustomHead, getItemsAdderItem, getMMOItemsItem, getNexoItem, getOraxenItem
-
Constructor Details
-
PlayerQuestsInterface
Creates a new player quests interface loader.- Parameters:
playerInterfaceFile- the configuration file defining layout, items and settings
-
-
Method Details
-
load
public void load()Loads and parses the entire player interface definition.This method:
- Reads global variables
- Loads the mapping between quests and interface slots
- Loads static items (fillers, buttons, command items...)
- Handles item models, flags, names and lore
-
getPlayerQuestsInterface
public org.bukkit.inventory.Inventory getPlayerQuestsInterface(org.bukkit.entity.Player player) Builds and returns the complete, fully-rendered quests inventory for a specific player.The returned inventory:
- Starts from the static base inventory
- Applies dynamic placeholders on PAPI-enabled items
- Injects the player's head (if configured)
- Places quest items depending on progression
- Parameters:
player- the player for whom the inventory is generated- Returns:
- the final rendered inventory, or
nullif generation failed
-
getInterfaceName
Get the corresponding text for the interface name.- Parameters:
player- player to get the interface name.- Returns:
- the interface name.
-
isFillItem
public boolean isFillItem(org.bukkit.inventory.ItemStack itemStack) Check if the item is used to fill the inventory.- Parameters:
itemStack- item to check.- Returns:
- true if the item is used to fill the inventory, false otherwise.
-
isCloseItem
public boolean isCloseItem(org.bukkit.inventory.ItemStack itemStack) Check if the item is used to close the inventory.- Parameters:
itemStack- item to check.- Returns:
- true if the item is used to close the inventory, false otherwise.
-
isPlayerCommandItem
public boolean isPlayerCommandItem(int slot) Check if the item is used to execute a command as a player.- Parameters:
slot- slot of the item.- Returns:
- true if the item is used to execute a player command, false otherwise.
-
isConsoleCommandItem
public boolean isConsoleCommandItem(int slot) Check if the item is used to execute a command as a console.- Parameters:
slot- slot of the item.- Returns:
- true if the item is used to execute a console command, false otherwise.
-
getPlayerCommands
Get all player commands that can be executed by the item in the given slot.- Parameters:
slot- slot of the item.- Returns:
- the player commands of the item.
-
getConsoleCommands
Get all console commands that can be executed by the item in the given slot.- Parameters:
slot- slot of the item.- Returns:
- the console commands of the item.
-
getAchievedStr
Get the achieved string defined in the configuration.- Returns:
- the achieved string.
-
getProgressStr
Get the status string defined in the configuration.- Returns:
- the status string.
-
getCompleteGetTypeStr
Get the complete get type string defined in the configuration.- Returns:
- the complete get type string.
-