Package dev.aurelium.auraskills.api.item
Class ItemContext.ItemContextBuilder
java.lang.Object
dev.aurelium.auraskills.api.item.ItemContext.ItemContextBuilder
- Enclosing class:
- ItemContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the context.Defines the context group this context is part of.Defines the base material of the context item.order
(int order) Defines the order within the context group this context is part of.Defines the exact position/slot of the context in the menu.Adds any custom key-value pair to the context in order to specify special item metas like enchantments, nbt, etc.
-
Constructor Details
-
ItemContextBuilder
public ItemContextBuilder()
-
-
Method Details
-
material
Defines the base material of the context item. This should be a valid Minecraft item name such as diamond_block.- Parameters:
material
- the material- Returns:
- the builder
-
pos
Defines the exact position/slot of the context in the menu. Two formats are possible: 1. A comma-separated "row,column" format where the row and columns start at 0,0 at the top left of the menu. 2. A single integer (as a String) that defines the slot number from 0-54 going left to right, top to bottom.- Parameters:
pos
- the pos value in either format- Returns:
- the builder
-
group
Defines the context group this context is part of. Together withorder
, it is an alternative to specifying a staticpos
. When a group and order is specified, items are positioned within the rectangle created by the start and end of the group defined in the menu configuration file and positioned based on their order and align.- Parameters:
group
- the group name as defined in the menu file- Returns:
- the builder
-
order
Defines the order within the context group this context is part of. You must also usegroup
to define the group name. Lower order numbers will be positioned to the left and top of contexts with higher order numbers but the exact position is based on the "align" of the group.- Parameters:
order
- the order of the context- Returns:
- the builder
-
set
Adds any custom key-value pair to the context in order to specify special item metas like enchantments, nbt, etc.- Parameters:
key
- the key of the entry to set, should be a valid Slate menu file item context keyvalue
- the value of the entry- Returns:
- the builder
-
build
Builds the context.- Returns:
- the context
-