### Demonstrate IntelligentItem Types Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Shows how to create and set different types of IntelligentItems: empty, ignored, and clickable. Includes examples with permission checks for visibility and clicking. ```java import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.IntelligentItemError; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; public void demonstrateIntelligentItems(InventoryContents contents, Player player) { // Empty item - visible but no interaction IntelligentItem emptyItem = IntelligentItem.empty(new ItemStack(Material.STONE)); contents.set(0, emptyItem); // Ignored item - player can take/move this item IntelligentItem ignoredItem = IntelligentItem.ignored(new ItemStack(Material.GOLD_INGOT)); contents.set(1, ignoredItem); // Interactive item with click consumer IntelligentItem clickableItem = IntelligentItem.of(new ItemStack(Material.EMERALD), event -> { Player clicker = (Player) event.getWhoClicked(); clicker.sendMessage("Slot clicked: " + event.getSlot()); }); contents.set(2, clickableItem); // Item with permission check for visibility IntelligentItem permissionItem = IntelligentItem.of(new ItemStack(Material.DIAMOND_SWORD)) .canSee(() -> player.hasPermission("inventory.view.sword")) .error(new IntelligentItemError() { @Override public void cantSee(Player player) { player.sendMessage("You don't have permission to see this item!"); } @Override public void cantClick(Player player) { player.sendMessage("You don't have permission to use this item!"); } }); contents.set(3, permissionItem); // Item with permission check for clicking IntelligentItem clickPermItem = IntelligentItem.of(new ItemStack(Material.BOW), event -> { player.sendMessage("Bow equipped!"); }).canClick(() -> player.hasPermission("inventory.use.bow")); contents.set(4, clickPermItem); } ``` -------------------------------- ### Retrieve Inventories with InventoryManager Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Demonstrates how to get inventories by their unique identifier or by the player's UUID. It also shows how to retrieve the currently open inventory for a player and their current page in a paginated inventory. ```java import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.pagination.InventoryManager; import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory; import org.bukkit.entity.Player; import java.util.Optional; import java.util.UUID; public void demonstrateManager(InventoryManager manager, Player player) { // Get inventory by identifier Optional inventory = manager.getInventory("my-inventory"); inventory.ifPresent(inv -> inv.open(player)); // Get player's currently open inventory Optional playerInventory = manager.getInventory(player.getUniqueId()); playerInventory.ifPresent(inv -> { System.out.println("Player has inventory open: " + inv.getProvider()); }); // Get inventory contents for a player Optional contents = manager.getContents(player.getUniqueId()); contents.ifPresent(c -> { int currentPage = c.pagination().page(); System.out.println("Player is on page: " + currentPage); }); } ``` -------------------------------- ### Create Slide Animation Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Use SlideAnimation.builder to create custom slide animations for inventory items. Configure starting and ending slots, item, delay, period, and direction. The blockClickEvent() method prevents player interaction during the animation. ```java import io.github.rysefoxx.inventory.plugin.animator.SlideAnimation; import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.content.InventoryProvider; import io.github.rysefoxx.inventory.plugin.enums.AnimatorDirection; import io.github.rysefoxx.inventory.plugin.enums.TimeSetting; import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; public void createSlideAnimation(Player player, JavaPlugin plugin) { SlideAnimation slideAnimation = SlideAnimation.builder(plugin) .from(0) // Starting slot .to(8) // Ending slot .item(IntelligentItem.empty(new ItemStack(Material.DIAMOND))) .delay(500, TimeSetting.MILLISECONDS) .period(100, TimeSetting.MILLISECONDS) .direction(AnimatorDirection.HORIZONTAL_LEFT_RIGHT) .blockClickEvent() // Prevent clicks during animation .build(); RyseInventory inventory = RyseInventory.builder() .title("Slide Animation Demo") .rows(3) .animation(slideAnimation) .provider(new InventoryProvider() { @Override public void init(Player player, InventoryContents contents, SlideAnimation animation) { animation.animate(contents); } }) .build(plugin); inventory.open(player); } ``` -------------------------------- ### Configure RyseInventory Builder Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Demonstrates the full range of builder configuration options for timing, behavior, and inventory structure. ```java import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.content.InventoryProvider; import io.github.rysefoxx.inventory.plugin.enums.CloseReason; import io.github.rysefoxx.inventory.plugin.enums.InventoryOpenerType; import io.github.rysefoxx.inventory.plugin.enums.TimeSetting; import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; public void createFullyConfiguredInventory(Player player, JavaPlugin plugin) { RyseInventory inventory = RyseInventory.builder() .title("Configured Inventory") .rows(6) .type(InventoryOpenerType.CHEST) // CHEST, HOPPER, DISPENSER, DROPPER, etc. .identifier("my-inventory") // Retrieve later via manager .delay(2, TimeSetting.SECONDS) // Scheduler start delay .period(1, TimeSetting.SECONDS) // Scheduler tick interval .openDelay(1, TimeSetting.SECONDS)// Delay before opening .closeAfter(60, TimeSetting.SECONDS)// Auto-close after 60 seconds .loadDelay(2, TimeSetting.SECONDS)// Delay before loading content .loadTitle(2, TimeSetting.SECONDS)// Delay before showing real title .titleHolder("Loading...") // Placeholder title during loadTitle .preventClose() // Cannot close inventory .preventTransferData() // Don't transfer cached data between pages .clearAndSafe() // Clear player inventory while open .ignoreClickEvent() // Ignore all click events .ignoredSlots(0, 1, 2) // Allow player interaction in these slots .fixedPageSize(5) // Always have 5 pages available .close(CloseReason.PLAYER) // Auto-close on player action .disableUpdateTask() // Don't run update scheduler .provider(new InventoryProvider() { @Override public void init(Player player, InventoryContents contents) { // Setup content } @Override public void update(Player player, InventoryContents contents) { // Called each period (when updateTask enabled) } }) .build(plugin); inventory.open(player); } ``` -------------------------------- ### Create Basic Inventory with RyseInventory.builder() Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Use the builder pattern to construct inventories with customizable rows, title, and content provider. Required methods include `rows()` or `size()`, `title()`, `provider()`, and `build()`. ```java import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.content.InventoryProvider; import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; public void createBasicInventory(Player player, JavaPlugin plugin) { RyseInventory inventory = RyseInventory.builder() .title("My Custom Inventory") .rows(3) // 3 rows = 27 slots; alternatively use .size(27) .disableUpdateTask() // Disable if not using update() method .provider(new InventoryProvider() { @Override public void init(Player player, InventoryContents contents) { // Empty item - no click action contents.set(0, IntelligentItem.empty(new ItemStack(Material.STONE))); // Ignored item - can be taken from inventory contents.set(1, IntelligentItem.ignored(new ItemStack(Material.DIAMOND))); // Interactive item - executes on click contents.set(2, IntelligentItem.of(new ItemStack(Material.EMERALD), event -> { event.getWhoClicked().sendMessage("You clicked the emerald!"); })); } @Override public void update(Player player, InventoryContents contents) { // Called periodically when updateTask is enabled } }) .build(plugin); // Open the inventory for the player inventory.open(player); } ``` -------------------------------- ### Open Inventory with Predefined Properties Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Pass initial data to an inventory when opening it. Data is accessible via InventoryContents properties. Supports opening with key-value arrays or a Map. ```java import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.content.InventoryProvider; import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import java.util.HashMap; import java.util.Map; public void openWithData(Player player, JavaPlugin plugin) { RyseInventory inventory = RyseInventory.builder() .title("Data Inventory") .rows(3) .provider(new InventoryProvider() { @Override public void init(Player player, InventoryContents contents) { // Retrieve passed data String shopType = contents.getProperty("shop-type"); int playerCoins = contents.getProperty("coins", 0); player.sendMessage("Opening " + shopType + " shop with " + playerCoins + " coins"); // Store data for later use contents.setProperty("items-purchased", 0); } }) .build(plugin); // Open with key-value arrays inventory.open(player, new String[]{"shop-type", "coins"}, new Object[]{"weapons", 500}); // Or open with a Map Map data = new HashMap<>(); data.put("shop-type", "armor"); data.put("coins", 1000); inventory.open(player, data); } ``` -------------------------------- ### Configure Open Delay Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Sets the delay in seconds before the inventory is opened. ```java #openDelay(10) ``` -------------------------------- ### Set Inventory Options Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Applies specific configuration options to the inventory. ```java #options(InventoryOptions.NO_DAMAGE) ``` -------------------------------- ### Set Placeholder Title Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Defines a temporary title to be displayed before the final title loads. ```java #titleHolder("Placeholder Title") ``` -------------------------------- ### Create Paginated Inventory Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Configures a multi-page inventory with automatic item distribution and navigation buttons. Requires an InventoryProvider implementation and a defined SlotIterator. ```java import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.content.InventoryProvider; import io.github.rysefoxx.inventory.plugin.pagination.Pagination; import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory; import io.github.rysefoxx.inventory.plugin.pagination.SlotIterator; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import java.util.Arrays; public void createPaginatedInventory(Player player, JavaPlugin plugin) { RyseInventory inventory = RyseInventory.builder() .title("Paginated Inventory") .rows(6) .disableUpdateTask() .provider(new InventoryProvider() { @Override public void init(Player player, InventoryContents contents) { Pagination pagination = contents.pagination(); // Set items per page pagination.setItemsPerPage(10); // Define where items should be placed with SlotIterator pagination.iterator(SlotIterator.builder() .startPosition(1, 1) // Row 1, Column 1 (slot 10) .type(SlotIterator.SlotIteratorType.HORIZONTAL) .blackList(Arrays.asList(25, 26, 27, 28)) // Skip these slots .build()); // Add items to pagination (auto-distributed across pages) for (int i = 0; i < 50; i++) { final int index = i; pagination.addItem(IntelligentItem.of(new ItemStack(Material.STONE), event -> { player.sendMessage("Clicked item #" + index); })); } // Previous page button contents.set(5, 3, IntelligentItem.of( new ItemStack(pagination.isFirst() ? Material.BARRIER : Material.ARROW), event -> { if (pagination.isFirst()) { player.sendMessage("Already on first page!"); return; } pagination.inventory().open(player, pagination.previous().page()); })); // Next page button contents.set(5, 5, IntelligentItem.of( new ItemStack(pagination.isLast() ? Material.BARRIER : Material.ARROW), event -> { if (pagination.isLast()) { player.sendMessage("Already on last page!"); return; } pagination.inventory().open(player, pagination.next().page()); })); } }) .build(plugin); inventory.open(player); } ``` -------------------------------- ### Inventory Slide Animation Methods Source: https://github.com/rysefoxx/ryseinventory/wiki/Animation Methods available for configuring slide animations in the RyseInventory builder. ```java #from(0) ``` ```java #to(7) ``` ```java #item(IntelligentItem.empty(new ItemStack(Material.GRANITE)) ``` ```java #direction(AnimatorDirection.HORIZONTAL_RIGHT_LEFT) ``` ```java #delay(5, TimeSetting.SECONDS) ``` ```java #period(1, TimeSetting.SECONDS) ``` ```java #blockClickEvent() ``` ```java #copy(Other SlideAnimation) ``` -------------------------------- ### Define Inventory Layouts with ContentPattern Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Use ContentPattern to map characters to specific items across a grid layout. ```java import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.pattern.ContentPattern; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; public void useContentPattern(InventoryContents contents) { ContentPattern pattern = contents.contentPattern(); // Define the pattern (6 rows x 9 columns for a 54-slot inventory) pattern.define( "XXXXXXXXX", "XOOOOOOOX", "XXXXOXXXX", "XXXXOXXXX", "XXXXOXXXX", "XXXXOXXXX" ); // Map characters to items pattern.set('X', IntelligentItem.empty(new ItemStack(Material.BLACK_STAINED_GLASS_PANE))); pattern.set('O', IntelligentItem.of(new ItemStack(Material.STONE), event -> { event.getWhoClicked().sendMessage("Clicked stone in pattern!"); })); } ``` -------------------------------- ### InventoryOptions Configuration Source: https://github.com/rysefoxx/ryseinventory/wiki/Inventory-options Defines the available options that can be passed to the #options(InventoryOptions) function to modify player behavior while an inventory is active. ```APIDOC ## InventoryOptions Configuration ### Description Apply specific restrictions to a player while they have a custom inventory open using the #options(InventoryOptions) function. ### Available Options | Option | Description | | :--- | :--- | | NO_DAMAGE | Player will not receive any damage while the inventory is open. | | NO_ITEM_PICKUP | Player cannot pick up items while the inventory is open. | | NO_POTION_EFFECT | Player will not receive any potion effects while the inventory is open. | | NO_BLOCK_BREAK | The block under the player cannot be dismantled while the inventory is open. | | NO_HUNGER | Player will not get hungry while the inventory is open. | ``` -------------------------------- ### Inventory Configuration Functions Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder This section details various functions used to configure and customize inventory behavior, such as setting dimensions, titles, and event handling. ```APIDOC ## Inventory Configuration Functions ### Description Functions for setting inventory properties like size, title, and event handling. ### Functions - **#rows(int)**: Sets the number of rows for the inventory. Maximum is 6. - Example: `#rows(1)` - **#size(int)**: Sets the total size of the inventory, equivalent to rows * 9. - Example: `#size(9)` - **#title(String)**: Sets the title of the inventory. - Example: `#title("Main Inventory")` - **#provider(InventoryProvider)**: Sets the inventory provider, which handles item placement and updates. - Example: `#provider(new InventoryProvider() { ... })` - **#manager(InventoryManager)**: Sets the inventory manager for data loading and event handling. - Example: `#manager(yourManager)` - **#identifier(Object)**: Assigns an identifier to the inventory for retrieval via InventoryManager. - Example: `#identifier("Test")` - **#options(InventoryOptions...)**: Applies various options to modify inventory behavior. - Example: `#options(InventoryOptions.NO_DAMAGE)` - **#ignoredSlots(int...)**: Specifies slots that should be ignored for certain interactions. - Example: `#ignoredSlots(0, 1, 2, 3, 4)` - **#enableAction(InventoryAction...)**: Enables specific actions for inventory interactions. - **#ignoreClickEvent()**: Ignores InventoryClickEvents. - **#ignoreEvents(InventoryEvent...)**: Disables specified inventory events. - **#listener(EventCreator, Consumer)**: Creates custom events based on inventory interactions. - Example: `#listener(new EventCreator<>(InventoryClickEvent.class), Consumer)` ``` -------------------------------- ### Fixed Page Size Configuration Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Sets a fixed page size for the inventory, allowing a specific number of pages to be open regardless of items. ```APIDOC ## Fixed Page Size Configuration ### Description This method sets a fixed page size for the inventory. The player can open a predetermined number of pages at any time, irrespective of the number of items. ### Method Not applicable (Configuration setting) ### Endpoint Not applicable ### Parameters #### Query Parameters - **fixedPageSize** (int) - Required - Sets the number of pages that can be opened. Example: `#fixedPageSize(4)` sets the page size to 4. ### Request Example ```java // Example usage within a larger context (not a direct API call) // inventory.setFixedPageSize(4); ``` ### Response Not applicable ``` -------------------------------- ### Utilize Different Inventory Types Source: https://context7.com/rysefoxx/ryseinventory/llms.txt RyseInventory supports various Bukkit inventory types beyond the standard chest. Specify the desired type using InventoryOpenerType when building the inventory. ```java import io.github.rysefoxx.inventory.plugin.enums.InventoryOpenerType; import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory; import org.bukkit.plugin.java.JavaPlugin; public void demonstrateInventoryTypes(JavaPlugin plugin) { // Standard chest (default) RyseInventory.builder().type(InventoryOpenerType.CHEST).rows(3); // Hopper inventory (5 slots) RyseInventory.builder().type(InventoryOpenerType.HOPPER).size(5); // Dispenser/Dropper (9 slots, 3x3) RyseInventory.builder().type(InventoryOpenerType.DISPENSER).size(9); RyseInventory.builder().type(InventoryOpenerType.DROPPER).size(9); // Ender chest RyseInventory.builder().type(InventoryOpenerType.ENDER_CHEST).rows(3); // Furnace RyseInventory.builder().type(InventoryOpenerType.FURNACE).size(3); // Brewing stand RyseInventory.builder().type(InventoryOpenerType.BREWING_STAND).size(5); // Enchantment table RyseInventory.builder().type(InventoryOpenerType.ENCHANTMENT_TABLE).size(2); } ``` -------------------------------- ### Set Fixed Page Size Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Set a fixed page size using '#fixedPageSize(4)' to allow players to open a specific number of pages. ```java #fixedPageSize(4) ``` -------------------------------- ### Configure Scheduler Delay Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Sets the initial delay for the inventory scheduler in seconds. ```java #delay(5) ``` -------------------------------- ### Configure Content Load Delay Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Sets the duration and time unit before the inventory content is loaded. ```java #loadDelay(5, TimeSetting.SECONDS) ``` -------------------------------- ### Configure Title Load Delay Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Sets the duration and time unit before the original title is displayed. ```java #loadTitle(5, TimeSetting.SECONDS) ``` -------------------------------- ### Implement Custom Inventory Events Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Uses EventCreator to attach inventory-specific listeners for click and drag events. ```java import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.content.InventoryProvider; import io.github.rysefoxx.inventory.plugin.other.EventCreator; import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryDragEvent; import org.bukkit.plugin.java.JavaPlugin; public void createInventoryWithEvents(Player player, JavaPlugin plugin) { RyseInventory inventory = RyseInventory.builder() .title("Event Inventory") .rows(3) .listener(new EventCreator<>(InventoryClickEvent.class, event -> { Player clicker = (Player) event.getWhoClicked(); clicker.sendMessage("You clicked slot: " + event.getSlot()); })) .listener(new EventCreator<>(InventoryDragEvent.class, event -> { event.setCancelled(true); event.getWhoClicked().sendMessage("Dragging is disabled!"); })) .provider(new InventoryProvider() { @Override public void init(Player player, InventoryContents contents) { // Content setup } }) .build(plugin); inventory.open(player); } ``` -------------------------------- ### Create Protected Inventory Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Implement inventory protection using InventoryOptions to prevent player damage, item pickup, potion effects, block breaking, and hunger drain while the inventory is open. This is useful for creating secure interfaces. ```java import io.github.rysefoxx.inventory.plugin.content.InventoryProvider; import io.github.rysefoxx.inventory.plugin.enums.InventoryOptions; import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; public void createProtectedInventory(Player player, JavaPlugin plugin) { RyseInventory inventory = RyseInventory.builder() .title("Protected Inventory") .rows(3) .options(InventoryOptions.NO_DAMAGE) // No damage while open .options(InventoryOptions.NO_ITEM_PICKUP) // Cannot pick up items .options(InventoryOptions.NO_POTION_EFFECT) // No potion effects applied .options(InventoryOptions.NO_BLOCK_BREAK) // Cannot break blocks .options(InventoryOptions.NO_HUNGER) // No hunger drain .provider(new InventoryProvider() { @Override public void init(Player player, io.github.rysefoxx.inventory.plugin.content.InventoryContents contents) { // Inventory content setup } }) .build(plugin); inventory.open(player); } ``` -------------------------------- ### Search for Items by Pattern Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Use SearchPattern to retrieve items or stacks located at specific character markers within an inventory. ```java import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.pattern.SearchPattern; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import java.util.List; public void useSearchPattern(InventoryContents contents) { // First, fill the inventory with items contents.fill(new ItemStack(Material.STONE)); SearchPattern pattern = contents.searchPattern(); pattern.define( "XXXXXXXXX", "XOOOOOOOX", "XXXXOXXXX", "XXXXOXXXX", "XXXXOXXXX", "XXXXOXXXX" ); // Find all IntelligentItems at 'O' positions List foundItems = pattern.searchForIntelligentItems('O'); // Find all ItemStacks at 'X' positions List foundStacks = pattern.searchForItemStacks('X'); System.out.println("Found " + foundItems.size() + " items at 'O' positions"); System.out.println("Found " + foundStacks.size() + " items at 'X' positions"); } ``` -------------------------------- ### Inventory Animation and Utility Functions Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Functions for creating animations and other utility operations within the inventory. ```APIDOC ## Inventory Animation and Utility Functions ### Description Functions for adding animations and performing utility tasks like preventing closing or data transfer. ### Functions - **#animation()**: Used to create a slide animation for the inventory. Refer to the Animation section for more details. - **#preventClose()**: Prevents the inventory from closing under certain conditions. - **#preventTransferData()**: Prevents data transfer related to the inventory. - **#disableUpdateTask()**: Should be called if the update method is not implemented to save scheduler resources. - **#clearAndSafe()**: Clears the inventory safely. - **#type()**: Specifies the type of inventory. ``` -------------------------------- ### Configure Auto-Close Delay Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Sets the time in seconds after which the inventory closes automatically. ```java #closeAfter(60) ``` -------------------------------- ### Gradle Dependency (Kotlin) Source: https://github.com/rysefoxx/ryseinventory/blob/master/README.md Add this to your Gradle build file to include the RyseInventory plugin. ```gradle repositories { mavenCentral() maven { url = uri("https://s01.oss.sonatype.org/content/groups/public/") } } dependencies { implementation("io.github.rysefoxx.inventory:RyseInventory-Plugin:1.6.5") } ``` -------------------------------- ### Create Material Animation Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Animate an item's material type using IntelligentMaterialAnimator. Specify the item, slot, looping, delay, period, and the materials to cycle through. The item must be set in the InventoryContents. ```java import io.github.rysefoxx.inventory.plugin.animator.IntelligentMaterialAnimator; import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.enums.TimeSetting; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import java.util.Arrays; public void createMaterialAnimation(InventoryContents contents, JavaPlugin plugin) { IntelligentItem item = IntelligentItem.empty(new ItemStack(Material.STONE)); contents.set(13, item); IntelligentMaterialAnimator materialAnimator = IntelligentMaterialAnimator.builder(plugin) .item(item) .slot(13) .loop() .delay(1, TimeSetting.SECONDS) .period(500, TimeSetting.MILLISECONDS) .materials(Arrays.asList('A', 'B', 'C', 'D'), Material.DIAMOND_BLOCK, Material.EMERALD_BLOCK, Material.GOLD_BLOCK, Material.IRON_BLOCK) .frame("ABCD") .build(contents); materialAnimator.animate(); } ``` -------------------------------- ### Gradle Dependency (Groovy) Source: https://github.com/rysefoxx/ryseinventory/blob/master/README.md Add this to your Gradle build file to include the RyseInventory plugin. ```gradle repositories { mavenCentral() maven { url "https://s01.oss.sonatype.org/content/groups/public/" } } dependencies { implementation 'io.github.rysefoxx.inventory:RyseInventory-Plugin:1.6.5' } ``` -------------------------------- ### Create SlotIterator with Pattern Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Defines a custom layout for item placement using a character-based grid pattern. Items are placed only in slots corresponding to the character defined in the attach method. ```java import io.github.rysefoxx.inventory.plugin.pagination.SlotIterator; public SlotIterator createPatternIterator() { return SlotIterator.builder() .withPattern() .define( "XXXXXXXXX", "XOOOOOOOX", "XOOOOOOOX", "XOOOOOOOX", "XOOOOOOOX", "XXXXXXXXX" ) .attach('O') // Items will be placed where 'O' appears .build(); } ``` -------------------------------- ### Create Item Name Animation Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Animate item display names using IntelligentItemNameAnimator. Set the item, slot, looping, delay, period, animation type, colors, and frames. The item must be placed in the InventoryContents first. ```java import io.github.rysefoxx.inventory.plugin.animator.IntelligentItemNameAnimator; import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.IntelligentItemColor; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.enums.IntelligentItemAnimatorType; import io.github.rysefoxx.inventory.plugin.enums.TimeSetting; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import java.util.Arrays; public void createItemNameAnimation(InventoryContents contents, JavaPlugin plugin) { IntelligentItem item = IntelligentItem.empty(new ItemStack(Material.DIAMOND_SWORD)); contents.set(13, item); // Center slot in 3-row inventory IntelligentItemNameAnimator nameAnimator = IntelligentItemNameAnimator.builder(plugin) .item(item) .slot(13) .loop() .delay(500, TimeSetting.MILLISECONDS) .period(100, TimeSetting.MILLISECONDS) .type(IntelligentItemAnimatorType.FLASH) // Entire name flashes colors .colors(Arrays.asList('A', 'B', 'C'), IntelligentItemColor.builder().bukkitColor(ChatColor.RED).bold().build(), IntelligentItemColor.builder().bukkitColor(ChatColor.GOLD).build(), IntelligentItemColor.builder().bukkitColor(ChatColor.YELLOW).build()) .frames("ABC") .build(contents); nameAnimator.animate(); } ``` -------------------------------- ### Define Inventory Provider Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Registers an InventoryProvider to handle inventory initialization and updates. ```java #provider(new InventoryProvider() {]) ``` -------------------------------- ### Maven Dependency Source: https://github.com/rysefoxx/ryseinventory/blob/master/README.md Add this to your Maven pom.xml to include the RyseInventory plugin. ```xml sonatype "https://s01.oss.sonatype.org/content/groups/public/" io.github.rysefoxx.inventory RyseInventory-Plugin 1.6.5 ``` -------------------------------- ### Fill Inventory Sections Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Utilize various fill methods to populate inventory rows, columns, borders, or specific areas. ```java import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.enums.Alignment; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; public void demonstrateFillMethods(InventoryContents contents) { ItemStack glass = new ItemStack(Material.GRAY_STAINED_GLASS_PANE); ItemStack border = new ItemStack(Material.BLACK_STAINED_GLASS_PANE); // Fill entire inventory contents.fill(glass); // Fill only borders (edges of inventory) contents.fillBorders(IntelligentItem.empty(border)); // Fill empty slots only contents.fillEmpty(new ItemStack(Material.AIR)); // Fill a specific row (starting from slot, fills entire row) contents.fillRow(9, IntelligentItem.empty(glass)); // Fills second row // Fill a specific column contents.fillColumn(0, IntelligentItem.empty(glass)); // Fills first column // Fill aligned (TOP, BOTTOM, LEFT, RIGHT) contents.fillAligned(Alignment.TOP, 2, IntelligentItem.empty(glass)); // Fill top 2 rows contents.fillAligned(Alignment.LEFT, 1, IntelligentItem.empty(glass)); // Fill leftmost column // Fill a specific area (from slot to slot) contents.fillArea(10, 16, IntelligentItem.empty(new ItemStack(Material.DIAMOND))); // Fill diagonally contents.fillDiagonal(0, IntelligentItem.empty(new ItemStack(Material.EMERALD))); } ``` -------------------------------- ### Set Inventory Title Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Sets the display name of the inventory. ```java #title("Main Inventory") ``` -------------------------------- ### Set Inventory Size Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Defines the total number of slots in the inventory. ```java #size(9) ``` -------------------------------- ### Save and Clear Player Inventory Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder The 'clearAndSafe' method saves and empties the player's inventory upon opening, restoring data on closure. ```java clearAndSafe ``` -------------------------------- ### Register InventoryManager Source: https://context7.com/rysefoxx/ryseinventory/llms.txt The InventoryManager must be registered in your plugin's onEnable method to initialize event listeners and enable the inventory system. ```java import io.github.rysefoxx.inventory.plugin.pagination.InventoryManager; import org.bukkit.plugin.java.JavaPlugin; public class MyPlugin extends JavaPlugin { private final InventoryManager inventoryManager = new InventoryManager(this); @Override public void onEnable() { // Register and invoke the inventory manager this.inventoryManager.invoke(); } } ``` -------------------------------- ### Create Title Animation Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Use IntelligentTitleAnimator to create animated inventory titles. Configure looping, delay, period, animation type, colors, and frames. Requires a JavaPlugin instance and InventoryContents. ```java import io.github.rysefoxx.inventory.plugin.animator.IntelligentTitleAnimator; import io.github.rysefoxx.inventory.plugin.content.IntelligentItemColor; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import io.github.rysefoxx.inventory.plugin.enums.IntelligentItemAnimatorType; import io.github.rysefoxx.inventory.plugin.enums.TimeSetting; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; import java.util.Arrays; public void createTitleAnimation(Player player, InventoryContents contents, JavaPlugin plugin) { IntelligentTitleAnimator titleAnimator = IntelligentTitleAnimator.builder(plugin) .loop() // Animation loops indefinitely .delay(1, TimeSetting.SECONDS) // Start after 1 second .period(50, TimeSetting.MILLISECONDS) // Update every 50ms .type(IntelligentItemAnimatorType.WORD_BY_WORD) // Animation style .colors(Arrays.asList('A', 'B', 'C', 'D'), IntelligentItemColor.builder().bukkitColor(ChatColor.AQUA).build(), IntelligentItemColor.builder().paragraph("&c").bold().build(), IntelligentItemColor.builder().rgbColor(255, 165, 0).build(), IntelligentItemColor.builder().hexColor("#FF5733").underline().build()) .frames("ABCD") // Color sequence .build(contents); titleAnimator.animate(player); } ``` -------------------------------- ### Inventory Timing and Delay Functions Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Functions related to scheduling, delays, and automatic closing of inventories. ```APIDOC ## Inventory Timing and Delay Functions ### Description Functions that control the timing of inventory operations, including delays, periods, and automatic closing. ### Functions - **#delay(long)**: Adjusts the delay of the scheduler in seconds. - Example: `#delay(5)` - **#openDelay(long)**: Sets a delay in seconds before the inventory opens. - Example: `#openDelay(10)` - **#period(long)**: Changes the period of the scheduler in seconds. - Example: `#period(10)` - **#closeAfter(long)**: Sets the time in seconds after which the inventory closes automatically. - Example: `#closeAfter(60)` - **#loadDelay(long, TimeUnit)**: Specifies a delay in seconds before the inventory content is loaded. - Example: `#loadDelay(5, TimeSetting.SECONDS)` - **#loadTitle(long, TimeUnit)**: Sets a delay in seconds before the original inventory title is loaded. - Example: `#loadTitle(5, TimeSetting.SECONDS)` - **#titleHolder(String)**: Sets a temporary title for the inventory, used with #loadTitle(). - Example: `#titleHolder("Placeholder Title")` ``` -------------------------------- ### Inventory Type Configuration Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Allows specifying different inventory types beyond the default CHEST, such as HOPPER. ```APIDOC ## Inventory Type Configuration ### Description This method allows you to specify alternative inventory types, such as a Hopper inventory, instead of the default Chest inventory. ### Method Not applicable (Configuration setting) ### Endpoint Not applicable ### Parameters #### Query Parameters - **type** (InventoryOpenerType) - Required - Specifies the type of inventory to open. Example: `#type(InventoryOpenerType.HOPPER)` for a Hopper inventory. ### Request Example ```java // Example usage within a larger context (not a direct API call) // Assuming 'inventory' is an instance of a class that uses this configuration // inventory.setType(InventoryOpenerType.HOPPER); ``` ### Response Not applicable ``` -------------------------------- ### Register Custom Listener Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Attaches a custom event listener to the inventory. ```java #listener(new EventCreator<>(InventoryClickEvent.class), Consumer); ``` -------------------------------- ### Use Hopper Inventory Type Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Specify a Hopper inventory type by passing #type(InventoryOpenerType.HOPPER). ```java #type(InventoryOpenerType.HOPPER) ``` -------------------------------- ### Prevent Inventory Closing Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Use the 'preventClose' function to stop players from closing the inventory. ```java preventClose ``` -------------------------------- ### Set Inventory Rows Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Defines the number of rows for the inventory, with a maximum of 6. ```java #rows(1) ``` -------------------------------- ### Configure Ignored Slots Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Allows players to interact with specific slots in the inventory. ```java #ignoredSlots(0,1,2,3,4) ``` -------------------------------- ### Configure Scheduler Period Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Sets the tick interval for the scheduler in seconds. ```java #period(10) ``` -------------------------------- ### Dynamically Update Inventory Items Source: https://context7.com/rysefoxx/ryseinventory/llms.txt Update individual slots, display names, materials, lore, or move items within an inventory at runtime using InventoryContents methods. These updates can be applied to all viewers of the inventory. ```java import io.github.rysefoxx.inventory.plugin.content.IntelligentItem; import io.github.rysefoxx.inventory.plugin.content.InventoryContents; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; public void demonstrateUpdates(InventoryContents contents) { // Update a single slot with new ItemStack contents.update(5, new ItemStack(Material.DIAMOND)); // Update with new IntelligentItem (preserves click handler) contents.update(5, IntelligentItem.of(new ItemStack(Material.EMERALD), event -> { event.getWhoClicked().sendMessage("Updated item clicked!"); })); // Update display name of existing item contents.updateDisplayName(5, "&aNew Display Name"); // Update material of existing item contents.updateMaterial(5, Material.GOLD_BLOCK); // Update lore line at specific index contents.updateLore(5, 0, "&7New lore line"); // Update or set (sets if slot is empty, updates if occupied) contents.updateOrSet(10, new ItemStack(Material.IRON_INGOT)); // Move item from one slot to another contents.updatePosition(5, 10); // Update for all players viewing this inventory contents.updateForAll(5, new ItemStack(Material.BEACON)); // Update inventory title contents.updateTitle("New Inventory Title"); } ``` -------------------------------- ### Automatic Inventory Closing Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Control automatic inventory closure based on specific actions using the 'close' method. ```java close ``` -------------------------------- ### Clear and Save Inventory Data Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Handles saving and restoring player inventory data when the custom inventory is opened and closed. ```APIDOC ## Clear and Save Inventory Data ### Description When this method is used, the player's inventory is saved and emptied upon opening the custom inventory. Upon closing the custom inventory, the saved data is restored. ### Method Not applicable (Configuration setting) ### Endpoint Not applicable ### Parameters #### Query Parameters - **clearAndSafe** (boolean) - Optional - If true, enables the clear and save functionality for the player's inventory. ### Request Example ```java // Example usage within a larger context (not a direct API call) // inventory.setClearAndSafe(true); ``` ### Response Not applicable ``` -------------------------------- ### Inventory Closing Control Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Defines when the inventory should be automatically closed based on specific player actions. ```APIDOC ## Inventory Closing Control ### Description This method allows you to specify the conditions under which the inventory should be automatically closed based on player actions. ### Method Not applicable (Configuration setting) ### Endpoint Not applicable ### Parameters #### Query Parameters - **close** (Action) - Optional - Specifies the action that triggers the automatic closing of the inventory. ### Request Example ```java // Example usage within a larger context (not a direct API call) // inventory.setCloseAction(Action.PLAYER_INTERACT); ``` ### Response Not applicable ``` -------------------------------- ### Set Inventory Manager Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Assigns an InventoryManager instance to handle data and events. ```java #manager(yourManager) ``` -------------------------------- ### Set Inventory Identifier Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Assigns a unique ID to the inventory for retrieval via the manager. ```java #identifier("Test") ``` -------------------------------- ### Prevent Player Interaction Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Provides methods to prevent players from closing the inventory or transferring cached data. ```APIDOC ## Prevent Player Interaction ### Description These methods allow you to control player interactions with the inventory, preventing accidental closures or unwanted data persistence. ### Method Not applicable (Configuration settings) ### Endpoint Not applicable ### Parameters #### Query Parameters - **preventClose** (boolean) - Optional - If true, prevents players from closing the inventory. - **preventTransferData** (boolean) - Optional - If true, prevents cached data from appearing on the next page. ### Request Example ```java // Example usage within a larger context (not a direct API call) // inventory.setPreventClose(true); // inventory.setPreventTransferData(true); ``` ### Response Not applicable ``` -------------------------------- ### Prevent Cached Data Transfer Source: https://github.com/rysefoxx/ryseinventory/wiki/Builder Utilize 'preventTransferData' to stop cached data from appearing on the next page. ```java preventTransferData ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.