Skip to content

InvUI v2.0.0-alpha.19

Pre-release
Pre-release

Choose a tag to compare

@NichtStudioCode NichtStudioCode released this 18 Sep 11:30

New features

  • Window state tracking with Window#setWindowState, Window#getClientWindowState. This sends a ping packet to the viewer of the window, with the acknowledgement being stored in the window's client window state. This can be used to track things like which bundle slot index is selected client-side when a bundle select handler is fired.
  • ItemBuilder#setGlint
  • SlotElementSupplier: an ingredient that supplies all slots of a GUI at once (and therefore has more information than Supplier<SlotElement>)
  • A custom handler for exceptions from user code that were caught by InvUI can now be set using InvUI#setExceptionHandler this defaults to logging the exception using the plugin's logger like before.
  • invui-kotlin: DSL: added maxLine in scroll GUI DSL
  • invui-kotlin: Added Inventory.get(IntRange) operator for getting an ObscuredInventory of the given slot range

Changes

  • ScrollGui<?> now also works with uneven line lengths and interrupted lines. Such GUIs will be treated as if there was something in front of a scroll GUI with even lines (i.e. content will be hidden "behind" those slots)
  • ScrollGui<Gui> no longer "flattens" the GUIs if the line length doesn't match the GUI's width
  • Paged<Gui> & TabGui can now also have "obstructed" content list slots (e.g. holes in the layout), behaving like ScrollGui<?>
  • PagedGui<Gui> & TabGui no longer "flattens" the GUIs if the line length doesn't match the GUI's width
  • Setting a gui as an ingredient in a structure no longer "flattens" the GUI if the line lengths don't match. Similarly to TabGui, this also supports obstructed slots.
  • Window, Gui, Item now implement Observer / Observable
  • Added overloads Gui#notifyWindow(char), Gui#notifyWindows(char, char) to prevent calls to notifyWindows from incorrectly resolving to Gui#notifyWindows(int) and Gui#notifyWindow(int, int)
  • Removed VirtualInventory resizing
  • VirtualInventory#serialize(OutputStream) and VirtualInventory#deserialize(InputStream) now throw IOException instead of catching and logging them
  • CompositeInventory and ObscuredInventory can now have event handlers, custom iteration order and custom gui priority
  • invui-kotlin: DSL: parameters of handler functions like onClick have been moved to the receiver

Fixes

  • Fixed an issue where the items retrieved from ReferencingInventory were not copied