gisellevonbingen-Minecraft / MineColonies_Compatibility

https://www.curseforge.com/minecraft/mc-mods/minecolonies-compatibility
GNU General Public License v3.0
4 stars 2 forks source link

Removing Minecolonies Compatibility consistently breaks worlds with the error "invalid player data", saves are unrecoverable #45

Open Thodor12 opened 3 weeks ago

Thodor12 commented 3 weeks ago

We've had several people ring into our Discord who we've told to remove tweaks and compatibility due to issues they were having.

However upon removing the mods their saves completely break down with the error "invalid player data". Even removing their actual player data folder won't even fix it anymore. A user here at least managed to pin the issue to compatibility, so that limits where you have to search at least.

The common problem I noticed twice is that when people had a gunner/orchardist hired, then removed them from their jobs, then removed compatibility, the game would not load anymore.

Please ensure that you can safely remove this addon from Minecolonies without saves becoming corrupted.

Edit: Got a log for you https://gist.github.com/Neuromancer815/4c72c92f2e59db453f3ea76895626588 There seems to be something in our crafting system that is not too happy about something you've added

[19Aug2024 22:18:03.691] [Server thread/ERROR] [net.minecraft.server.network.ServerLoginPacketListenerImpl/]: Couldn't place player in world
java.lang.NullPointerException: Cannot write a null registry entry!
    at java.util.Objects.requireNonNull(Objects.java:233) ~[?:?]
    at net.minecraftforge.common.extensions.IForgeFriendlyByteBuf.writeRegistryId(IForgeFriendlyByteBuf.java:83) ~[forge-1.20.1-47.2.17-universal.jar%23699!/:?]
    at com.minecolonies.core.colony.requestsystem.resolvers.factory.PrivateWorkerCraftingProductionResolverFactory.serialize(PrivateWorkerCraftingProductionResolverFactory.java:79) ~[minecolonies-1.1.636-1.20.1-beta.jar%23598!/:1.1.636-1.20.1-beta]
Neuromancer815 commented 3 weeks ago

hours and hours of progress lost upon removing this mod, thanks gisellevonbingen, great work mate

gisellevonbingen commented 3 weeks ago

Is that my fault? Mod is removed. there are nothing i can. I thinks need null check at there.

Thodor12 commented 3 weeks ago

You should remove the custom thing you have injected into the request system, that is causing 100% of all of the faults we are seeing so far. Whatever you are doing, it shouldn't need custom things injected into the request system.

gisellevonbingen commented 3 weeks ago

'Couldn't place player in world java.lang.NullPointerException: Cannot write a null registry entry!' is mean job entry not found. That is, it MineColonies missing handling about removed job.

And I created JobEntry using MineColonies's API. (JobEntry.Builder) Even if I don't use mixins, that error will still occur if mod removed.

Thodor12 commented 3 weeks ago

That is not at all what the exception is saying: at com.minecolonies.core.colony.requestsystem.resolvers.factory.PrivateWorkerCraftingProductionResolverFactory.serialize(PrivateWorkerCraftingProductionResolverFactory.java:79)

This is a crafting factory resolver, something tying into the request system.

Job entries we've also had crashes on but we've fixed that one, but regardless, you should be providing guides how to safely uninstall this mod.

It shouldn't be the case that if players remove your mod worlds are getting corrupted. Make an uninstallation guide telling people what to remove. Currently we're doing your homework making fixes that prevents people from losing their world where-as you're making more and more things breaking our systems.

gisellevonbingen commented 3 weeks ago
  1. PrivateWorkerCraftingProductionResolver is remained if job removed.
  2. But jobEntry is can't deserialize, so it will be null.
  3. So that bug will occured.

Also, I saw https://github.com/ldtteam/minecolonies/pull/10140. Yours know the solution already.

Nothing guide for remove. Just remove that is all.

Thodor12 commented 3 weeks ago

Yeah because we had to, once again, spend 3 hours of support time trying to recover a broken world, which should be your job.

That's when we found the exception, so I sent that to Ray.

If you're modifying a bunch of our code, provide a migration guide on steps you have to take to safely remove this mod without causing crashes (request system reset, fire workers, etc).

You're still putting zero effort to take care of support of your own mod, and still letting us do all of the work. I don't care how you're going to do it, in-game startup message or what not, but you're going to have to inform your users that you are messing with Minecolonies and YOU are going to take all support.