Skip to content

Bit pack perms in TownyPermission objects#8048

Merged
LlmDl merged 3 commits intomasterfrom
feat/compact-towny-permissions
Jan 2, 2026
Merged

Bit pack perms in TownyPermission objects#8048
LlmDl merged 3 commits intomasterfrom
feat/compact-towny-permissions

Conversation

@Warriorrrr
Copy link
Copy Markdown
Member

@Warriorrrr Warriorrrr commented Dec 28, 2025

Description:

There's currently only 16 possible combinations of perm level and action types, which can also be represented by a single 16 bit short instead of a 2d array. This saves a very small amount of memory for each TownyPermission object in memory and is faster to read/write.


  • I have tested this pull request for defects on a server.

By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.

@Warriorrrr Warriorrrr added this to the 0.102.1.0 milestone Dec 28, 2025
@Warriorrrr Warriorrrr changed the title Use shared array instances for default TownyPermission objects Bit pack perms in TownyPermission objects Dec 28, 2025
@LlmDl LlmDl merged commit 00a075c into master Jan 2, 2026
3 checks passed
@LlmDl LlmDl deleted the feat/compact-towny-permissions branch January 2, 2026 15:12
LlmDl added a commit that referenced this pull request Jan 2, 2026
Warrior with PR #8037.
  - Fix a logic error in the PlotGroup#setResident function, courtesy of
Remasuri with PR #8043.
  - Bit pack perms in TownyPermission objects, courtesy of Warrior with
PR #8048.
  - Remove world references stored inside WorldCoord, courtesy of
Warrior with PR #8050.
  - Fix message when attempting to overclaim your own town, courtesy of
Warrior with PR #8051.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants