Odalita-Developments / OdalitaMenus

Advanced yet simple to use inventory api for Spigot plugins (1.16.5-1.21)
https://www.spigotmc.org/resources/odalitamenus-menu-gui-inventory-framework-for-developers.110376/
MIT License
17 stars 2 forks source link

Client side items in bottom inventory #14

Open underscore95 opened 3 weeks ago

underscore95 commented 3 weeks ago

Is your feature request related to a problem? Please describe.

I want to be able to set items in the bottom inventory so that my GUI can take up the whole screen.

Describe the solution you'd like

Add an optional boolean to methods like setClickable, setDisplay which determines if the item should be placed in the top or bottom inventory.

Example usage:

destination.getSlots().getTopSlots().forEach(slot -> menuContents.setDisplay(slot, icon, true));
destination.getSlots().getBottomSlots().forEach(slot -> menuContents.setDisplay(slot, icon, false));

Describe alternatives you've considered

There isn't really any alternatives (that I can think of)

Additional context

None

ItzKiwiSap commented 3 weeks ago

This seems like a cool addition.

Maybe the syntax could be something like MenuContents#bottomInventory#setClickable where bottomInventory returns MenuContents, so the same methods are available?

What would be the preference for slot handling?

  1. 0-8 hotbar, 9 - 35 (top left, bottom right) inventory
  2. 0-35 (top left, bottom right) inventory, same as top inventory (my preference)

What should be done with items players have in their inventory?

underscore95 commented 3 weeks ago

MenuContents#bottomInventory#setClickable This seems like great syntax.

I agree with you that slots being the same as the top inventory is better.

I would have this entirely be client side, as you mentioned, modifying their actual inventory may cause duplication exploits or players losing items.

ItzKiwiSap commented 3 weeks ago

Alright! I'm currently traveling and won't be back home until July 20. Maybe @TryDev07 could work on this or maybe you could fork it and try to create it yourself and open a pull request? If not, I'll start working on it when I'm back home.

TryDev07 commented 2 weeks ago

Hello, Thank you for the request. I will see what i can do firstly i want to update the library to the latest versions of the game. If i have spare time i will look into adding this feature to the library.