Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Towny with less than 100 NotRegisteredException mentions. #6502

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LlmDl
Copy link
Member

@LlmDl LlmDl commented Feb 24, 2023

Description:

Not intended to be merged

This branch is the result of systematically tracking down and replacing many of the ways Towny can throw a NotRegisteredException.

This includes:

  • Changing over basecommand to use townyexception instead of not registered.
    • This comes with new language strings that are much more suited to being shown to players.
  • Deprecate a few TownyWorlds methods in favour of the Nullable options.
  • Stop Towny using NRE-throwing calls in its own objects
    • ie: Resident#getTown, Town#getNation
    • These have not be deprecated but maybe they should be.
  • TownyUniverse gets a couple of helpful methods for changing a resident UUID and Name for when we know that it is safe to do so.

Todo:

  • Next step might be dealing with loading of spawn locations after checking how the UUID db branch dealt with it. (If it did.)

The resulting branch will then be used to merge smaller, safe changes until there's some hard decisions to be made about the usage of NREs. I envision them only being thrown by TownyUniverse and only used to denote in-memory discrepancies.


New Nodes/Commands/ConfigOptions:


Relevant Towny Issue ticket:


  • 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.

Changing over basecommand to use townyexception instead of not
registered.
Deprecate a few TownyWorlds methods.

Replace a ton more NRE-throwing calls with safe tests.
Remove more NRE generating code, (probably temporarily) deprecate some
methods that throw NREs.
Tactically nuked the NREs from orbit.

Not longer thrown internally by any of the Towny Objects. Some of which
are deprecated, some not.

Next step might be dealing with loading of spawn locations after
checking how the UUID db branch dealt with it. (If it did.)

Following that, start merging things from this into smaller PRs made to
Towny, starting with the safest options.
Basic grammar.
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.

None yet

1 participant