Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can modify chest interfaces #69

Open
Artuto opened this issue Nov 18, 2021 · 0 comments
Open

Can modify chest interfaces #69

Artuto opened this issue Nov 18, 2021 · 0 comments
Assignees

Comments

@Artuto
Copy link

Artuto commented Nov 18, 2021

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);
@broccolai broccolai self-assigned this Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants