Skip to content

Advanced Slots fixes and improvements

Compare
Choose a tag to compare
@hamza-cskn hamza-cskn released this 21 Sep 21:01
· 82 commits to master since this release

Important Notes For Developers

If you're don't using advanced slot module, you can ignore notes below.

onPreClick method splitted as onPrePutClick and onPrePickupClick. From this release onPut, onPickup, onPrePutClick and onPrePickupClick methods has second parameter to get clicked item. The clicked item; sometimes storing at event.getCurrentItem, sometimes at event.getCursor, sometimes at hotbar slot. Sometimes that problem going to very strange stages. That is why second parameter there is now. It'll give you true putted/picked item stack.

The item parameter is a non-null parameter. So, the event parameter cannot be null too.

Example Of An Advanced Slot Usage

this.advancedSlotManager.addAdvancedIcon(10, new Icon(Material.STONE))
                .onPrePickupClick((e, item) -> false)
                .onPrePutClick((e, item) -> false)
                .onPickup((e, item) -> {})
                .onPut((e, item) -> {});

Some developers needed to disabling item-refund-when-gui-close feature for some advanced slots. I added it.

anAdvancedSlot.setRefundOnClose(false);

Changes

fix: fix wrong put action trigger
feat: add pre pickup click action
fix: fix hotbar air swap bug
fix: fix wrong put item amounts specifying
fix: fix pre pickup action error
fix: fix multiple advanced slot bugs.
fix: click event trigger bugs about cursor/hotbar swap
fix: fix advanced slot managers doesn't registers itselfs.
feat: add item parameter for actions.
feat: add getPuttedItem method to advanced slot
fix: multiple advanced slots sometimes doesn't refund items.
feat: add disabling option of refund item feature for developers.

Summary

All known bugs have been fixed and minor features added.

Full Changelog: 4.1.7...4.1.8