2.0.0-alpha.8
Pre-release
Pre-release
·
9 commits
to ver/2.x
since this release
New features
- Updated to 1.21.5
- Added
CrafterWindow
,MerchantWindow
,StonecutterWindow
- Added methods to change/update items/slot elements in GUIs based on the ingredient key that was used in the structure
- Content lists slots can now be changed after GUI creation
- Items can now have bundle select handlers (triggered when scrolling through a bundle and when the cursor leaves the bundle item)
- GUI-embedded inventories can now handle bundle interactions
- Inventories can now define a custom iteration order that is used for methods like
addItem
- Windows can now have a "fallback window", which is a window that will be opened if the previous window was closed by the player (by pressing
ESC
orE
). Unlike opening a window in a close handler, this will carry the cursor item stack over to the new window.
Changes
- Reworked animations. Animations can now be created via
Animation.builder()
and consist of 5 components:- Slot filter: Defines which slots are part of the animation.
- Slot selector: Selects the slots that are shown in each frame.
- Intermediary generator: Creates intermediary
SlotElements
that are displayed before the slots pop in. - Show handler: Called when slot(s) are shown, for example to play a sound effect.
- Finish handler: Called when the animation is finished.
- All windows are now packet-based
- This should resolve #84 and #107
Click
andPlayerUpdateReason
no longer contain the Bukkit event / other information predicted by Bukkit, as no click event is actually fired.- There is no longer a difference between "single" and "split" windows. Instead, all windows are now what was previously considered a split window, with the bottom GUI defaulting to a
ReferencingInventory
that references the player inventory.
- GUI-embedded
ReferencingInventories
now automatically notify windows when the referenced contents change - Reworked CartographyWindow
- Replacing the open window will now carry the cursor item stack to the new window
- Window close handlers now receive a close reason
- Renamed builder factory functions to be more consistent. If there is only a single builder available, the function is now named
.builder
(for example inAnvilWindow.builder()
). Specialized builder factory functions are prefixed by their specialty (e.g.PagedGui.itemsBuilder()
) - Updated the naming of some methods in
PagedGui
/ScrollGui
- Removed superfluous methods in
PagedGui
andScrollGui
, such ashasPreviousPage
orgoForward
- Replaced supplier-based GUI/window state with
Property
/MutableProperty
, which are supposed to serve as an adapter interface for such data structures. - invui-kotlin: Removed provider-combining overloads
Fixes
- Reverted GUI-/inventory slot element suppliers to the old looping behavior. This is required for cases where a GUI builder's build method is called multiple times.
- Fixed an issue where the GUI background would not work for non-nested GUIs
- Fixed an issue where
Inventory#collectSimilar
would not take from full stacks