-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Handle empty towns during duplicate resident removal #7474
Conversation
try { | ||
universe.unregisterTown(olderResTown); | ||
} catch (NotRegisteredException ignored) {} | ||
deleteTown(olderResTown); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try { | |
universe.unregisterTown(olderResTown); | |
} catch (NotRegisteredException ignored) {} | |
deleteTown(olderResTown); | |
TownyUniverse.getInstance().getDataSource().removeTown(town, DeleteTownEvent.Cause.NO_RESIDENTS, null, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively we could just call resident.removeTown() and this would be taken care of I think.
I see the comment saying we cannot use resident.removeTown()...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The town & townblocks are not loaded yet at this point so I figured we could get away with unregistering it and deleting the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
touché
galacticwarrior9 with PR #7478. - Handle empty towns during duplicate resident removal, courtesy of Warrior with PR #7474. - Add plot group creation/deletion events #7476, courtesy of Warrior with PR. - Closes #7475. - Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.5 to 3.3.0. - Drop support for MC 1.16-1.18, update the readme.
Description:
New Nodes/Commands/ConfigOptions:
Relevant Towny Issue ticket:
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.