Skip to content
This repository was archived by the owner on May 11, 2026. It is now read-only.

Lotus v1.5.1

Choose a tag to compare

@Mqzn Mqzn released this 12 Jul 17:18
· 8 commits to master since this release

Animations arrived !

This update adds a per button animation tasks, fully automated with
no need for manual intervention.

You can customize the animation task delay, update speed/ticks,
and whether the update should be asynchronous or synchronous.

AnimatedButton

A new abstract class has arrived providing a solid way of creating animations per one button.
You should be able to extend this class, creating your own buttons, and override the AnimatedButton#animate ,
This is method is the main method that will run the actual changes per frame.

TransformingButton

It's an automated animation where an button's itemstack is changed per frame, and this is called a transformation
Example use inside of your Menu#getContent :

private final static ItemStack[] ITEM_FRAMES = {
            ItemBuilder.legacy(Material.FIREWORK).build(),
            ItemBuilder.legacy(Material.TNT).build(),
            ItemBuilder.legacy(Material.SKULL_ITEM, 1, (short)1).build(),
            ItemBuilder.legacy(Material.SNOW_BALL).build()
    };
    
    @Override
    public @NotNull Content getContent(
            DataRegistry extraData,
            Player opener,
            Capacity capacity
    ) {
        
        TransformingButton randomGameButton = new TransformingButton(
                AnimationTaskData
                        .builder()
                        .delay(10L)
                        .ticks(12L) 
                        .async(true)
                        .build(),
                
                (item) -> ItemBuilder.legacy(item)
                        .setDisplay("&aRandom Game")
                        .setLore("&7Click to play a random game")
                        .build(), //an item modifier lambda, that can modify current changeable itemstacks for consistent item meta.
                ITEM_FRAMES
        ).click((view, event) -> {
            // Handle the click event here
            Player player = (Player) event.getWhoClicked();
            player.sendMessage("You clicked the random game button!");
        });

        return Content.builder(capacity)
            .setButton(1, randomGameButton)
            .build();
    }

Full Changelog: 1.4.4b...1.5.1