Skip to content

chore: Rework pane mapping #18

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

LichtHund
Copy link
Member

Slot to GridPoint conversion was very reliant on the containers being Chest based. To tackle this I introduced the idea of a GridMapper which sole responsibility is to turn slots into GridPoints and GridPoints into slots.
With this change we don't need ordered pane anymore as all slots used by the pane will already be mapped when passing it to the pane.

A few things to note:

  • I had to re-map some internal slots on player inventory to make more sense on the new system and to fix crafting grid having the same slots as the hotbar.
  • Using the player crafting grid is now possible, I didn't implement it because it was being too unreliable, items would get removed and placed on player inventory often and I didn't want to bother fixing it.
  • I left some old code intact like fromBukkitPlayerSlot and relativizePlayerInventorySlot because I am not exactly sure how they interact and from my testing they were never called or the results were always the same as the mapper.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants