Package net.storm.api.items.loadouts
Interface LoadoutBuilder
public interface LoadoutBuilder
A builder for creating
Loadout configurations.
This interface provides a fluent API for constructing loadouts with specific items in inventory, equipment, and rune pouch slots. The builder supports:
- Adding individual items with full configuration options
- Adding multiple items at once
- Convenience methods for common item types
- Disabling specific sections of the loadout
Example usage:
Loadout loadout = factory.newBuilder()
.equipmentItem(ItemID.DRAGON_SCIMITAR, EquipmentInventorySlot.WEAPON.getSlotIdx())
.inventoryItem(ItemID.SHARK, 10, 0)
.inventoryItem(ItemID.SUPER_COMBAT_POTION4, 1, 10)
.build();
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns the configured loadout.Disables the equipment section of this loadout.Disables the inventory section of this loadout.Disables the rune pouch section of this loadout.equipmentItem(int id, int slot) Adds a single equipment item (quantity 1).equipmentItem(int id, int quantity, boolean isStackable, int slot) Adds an equipment item with stackable flag.equipmentItem(int id, int quantity, int slot) Adds an equipment item with quantity.equipmentItem(int id, int quantity, int maxQuantity, boolean isStackable, int slot) Adds an equipment item with quantity range and stackable flag.equipmentItem(int id, int quantity, int maxQuantity, int slot) Adds an equipment item with quantity range.Gets the current equipment items in the builder.Gets the current inventory items in the builder.Gets the current rune pouch items in the builder.inventoryItem(int id, int slot) Adds a single inventory item (quantity 1).inventoryItem(int id, int quantity, boolean isStackable, boolean isNoted, int slot) Adds an inventory item with full configuration.inventoryItem(int id, int quantity, boolean isStackable, int slot) Adds an inventory item with stackable flag.inventoryItem(int id, int quantity, int slot) Adds an inventory item with default settings (non-stackable, non-noted).inventoryItem(int id, int quantity, int maxQuantity, boolean isStackable, boolean isNoted, int slot) Adds an inventory item with quantity range and full configuration.inventoryItem(int id, int quantity, int maxQuantity, boolean isStackable, int slot) Adds an inventory item with quantity range and stackable flag.inventoryItem(int id, int quantity, int maxQuantity, int slot) Adds an inventory item with quantity range and default settings.item(int id, boolean isStackable, LoadoutItem.Type type, int slot) Adds a single item with stackable flag.item(int id, int quantity, boolean stackable, boolean noted, LoadoutItem.Type type, int slot) Adds an item with full configuration options.item(int id, int quantity, boolean isStackable, LoadoutItem.Type type, int slot) Adds an item with stackable flag and no noted form.item(int id, int quantity, int maxQuantity, boolean stackable, boolean noted, LoadoutItem.Type type, int slot) Adds an item with full configuration options including maximum quantity.item(int id, int quantity, int maxQuantity, boolean isStackable, LoadoutItem.Type type, int slot) Adds an item with stackable flag, maximum quantity, and no noted form.item(int id, int quantity, int maxQuantity, LoadoutItem.Type type, int slot) Adds an item with quantity range, assuming non-stackable and non-noted.item(int id, int quantity, LoadoutItem.Type type, int slot) Adds an item with quantity, assuming non-stackable and non-noted.item(int id, LoadoutItem.Type type, int slot) Adds a single item (quantity 1) with default settings.item(LoadoutItem item) Adds a pre-configured loadout item.items(Collection<LoadoutItem> items) Adds a collection of pre-configured loadout items.items(LoadoutItem... items) Adds multiple pre-configured loadout items.runePouchItem(int id, int quantity, int slot) Adds a rune to the rune pouch.runePouchItem(int id, int quantity, int maxQuantity, int slot) Adds a rune to the rune pouch with quantity range.
-
Method Details
-
getInventory
LoadoutItem[] getInventory()Gets the current inventory items in the builder.- Returns:
- an array of inventory
LoadoutItems
-
getEquipment
LoadoutItem[] getEquipment()Gets the current equipment items in the builder.- Returns:
- an array of equipment
LoadoutItems
-
getRunePouch
LoadoutItem[] getRunePouch()Gets the current rune pouch items in the builder.- Returns:
- an array of rune pouch
LoadoutItems
-
item
LoadoutBuilder item(int id, int quantity, boolean stackable, boolean noted, LoadoutItem.Type type, int slot) Adds an item with full configuration options.- Parameters:
id- the item IDquantity- the required quantitystackable- whether the item is stackablenoted- whether the item should be notedtype- the item type (inventory, equipment, or rune pouch)slot- the slot index within the container- Returns:
- this builder for method chaining
-
item
LoadoutBuilder item(int id, int quantity, int maxQuantity, boolean stackable, boolean noted, LoadoutItem.Type type, int slot) Adds an item with full configuration options including maximum quantity.- Parameters:
id- the item IDquantity- the minimum required quantitymaxQuantity- the maximum quantity to withdrawstackable- whether the item is stackablenoted- whether the item should be notedtype- the item type (inventory, equipment, or rune pouch)slot- the slot index within the container- Returns:
- this builder for method chaining
-
item
Adds a pre-configured loadout item.- Parameters:
item- the loadout item to add- Returns:
- this builder for method chaining
-
items
Adds multiple pre-configured loadout items.- Parameters:
items- the loadout items to add- Returns:
- this builder for method chaining
-
items
Adds a collection of pre-configured loadout items.- Parameters:
items- the collection of loadout items to add- Returns:
- this builder for method chaining
-
item
Adds an item with stackable flag and no noted form.- Parameters:
id- the item IDquantity- the required quantityisStackable- whether the item is stackabletype- the item typeslot- the slot index- Returns:
- this builder for method chaining
-
item
LoadoutBuilder item(int id, int quantity, int maxQuantity, boolean isStackable, LoadoutItem.Type type, int slot) Adds an item with stackable flag, maximum quantity, and no noted form.- Parameters:
id- the item IDquantity- the minimum required quantitymaxQuantity- the maximum quantity to withdrawisStackable- whether the item is stackabletype- the item typeslot- the slot index- Returns:
- this builder for method chaining
-
item
Adds an item with quantity, assuming non-stackable and non-noted.- Parameters:
id- the item IDquantity- the required quantitytype- the item typeslot- the slot index- Returns:
- this builder for method chaining
-
item
Adds an item with quantity range, assuming non-stackable and non-noted.- Parameters:
id- the item IDquantity- the minimum required quantitymaxQuantity- the maximum quantity to withdrawtype- the item typeslot- the slot index- Returns:
- this builder for method chaining
-
item
Adds a single item (quantity 1) with default settings.- Parameters:
id- the item IDtype- the item typeslot- the slot index- Returns:
- this builder for method chaining
-
item
Adds a single item with stackable flag.- Parameters:
id- the item IDisStackable- whether the item is stackabletype- the item typeslot- the slot index- Returns:
- this builder for method chaining
-
inventoryItem
Adds an inventory item with full configuration.- Parameters:
id- the item IDquantity- the required quantityisStackable- whether the item is stackableisNoted- whether the item should be notedslot- the inventory slot (0-27)- Returns:
- this builder for method chaining
-
inventoryItem
LoadoutBuilder inventoryItem(int id, int quantity, int maxQuantity, boolean isStackable, boolean isNoted, int slot) Adds an inventory item with quantity range and full configuration.- Parameters:
id- the item IDquantity- the minimum required quantitymaxQuantity- the maximum quantity to withdrawisStackable- whether the item is stackableisNoted- whether the item should be notedslot- the inventory slot (0-27)- Returns:
- this builder for method chaining
-
inventoryItem
Adds an inventory item with stackable flag.- Parameters:
id- the item IDquantity- the required quantityisStackable- whether the item is stackableslot- the inventory slot (0-27)- Returns:
- this builder for method chaining
-
inventoryItem
Adds an inventory item with quantity range and stackable flag.- Parameters:
id- the item IDquantity- the minimum required quantitymaxQuantity- the maximum quantity to withdrawisStackable- whether the item is stackableslot- the inventory slot (0-27)- Returns:
- this builder for method chaining
-
inventoryItem
Adds an inventory item with default settings (non-stackable, non-noted).- Parameters:
id- the item IDquantity- the required quantityslot- the inventory slot (0-27)- Returns:
- this builder for method chaining
-
inventoryItem
Adds an inventory item with quantity range and default settings.- Parameters:
id- the item IDquantity- the minimum required quantitymaxQuantity- the maximum quantity to withdrawslot- the inventory slot (0-27)- Returns:
- this builder for method chaining
-
inventoryItem
Adds a single inventory item (quantity 1).- Parameters:
id- the item IDslot- the inventory slot (0-27)- Returns:
- this builder for method chaining
-
equipmentItem
Adds an equipment item with stackable flag.- Parameters:
id- the item IDquantity- the required quantity (for stackable equipment like arrows)isStackable- whether the item is stackableslot- the equipment slot index- Returns:
- this builder for method chaining
-
equipmentItem
Adds an equipment item with quantity range and stackable flag.- Parameters:
id- the item IDquantity- the minimum required quantitymaxQuantity- the maximum quantity to withdrawisStackable- whether the item is stackableslot- the equipment slot index- Returns:
- this builder for method chaining
-
equipmentItem
Adds an equipment item with quantity.- Parameters:
id- the item IDquantity- the required quantityslot- the equipment slot index- Returns:
- this builder for method chaining
-
equipmentItem
Adds an equipment item with quantity range.- Parameters:
id- the item IDquantity- the minimum required quantitymaxQuantity- the maximum quantity to withdrawslot- the equipment slot index- Returns:
- this builder for method chaining
-
equipmentItem
Adds a single equipment item (quantity 1).- Parameters:
id- the item IDslot- the equipment slot index- Returns:
- this builder for method chaining
-
runePouchItem
Adds a rune to the rune pouch.- Parameters:
id- the rune item IDquantity- the required quantityslot- the rune pouch slot (0-3)- Returns:
- this builder for method chaining
-
runePouchItem
Adds a rune to the rune pouch with quantity range.- Parameters:
id- the rune item IDquantity- the minimum required quantitymaxQuantity- the maximum quantity to storeslot- the rune pouch slot (0-3)- Returns:
- this builder for method chaining
-
disableInventory
LoadoutBuilder disableInventory()Disables the inventory section of this loadout.When disabled, inventory items will not be checked or fetched when using this loadout.
- Returns:
- this builder for method chaining
-
disableEquipment
LoadoutBuilder disableEquipment()Disables the equipment section of this loadout.When disabled, equipment items will not be checked or fetched when using this loadout.
- Returns:
- this builder for method chaining
-
disableRunePouch
LoadoutBuilder disableRunePouch()Disables the rune pouch section of this loadout.When disabled, rune pouch items will not be checked or fetched when using this loadout.
- Returns:
- this builder for method chaining
-
build
Loadout build()Builds and returns the configured loadout.- Returns:
- the constructed
Loadout
-