public class CraftingMenu extends java.lang.Object implements WauzInventory
CraftingConfigurator
Modifier and Type | Field and Description |
---|---|
private static int |
MAX_PAGE
The last page index of the craftable item list.
|
private static int |
MIN_PAGE
The first page index of the craftable item list.
|
Constructor and Description |
---|
CraftingMenu() |
Modifier and Type | Method and Description |
---|---|
static void |
generateRecipe(org.bukkit.inventory.Inventory menu,
org.bukkit.entity.Player player,
java.lang.Integer playerCraftingLevel,
int itemIndex,
int baseIndex)
Creates a recipe to show in the given menu.
|
java.util.List<WauzMode> |
getGamemodes() |
private static int |
getIndex(org.bukkit.inventory.InventoryView inventory)
Gets the page index from the title of the given crafting inventory.
|
java.lang.String |
getInventoryId() |
static void |
getLocked(org.bukkit.inventory.Inventory menu,
int level,
int itemIndex,
int baseIndex)
Creates a locked recipe to show in the given menu.
|
static void |
listRecipes(org.bukkit.entity.Player player,
int page)
Opens the menu for the given player.
|
static void |
open(org.bukkit.entity.Player player)
Opens the menu for the given player.
|
void |
openInstance(org.bukkit.entity.Player player)
Opens a new inventory of this type 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.
|
private void |
tryToCraftItem(org.bukkit.inventory.ItemStack clicked,
org.bukkit.entity.Player player)
Tries to craft the given item.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroyInventory
private static final int MIN_PAGE
private static final int MAX_PAGE
public java.lang.String getInventoryId()
getInventoryId
in interface WauzInventory
public java.util.List<WauzMode> getGamemodes()
getGamemodes
in interface WauzInventory
public void openInstance(org.bukkit.entity.Player player)
openInstance
in interface WauzInventory
player
- The player that should view the inventory.public static void open(org.bukkit.entity.Player player)
player
- The player that should view the inventory.public static void listRecipes(org.bukkit.entity.Player player, int page)
player
- The player that should view the inventory.page
- The page index of the craftable item list.generateRecipe(Inventory, Player, Integer, int, int)
public static void generateRecipe(org.bukkit.inventory.Inventory menu, org.bukkit.entity.Player player, java.lang.Integer playerCraftingLevel, int itemIndex, int baseIndex)
menu
- The menu that should display the recipe.player
- The player that should view the inventory.playerCraftingLevel
- The crafting skill level of the player.itemIndex
- The item index in the crafting config.baseIndex
- The item index as shown in the menu.CraftingConfigurator
,
getLocked(Inventory, int, int, int)
,
WauzDebugger.toggleCraftingDebugMode(Player)
public static void getLocked(org.bukkit.inventory.Inventory menu, int level, int itemIndex, int baseIndex)
menu
- The menu that should display the locked recipe.level
- The level needed to unlock the recipe.itemIndex
- The item index in the crafting config.baseIndex
- The item index as shown in the menu.public void selectMenuPoint(org.bukkit.event.inventory.InventoryClickEvent event)
selectMenuPoint
in interface WauzInventory
event
- The inventory click event.CraftingConfigurator
,
open(Player)
,
listRecipes(Player, int)
,
tryToCraftItem(ItemStack, Player)
,
PlayerSkillConfigurator.increaseCraftingSkill(Player)
,
WauzDebugger.toggleCraftingDebugMode(Player)
private void tryToCraftItem(org.bukkit.inventory.ItemStack clicked, org.bukkit.entity.Player player)
clicked
- The item that should be crafted.player
- The player crafting the item.selectMenuPoint(InventoryClickEvent)
private static int getIndex(org.bukkit.inventory.InventoryView inventory)
inventory
- The inventory to fetch the page index from.