Skip to content

Add NationRangeAllowTownEvent#8128

Open
Veyronity wants to merge 4 commits intoTownyAdvanced:masterfrom
Veyronity:event/NationRangeAllowTownEvent
Open

Add NationRangeAllowTownEvent#8128
Veyronity wants to merge 4 commits intoTownyAdvanced:masterfrom
Veyronity:event/NationRangeAllowTownEvent

Conversation

@Veyronity
Copy link
Contributor

@Veyronity Veyronity commented Mar 1, 2026

Description:

Added NationRangeAllowTownEvent, allowing other plugins to override/ignore Towny's proximity rules
For my specific case, I'd like to allow towns from the other side of the world border to join nations


  • [ x ] 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.

@Veyronity
Copy link
Contributor Author

In regards to my 2nd commit, if you think firing an event for each town when just gathering a list of in range towns is unnecessary, it can be moved to ProximityUtil#removeOutOfRangeTowns as that's the only usage that kicks them.

Other usages are just a warning to players when moving nation/town, or when merging a nation.

Copy link
Member

@Warriorrrr Warriorrrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks fine to me, the the event could use some javadocs explaining what it does, how it can be fired pre-cancelled if the town isn't allowed according to nation range rules

Copy link
Member

@LlmDl LlmDl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks alright but it looks like a town that is within range of the nation never gets an event thrown which would stop a plugin from making things more strict than Towny would act.

It might be worth making it throw an event for every town that is tested.

@Veyronity
Copy link
Contributor Author

Done
I honestly think all these methods serving basically the same purpose is a mess, maybe Ill refactor that next

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.

3 participants