Releases: NichtStudioCode/InvUI
Releases · NichtStudioCode/InvUI
InvUI v2.0.0-alpha.25
- Added
#ItemBuilder(ItemType) invui-kotlin: DSL: addedbyoverloads toIngredientDslfor item / slot element suppliers- Periodic notify tasks (from
Item.Builder#updatePeriodicallyandReferencingInventory) now run synchronously again, with oneScheduledTaskperWindow
InvUI v2.0.0-alpha.24
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:
- For single clicks, if the clicked inventory is a
ReferencingInventoryto the viewer's player inventory (e.g. the default lower GUI), anInventoryClickEventis 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. - For single clicks, if the clicked inventory is anything else (e.g. a
VirtualInventoryor aReferencingInventoryto something else), anInventoryClickEventis fired with a custom view that does not match the player's current open view. Instead, this custom view uses an adapterInventorythat delegates to the InvUI inventory as the top inventory. The lower inventory of the view is always the player's inventory. - For item drags, if all slots are within a
ReferencingInventoryto the viewer's player inventory (e.g. the default lower GUI), anInventoryDragEventis fired with a view matching the player's current open view. This behavior is similar to (1). - For item drags, if there are slots from other inventories involved, an
InventoryDragEventis fired with a custom view that does not match the player's current open view. Instead, this custom view uses an adapterInventoryto aCompositeInventorythat combines all the inventories involved in the drag action, exceptReferencingInventoryto 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. TheInventoryDragEventis fired with an expected outcome of the drag action, not taking into account any custom InvUI-inventory logic like update handlers. Additionally, while cancelling theInventoryDragEventwill work as expected, changing the new cursor withInventoryDragEvent#setCursoris 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#setNewItemandItemUpdateEvent#getNewItem,ItemUpdateEvent#getPreviousItemnow 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
ReferencingInventoryis now private. Use the static factory functions instead. - InvUI's
InventoryClickEventnow includes anInventoryAction, which represents the normal outcome of the event.
Fixes
- Fixed
Inventory#removeFirstandInventory#removeFirstSimilarreturning0instead of the amount of removed items when the entireamountwas removed.
InvUI v1.49
- 1.21.11 Support
InvUI v2.0.0-alpha.23
- Fixed
maxLineinScrollGuiDslnot working
InvUI v2.0.0-alpha.21.1
- Fixed
maxLineinScrollGuiDslnot working
InvUI v2.0.0-alpha.22
- Updated to 1.21.11-rc2
- Added missing
ExperimentalReactiveApiopt-in annotations on provider properties that were added in the last release
InvUI v1.48
- Fixed #111 - using the SkullBuilder with HeadTexture is broken on
InvUI v2.0.0-alpha.21
New features
invui-kotlin: addedcontentProvider,pageProvider,pageCountProviderextension properties onPagedGuicontentProvider,lineProvider,lineCountProvider,maxLineProvideronScrollGuitabsProvider,tabsProvider,activeTabProvideronTabGui.
invui-kotlin: DSL: AddedactiveTabproperty toTabGuiDsl
Changes
- Dropping an item from the cursor or by pressing
Q/CTRL-Qon an item in a gui-embedded inventory now firesPlayerDropItemEvent - Modified stack counts in
ItemPreUpdateEventare 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
- 1.21.9 Support
InvUI v2.0.0-alpha.20
- Fixed an issue where the buttons gui of
StonecutterWindowwould 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