MineColonies

MineColonies

53M Downloads

deleting colonies

warpath1985 opened this issue · 17 comments

commented

Minecolonies version

version 1.10.2 08.3056

Expected behavior

  • deleted players colony expected him to be able to build another

Actual behaviour

  • can not build one says he already has a colony

Steps to reproduce the problem

  1. delete any colony
  2. player can not build another
commented

@Asherslab
I also had this problem in my single-player game. The newly-placed colony ended up being offset by a few blocks in both x and z, and after trying to deal with it, I finally decided it was easier to just destroy it and start over.

Deleting the colony killed the citizens and blew up the area where the mod thought the colony was (leaving a couple rows and columns on the edge where it was actually placed), but still showed the colony under /mc colonies list)

I finally went in and deleted the Minecolonies directory manually to clear it out.

But that still left the playerstats record, giving this error, which may also be what the original reporter was getting hit with:

if(player.getStatFile().readStat(StatList.getObjectUseStats(ModItems.supplyChest)) > 0) { LanguageHandler.sendPlayerMessage(player, "com.minecolonies.coremod.error.supplyChestAlreadyPlaced"); return; }

I haven't played around with stats before, so I'm not yet certain if there's an easy way to clear it out. Time to go looking for a new file to delete.

commented

Deleting the stats json file got me past that problem,and I was able to create a new colony.

commented

I know the page is closed, but a suggestion against the accident

  • indestructible block townhall
  • tab destroy colony in the menu
  • confirmation delete in the chat as when you type the command: / mc colony delete 1
commented

@DjTylerD currently working on a port from 1.11 and 1.12 to 1.10 which has the last of those.
Will also take a look into colony destruction in 1.10, might only be messed up there.

commented

ok thanks for the answer Raycoms

commented

I was running on 1.12 using yesterday's source build when I had the problem, so it was in the 1.12 branch. Yes, there is a confirm delete in the chat.

My colony got hosed when I moved the supply camp trying to figure out how the builders wand worked after the town hall block was placed.

If I have time later today, I will try to reproduce both the "supply camp shouldn't move" problem and the "delete colony not cleaning up everything" issues (suspect it only happens after the first issue).

Assuming that the supply camp shouldn't be moved after the town hall block is placed, the best fix would be to not allow that.

commented
commented

It moved for me :-) I never used minecolonies before yesterday, and the wiki tutorial appears to be a little dated ["Use your Building Tool to place the Town Hall block,"], so I am sure I wasn't using the UI the way a veteran would. (Planning to clean that up the tutorial a bit from the perspective a new player once I understand how it's supposed to work)

And I was standing right next to the initial supply camp when I ran destroy, so the chunk was loaded.

commented

I was not able to reproduce whatever I did to make the town hall block useless. Maybe this has to do with the Eclipse project adding in JEI, tinker's construct, and other mods, while my first game was running solely with Minecolonies in MultiMC.

However, I did reproduce the rest of it running the latest source from eclipse.
I placed the supplycamp then placed the townhall block in the middle of it.
I clicked with the builder wand and, while supply camp was active, moved the supplycamp prototype (is that the right word?) a few blocks. Then I hit ok.

I repeated this a few times and ended up with tons of construction tape all over the place.

I then destroyed the colony. It killed the citizens and destroyed a supplycamp-sized set of blocks close the the colony, but left a few rows of the original placed supplycamp around in the x and z direction. My player still had the "used supplycamp" statistic set, and the "mc colonies list" still showed the colony as active with coordinates and assigned to the player.

Trying to delete it a second time shows "Colony with id %d not found" (minor formatter display bug).

Since I have it running in the debugger now, I'll see if I can track down the root cause once I get more time to take a look.

commented
  1. The partial delete of colony blocks is due to the unconstructed town hall being destroyed. There's nothing in the code that removes the supplycamp blocks (but you probably know this).

  2. Deleting a colony at this point throws an NPE [1] in ProviderHandler.removeProviderInternal()
    final Collection<IToken> assignedResolvers = getRegisteredResolvers(manager, token); returns null for assignedResolvers which causes for (final IToken resolverToken : assignedResolvers)
    to throw an NPE. That aborts the rest of the destroyColony command.

Since nothing logs to the console and I haven't found where the forge log files go, I never saw the error.

It's been a while since I've used git, but I'll create a couple of pull requests at some point when I have more time if someone else doesn't fix it first (trivial to add both the missing formatter and the null check)

[1]
at com.minecolonies.coremod.colony.requestsystem.management.handlers.ProviderHandler.removeProviderInternal(ProviderHandler.java:67) at com.minecolonies.coremod.colony.requestsystem.management.handlers.ProviderHandler.removeProvider(ProviderHandler.java:117) at com.minecolonies.coremod.colony.requestsystem.management.manager.StandardRequestManager.onProviderRemovedFromColony(StandardRequestManager.java:312) at com.minecolonies.coremod.colony.managers.BuildingManager.removeBuilding(BuildingManager.java:357) at com.minecolonies.coremod.colony.buildings.AbstractBuilding.destroy(AbstractBuilding.java:677) at com.minecolonies.coremod.colony.ColonyManager.deleteColony(ColonyManager.java:234) at com.minecolonies.coremod.commands.colonycommands.DeleteColonyCommand.lambda$0(DeleteColonyCommand.java:128)

commented
commented

How do know what your colony id is ?

commented
commented

Did you use the command to "delete" the colony?
Just "breaking" the townhall will not delete the "colony".
The only way to delete a Town is by running the command (must be /OP in server or SSP to run):
https://wiki.minecolonies.com/wiki/18/server
Command to Delete a Town using the Colony ID#.

/mc colony delete <colony ID#>
commented

well since there's no further comments on this, i'm gonna close this

commented

sorry was working away yes it was done with the delete command but we now found if he crafts town hall he is fine to restart town it fails to remove his claim to the cargo ship/camp

commented

Couldn't nuke the colony here too. I had to delete the minecolony folder in my world directory and skipped the camp to be able to continue.