Skip to content

Fix: Recalculate enderchest row count on world change and permission update - #1837

Open
1wairesd wants to merge 1 commit into
PurpurMC:ver/1.21.11from
1wairesd:fix/enderchest-rows-recalculate-on-world-change
Open

1wairesd wants to merge 1 commit into
PurpurMC:ver/1.21.11from
1wairesd:fix/enderchest-rows-recalculate-on-world-change

Conversation

@1wairesd

Copy link
Copy Markdown

Problem

When a player changes worlds, Purpur's sixRowEnderchestSlotCount is not
recalculated. LuckPerms updates the world context but the slot count
remains stale until the player reopens the chest or rejoins the server.

Same issue occurs when permissions change at runtime via /lp commands.

Solution

  • Extract the repeated row-calculation logic into ServerPlayer#recalculateEnderchestRows()
  • Call it on PlayerChangedWorldEvent (in ServerPlayer teleport transition)
  • Call it in CraftHumanEntity#recalculatePermissions() so live permission changes apply immediately

- Extract repeated sixRowEnderchestSlotCount logic into
  ServerPlayer#recalculateEnderchestRows()
- Call recalculateEnderchestRows() on world change in ServerPlayer
  so row count updates immediately without requiring the player
  to re-open the chest or rejoin the server
- Call recalculateEnderchestRows() in CraftHumanEntity#recalculatePermissions()
  so live LuckPerms permission changes take effect immediately
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

Successfully merging this pull request may close these issues.

1 participant