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

In-GUI search support #17

Open
foxfirecodes opened this issue May 10, 2018 · 4 comments
Open

In-GUI search support #17

foxfirecodes opened this issue May 10, 2018 · 4 comments

Comments

@foxfirecodes
Copy link
Owner

Perhaps using anvils? That, or chat prompts, although anvils would be far more impressive. Will require more research before implementing.

Taken from #13. Separated for organizational purposes.

@foxfirecodes foxfirecodes added this to the v1.5 milestone May 10, 2018
@foxfirecodes
Copy link
Owner Author

Chat prompts seem to be the way to go with this. The handling of anvils in Bukkit is sub-par to say the least, and "absurd" would be far more realistic. However, this feels like the kind of update that belongs in v1.6, as v1.5 has so far been focused on quality of life updates for server owners. (In-game editor, permissions, economy, etc.)

@I-Al-Istannen
Copy link

Anvils are alright since the PrepareAnvilEvent was added, I think. Before that you need a plugin channel listener like the one I created for BukkitUtilities back then.

@foxfirecodes
Copy link
Owner Author

The problem is actually due to the fact that you cannot set items in an anvil inventory, since the anvil inventory itself is actually an instance of CraftInventoryCustom rather than CraftInventoryAnvil (assuming it was created via Bukkit#createInventory). I did some work trying to create an actual CraftInventoryAnvil via reflection using the NMS ContainerAnvil class and such, but it still failed to set the items in the inventory when I called .setItem on the anvil inventory.

1 similar comment
@foxfirecodes
Copy link
Owner Author

The problem is actually due to the fact that you cannot set items in an anvil inventory, since the anvil inventory itself is actually an instance of CraftInventoryCustom rather than CraftInventoryAnvil (assuming it was created via Bukkit#createInventory). I did some work trying to create an actual CraftInventoryAnvil via reflection using the NMS ContainerAnvil class and such, but it still failed to set the items in the inventory when I called .setItem on the anvil inventory.

@foxfirecodes foxfirecodes removed this from the v1.5 milestone May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants