Add NationRangeAllowTownEvent#8128
Conversation
Allowing other plugins to override Towny's proximity rules
|
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. |
Warriorrrr
left a comment
There was a problem hiding this comment.
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
LlmDl
left a comment
There was a problem hiding this comment.
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.
|
Done |
with PR #8091. - Fixed getTownLevelMax always being 1 too high - Fixed TownLevelDecrease/IncreaseEvent firing for towns that have a manually set town level. - Fixed the code around the Town/NationLevelDecrease/IncreaseEvent bypassing the level calculate events, possibly causing them to be wrongly fired when a plugin is calculating its own levels with the level calculate events. - Town merge: - Fixed the town's resident amount being used instead of the nation's resident amount for max outpost calculations. - Fixed max purchased blocks not using the number of townblocks to calculate the town level when configured to do so. - Fixed the purchased and bonus blocks of the succumbing town not being limited by the town block limit option when the town_block_ratio is in use. - Fixed nation level methods wrongly using the modifier and level interchangeably (i.e. getNationLevelFromGivenInt was returning the floored modifier rather than the actual level). - Fix not throwing PlayerChangePlotEvents for passengers. - Add NationRangeAllowTownEvent, courtesy of Veyronity with PR #8128. - An event thrown when a town is assessed during the nation proximity tests, allowing plugins to modify nation proximity rules on a per-town basis. - Bump org.apache.maven.plugins:maven-shade-plugin from 3.6.1 to 3.6.2.
* Add NationRangeAllowTownEvent Allowing other plugins to override Towny's proximity rules * Fire NationRangeAllowTownEvent when gathering in-range towns * Add javadoc * Fire event even for in range towns
with PR TownyAdvanced#8091. - Fixed getTownLevelMax always being 1 too high - Fixed TownLevelDecrease/IncreaseEvent firing for towns that have a manually set town level. - Fixed the code around the Town/NationLevelDecrease/IncreaseEvent bypassing the level calculate events, possibly causing them to be wrongly fired when a plugin is calculating its own levels with the level calculate events. - Town merge: - Fixed the town's resident amount being used instead of the nation's resident amount for max outpost calculations. - Fixed max purchased blocks not using the number of townblocks to calculate the town level when configured to do so. - Fixed the purchased and bonus blocks of the succumbing town not being limited by the town block limit option when the town_block_ratio is in use. - Fixed nation level methods wrongly using the modifier and level interchangeably (i.e. getNationLevelFromGivenInt was returning the floored modifier rather than the actual level). - Fix not throwing PlayerChangePlotEvents for passengers. - Add NationRangeAllowTownEvent, courtesy of Veyronity with PR TownyAdvanced#8128. - An event thrown when a town is assessed during the nation proximity tests, allowing plugins to modify nation proximity rules on a per-town basis. - Bump org.apache.maven.plugins:maven-shade-plugin from 3.6.1 to 3.6.2.
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
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.