Skip to content

Releases: NichtStudioCode/InvUI

InvUI v2.0.0-alpha.25

24 Dec 14:46

Choose a tag to compare

InvUI v2.0.0-alpha.25 Pre-release
Pre-release
  • Added #ItemBuilder(ItemType)
  • invui-kotlin: DSL: added by overloads to IngredientDsl for item / slot element suppliers
  • Periodic notify tasks (from Item.Builder#updatePeriodically and ReferencingInventory) now run synchronously again, with one ScheduledTask per Window

InvUI v2.0.0-alpha.24

21 Dec 12:25

Choose a tag to compare

InvUI v2.0.0-alpha.24 Pre-release
Pre-release

Bukkit inventory events

When embedded in a Gui, InvUI now fires Bukkit's InventoryClickEvent and InventoryDragEvent for VirtualInventory and ReferencingInventory. This works the following way:

  1. For single clicks, if the clicked inventory is a ReferencingInventory to the viewer's player inventory (e.g. the default lower GUI), an InventoryClickEvent is fired with a view matching the player's current open view, which is a view with a top inventory of 0 slots, and the player inventory as the bottom inventory. Note that even if the referencing inventory is embedded in the upper GUI, the click event is still fired with a slot translated to the lower inventory.
  2. For single clicks, if the clicked inventory is anything else (e.g. a VirtualInventory or a ReferencingInventory to something else), an InventoryClickEvent is fired with a custom view that does not match the player's current open view. Instead, this custom view uses an adapter Inventory that delegates to the InvUI inventory as the top inventory. The lower inventory of the view is always the player's inventory.
  3. For item drags, if all slots are within a ReferencingInventory to the viewer's player inventory (e.g. the default lower GUI), an InventoryDragEvent is fired with a view matching the player's current open view. This behavior is similar to (1).
  4. For item drags, if there are slots from other inventories involved, an InventoryDragEvent is fired with a custom view that does not match the player's current open view. Instead, this custom view uses an adapter Inventory to a CompositeInventory that combines all the inventories involved in the drag action, except ReferencingInventory to the viewer's player inventory, for which the view's lower inventory will be used. Like (2), the adapter inventory then delegates to the InvUI inventories. The InventoryDragEvent is fired with an expected outcome of the drag action, not taking into account any custom InvUI-inventory logic like update handlers. Additionally, while cancelling the InventoryDragEvent will work as expected, changing the new cursor with InventoryDragEvent#setCursor is ignored by InvUI.

The above logic is intended to not break too many assumptions made by plugins, such as the player's inventory always being the lower inventory in a view, while still isolating InvUI's gui components.

This functionality is currently enabled by default. Bukkit inventory event firing can be disabled per-plugin via InvUI.getInstance().setFireBukkitInventoryEvents(false) or globally by setting the system property invui.fireBukkitInventoryEvents to false (-Dinvui.fireBukkitInventoryEvents=false). Depending on feedback, this may be changed to be opt-in instead.

New features

  • Bukkit inventory events
  • Experimental support for Folia

Changes

  • Removed ItemPreUpdateEvent#setNewItem and ItemUpdateEvent#getNewItem, ItemUpdateEvent#getPreviousItem now always return copies. This removes the functionality to change the new item amount and have this reflected in the source, as that did not work properly in some cases. Cancelling the event is still possible.
  • The constructor of ReferencingInventory is now private. Use the static factory functions instead.
  • InvUI's InventoryClickEvent now includes an InventoryAction, which represents the normal outcome of the event.

Fixes

  • Fixed Inventory#removeFirst and Inventory#removeFirstSimilar returning 0 instead of the amount of removed items when the entire amount was removed.

InvUI v1.49

09 Dec 17:05

Choose a tag to compare

  • 1.21.11 Support

InvUI v2.0.0-alpha.23

07 Dec 17:59

Choose a tag to compare

InvUI v2.0.0-alpha.23 Pre-release
Pre-release
  • Fixed maxLine in ScrollGuiDsl not working

InvUI v2.0.0-alpha.21.1

07 Dec 17:38

Choose a tag to compare

Pre-release
  • Fixed maxLine in ScrollGuiDsl not working

InvUI v2.0.0-alpha.22

06 Dec 19:41

Choose a tag to compare

InvUI v2.0.0-alpha.22 Pre-release
Pre-release
  • Updated to 1.21.11-rc2
  • Added missing ExperimentalReactiveApi opt-in annotations on provider properties that were added in the last release

InvUI v1.48

06 Dec 22:00

Choose a tag to compare

  • Fixed #111 - using the SkullBuilder with HeadTexture is broken on

InvUI v2.0.0-alpha.21

17 Nov 14:01

Choose a tag to compare

InvUI v2.0.0-alpha.21 Pre-release
Pre-release

New features

  • invui-kotlin: added
    • contentProvider, pageProvider, pageCountProvider extension properties on PagedGui
    • contentProvider, lineProvider, lineCountProvider, maxLineProvider on ScrollGui
    • tabsProvider, tabsProvider, activeTabProvider on TabGui.
  • invui-kotlin: DSL: Added activeTab property to TabGuiDsl

Changes

  • Dropping an item from the cursor or by pressing Q / CTRL-Q on an item in a gui-embedded inventory now fires PlayerDropItemEvent
  • Modified stack counts in ItemPreUpdateEvent are now reflected in the amount of dropped items
  • Updated included map color palette

Fixes

  • Fixed an issue where ItemBuilder's buildCache was not copied on clone
  • Fixed an issue where page- and line count change handlers were not called

InvUI v1.47

30 Sep 17:39

Choose a tag to compare

  • 1.21.9 Support

InvUI v2.0.0-alpha.20

30 Sep 17:56

Choose a tag to compare

InvUI v2.0.0-alpha.20 Pre-release
Pre-release
  • Fixed an issue where the buttons gui of StonecutterWindow would not update correctly
  • Reverted a change from 2.0.0-alpha.16: Windows now write the slot number of all displayed UI items into their persistent data container again