Skip to content

Can modify chest interfaces #69

Description

@Artuto

I'm using interfaces to give a shop preview, but using shift-click on items in the player inventory results in the items getting placed in the chest interface.

ChestInterface.Builder builder = ChestInterface.builder()
                .rows(6)
                .clickHandler(ClickHandler.cancel())
                .addTransform(PaperTransform.chestFill(
                        ItemStackElement.of(new ItemStack(Material.BLACK_STAINED_GLASS_PANE))))
                .title(Component.text("Shop preview"))
                .addTransform((pane, view) ->
                        pane.element(ItemStackElement.of(new ItemStack(Material.STONE)), 0,0));

                builder.build().open(PlayerViewer.of(player));

JM25rv3qxY

Attempting to merge the stacks with spam clicking also works sometimes.

The listener is registered:

getServer().getPluginManager().registerEvents(new PaperInterfaceListeners(this), this);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions