-
Notifications
You must be signed in to change notification settings - Fork 114
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
Looking for Advice #354
Comments
Hi! So your If so, you should know that AnvilGUI reimplements some parts of the anvil logic in order to make more advanced customization of the anvil behavior possible on as many versions of the game as possible. So because AnvilGUI reimplements rather than delegates to the vanilla logic, it is possible that AnvilGUI behaves differently from the vanilla anvil in some cases. With that said, ideally it should be possible to create a "vanilla-like" anvil with AnvilGUI. Your issue sounds like it could be caused by a bug in AnvilGUI. I'm currently busy with other projects but I want to investigate this possible bug, maybe within a week or two. Either way, if you just want a virtual vanilla anvil, you could probably use the Spigot/Paper API for it instead. If you're using 1.21.1+, I would recommend you to check out Spigot's new MenuType API. |
Oh sweet! Thank you for the link to the MenuType API, I'll be sure to check it out :) |
You're welcome :) But it also just occurred to me that your issue might not be a bug but rather a misunderstanding about how AnvilGUI works (the documentation could definitely be improved in some regards). I said earlier that the AnvilGUI reimplementation of the anvil has some deviations from the vanilla anvil, but if I'm not mistaken, there are some pretty substantial differences, such as:
With that in mind you're probably better off using the MenuType or similar API if you want vanilla behavior. The situation might be improved in the future, but AnvilGUI has traditionally been used (and developed for) other use cases, such as text input, so "vanilla-like" behavior may be hard or impossible to achieve with the current AnvilGUI version. |
Hey there! So loving the customisation of the API so far but I am quite stuck on trying to achieve what I want to achieve.
I would basically like to completely copy the regular use of an Anvil but with the AnvilGUI API, this is because I want to make a /anvil command where players can use it wherever they choose.
Here is my current code
new AnvilGUI.Builder() .onClick((slot, stateSnapshot) -> { // Either use sync or async variant, not both return Collections.emptyList(); }) .interactableSlots(AnvilGUI.Slot.INPUT_LEFT, AnvilGUI.Slot.INPUT_RIGHT, AnvilGUI.Slot.OUTPUT) .title("Repair & Name") //set the title of the GUI (only works in 1.14+) .plugin(ServerEssentials.getPlugin()) //set the plugin instance .open(player);
But I am having issues where when I put an item in any of the slots I can shift + click it out and the output will duplicate the item, so I haven't quite nailed the vanilla anvil functionality.
Any advice or help would be appreciated :)
The text was updated successfully, but these errors were encountered: