Skip to content

Lazily initialize maps used by TownBlock#8049

Merged
LlmDl merged 3 commits intomasterfrom
feat/townblock-lazy-initialize-maps
Jan 8, 2026
Merged

Lazily initialize maps used by TownBlock#8049
LlmDl merged 3 commits intomasterfrom
feat/townblock-lazy-initialize-maps

Conversation

@Warriorrrr
Copy link
Copy Markdown
Member

Description:

initializes the permission overrides and trusted residents map/set used in townblocks on demand rather than at construction time, which will slightly decrease memory use and database saving/loading speed when dealing with lots of townblocks on a server.


  • 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
Copy link
Copy Markdown
Member Author

I've removed the empty checks on the townblocks themselves, the empty checks for plot groups do make a bit more sense since it doesn't need to be set again if a previous already loaded it for the whole group.

@Warriorrrr
Copy link
Copy Markdown
Member Author

TownBlock and PlotGroup will now also use linked collections for trusted residents and permission overrides so that insertion order will be preserved.

@LlmDl LlmDl merged commit f3e9119 into master Jan 8, 2026
3 checks passed
@LlmDl LlmDl deleted the feat/townblock-lazy-initialize-maps branch January 8, 2026 15:13
LlmDl added a commit that referenced this pull request Jan 8, 2026
  - Bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.2 to
3.5.4.
  - Bump org.apache.maven.plugins:maven-jar-plugin from 3.4.2 to 3.5.0.
  - Bump org.apache.maven.plugins:maven-compiler-plugin from 3.13.0 to
3.14.1.
  - Bump org.apache.logging.log4j:log4j-core from 2.24.3 to 2.25.3.
  - Bump org.apache.maven.plugins:maven-shade-plugin from 3.6.0 to
3.6.1.
  - Lazily initialize maps used by TownBlock, courtesy of Warrior with
PR #8049.
  - Fix occasions where plot groups exist in townblocks being removed.
  - Fix the townyperms group command not working with capitalized
groups, courtesy of Warrior with PR #8055.
  - Add support for enabling conquering on a town via townyadmin
command.
  - Check the chunk is still wilderness after confirmation in /town new,
courtesy of Veyronity with PR #8059. (First-Time Contributor!)
  - Add null checks to the task schedulers, courtesy of Warrior with
PR #8060.
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