Towny Classic

Towny Classic

3.2k Downloads

Not all district town blocks deleted on town deletion

Closed this issue · 5 comments

commented

What steps will reproduce the problem?

Delete a town containing a district. Most of the town blocks will be deleted, but it leaves two town blocks that are not deleted and still belong to the district. Doing /t here in those town blocks says that the town is TOWNNAME Ruins. This has occurred with multiple towns, so it is not a data corruption issue with a specific town.

Looking at the code, the error seems to stems from TownyCustomListener#onTownUnclaimDistrict(TownPreUnclaimEvent) which is fired from TownyDatabaseHandler#removeTownBlock(TownBlock).

What is the expected output?

All town blocks are deleted, including those associated with a district.

Towny version

0.101.2.0

Server version

Paper version 1.21.4-222

Please use Pastebin.com to link the following files

  1. Your full server startup from the logs\latest.log:
  2. Your Towny config.yml: https://gist.github.com/SulkyWhale/78ff271e62fb8b3755e531ebda2fb002
  3. Your townyperms.yml: https://gist.github.com/SulkyWhale/84474fb84390b46bfdbd0a8879e9e08d
  4. Your log's error:
Sulky_Whale issued server command: /t delete Test
Sulky_Whale issued server command: /confirm
[Towny] You cannot remove this townblock from the district -3, because the a part of the District would be detached from the rest.
[Towny] You cannot remove this townblock from the district -3, because the a part of the District would be detached from the rest.
[Towny] [Global Message] The town of Test has been deleted!

(optional) If this is to do with permissions,
5. Your permissions file:

(optional) If this is to do with chat,
6. Your chatconfig.yml:
7. Your channels.yml:

commented

If you wouldn't mind testing out this build on a test server: https://github.com/TownyAdvanced/Towny/actions/runs/16430242855/artifacts/3582452745

commented

If you wouldn't mind testing out this build on a test server: https://github.com/TownyAdvanced/Towny/actions/runs/16430242855/artifacts/3582452745

That works as expected.

commented
commented

If I may ask, what is the purpose of the TownPreUnclaimEvent listener and its logic there?

commented