Skip to content

v1.5.0 - Robin got Pranked!

Compare
Choose a tag to compare
@coderFlameyosFlow coderFlameyosFlow released this 26 Sep 20:41
· 51 commits to main since this release
308571f

On a serious note, one good thing I thought was to split versions into categories. like this:

Category: 1. Flexibility, 2. Performance, 3. Extensibility, 4. Bug Fixes

all versions will include that but depending on how much of flexibility, performance or extensibility there is in that version, the ranks will switch. (unless it's a patch then most likely just Bug fixes)

You aren't here for that though you're here to check out the cool new features.

Improvements

  • Page and BaseMenu+ implementations have switched from a HashMap<Integer, MenuItem> to MenuItem[]. yes boys we have completely rewritten the implementations. this is to optimize looping, get and set faster, avoid boxing and significantly reduce the amount of memory taken.
  • automatically resizes in recreateInventory(). no it is not slow. if you think it is you should definitely stop using any data structure except for non-growing arrays. (for all the people who might not be as experienced)

Additions

  • This was supposed to be a 1.5.0 feature but it was added in 1.4.0. fast reflective checking to get what filler you want if you added a custom one. check out getFiller(Class) and getPageDecorator(Class)

  • New Filling and Decorating API
    Methods added were Filler#fillRow, Filler#fillArea (fillArea means you can fill every slot in the A of Length*Width. literally) and same names on PageDecorator

  • New Special MenuData.
    What's so special about a casual data class?
    this is not very casual because it is Serializable and ConfigurationSerializable. meaning you can store this data in File, Path and spigotmc configuration files. including all the MenuItem itemsd in the data (ConfigurationSerializable is guaranteed more to work

  • New Special MenuItem clicking API
    MenuItem clicking action can now be retried automatically. don't abuse it because recursion is used behind the scenes. (no better way to asynchronously retry)
    New Async way to execute item actions asynchronously using setClickActionAsync
    Disclaimer; don't be tricked by the implementation, it's either sync or async. the clickAction is now CompletableFuture but that doesn't mean always async, it just means it's clicked differently depending on the situation.

  • New Animation API (experimental and might not be stable or not even work)
    predefined animations exist but not really that special.
    Okay but I can't find how to apply it
    This is how you apply it (thanks to the new OpenMenuEvent)

    menu.setOpenAction(event -> {
        event.setAnimation(new WaveWestAnimation(menu, items)); // items is supposed to be a defined List<MenuItem>. get that first
        // event.getAnimation(Class<?> exists too but we'll use the optional
        event.getOptionalAnimation(WaveWestAnimation.class)
                .ifPresent(WaveWestAnimation::animate); 
    });
  • New ClickActionEvent and OpenMenuEvent; to improve performance by using fields instead of getters and adding more methods like ClickActionEvent#getPlayer and OpenMenuEvent#getOpener (both returns Player) and add animation API to OpenMenuEvent.

Bug Fixes

  • all the fixes is that MenuLayoutBuilder is now 100% stabilized and tested.

There may be so much more; you'll have to test everything out yourself :>