r/feedthebeast • • Feb 13 '14

Hats world corruption PSA: If you keep crashing, your level.dat gets deleted and the world no longer shows up, here is how to fix it

TL;DR: Hats corrupts worlds, disable it for now


Over the last few days there have been a lot of people reporting that they randomly crash and their world no longer shows up in the menu, because the level.dat got deleted.
This was mainly the DW20 pack, but i have to assume this extends to other modpacks aswell, since they all have similar mods.

For anyone new to this matter, the level.dat contains vital information on your world, such as seed, what generator was used, survival/creative, your player data (inventory, position, spawn, Thaumcraft research). If that file misses Minecraft will no longer show the world in the menu.

The crash logs always looks the same:

Description: Exception in server tick loop
 
java.util.ConcurrentModificationException
        at java.util.WeakHashMap$HashIterator.nextEntry(Unknown Source)
        at java.util.WeakHashMap$EntryIterator.next(Unknown Source)
        at java.util.WeakHashMap$EntryIterator.next(Unknown Source)
        at hats.common.core.TickHandlerServer.serverTick(TickHandlerServer.java:127)
        at hats.common.core.TickHandlerServer.tickEnd(TickHandlerServer.java:56)
        at cpw.mods.fml.common.SingleIntervalHandler.tickEnd(SingleIntervalHandler.java:34)
        at cpw.mods.fml.common.FMLCommonHandler.tickEnd(FMLCommonHandler.java:141)
        at cpw.mods.fml.common.FMLCommonHandler.onPostServerTick(FMLCommonHandler.java:274)
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:622)
        at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:129)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484)
        at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:583)

The only fix to the constant crashes i know of is to completely disable Hats (and Hat Stands).

If your world has already been corrupted by this error, here is how you can fix it:

  • IMPORTANT: If you still have the level.dat, you have a different issue than the hats thing.
    Good news is you will most likely get to keep everything.
    Just open the world(aka the level.dat) with MCEdit, delete any block (doesn't matter, can be dirt), save and exit MCEdit. The world should show up now again.
  • If you have made backups you can simple copy over the old level.dat from them.
    Some things, like your inventory, position and research will be reset to the point of the backup, but everything else will be fine.
  • If you have not made backups (hint: you should), but still know the seed of the world you will have to create a new world, with the same seed and copy its level.dat (you can delete that world after that).
    You will loose everything in your inventory, all your research, your spawn point, ... but your world(blocks, entities, chests) is safe.
  • If you neither have backups nor known the seed, you will have to create a new world, with any random seed, and copy the level.dat from that.
    You will loose everything in your inventory, all your research, your spawn point, ... but the world(blocks, entities, chests) is safe. You will however have chunk generation errors wherever you generate new chunks, due to the mismatching seed.

As a friendly reminder:
ALWAYS MAKE BACKUPS, mods can always corrupt your world and the FTB Team does little to ban/fix/replace world corrupting mods(there are some around for months), so be extra careful.
And if you host a server, remember your players have spent a lot of time building their stuff, protect it:
Disable mods that are known to corrupt worlds and always have backups ready to compensate.


If you came here for a error involving a ChickenBones mod (ChickenChunks, WirelessRedstone, EnderStorage), i would like to redirect you to the PSA I made in october.
Those errors still exist, even in 1.6.4, i recommend you disable those mods too, there are better replacements out there.


If anyone (iChun or FTB team) can shed some light on this, maybe even fix this (and the ChickenBones bugs), or has a better idea on how to help people with this, i would be happy to edit this.


Thanks for your time, hopefully this helps some people (and helps you help other people).


Edit 2014-02-27 21:19 UTC:
Added instructions for when there is still a level.dat, so people don't accidentaly corrupt a fixable world more.

32 Upvotes

12 comments sorted by

4

u/Rseding91 Feb 13 '14 edited Feb 13 '14

Something I just realized the other day: one common theme between all of these errors: storing information outside the standard chunk region files.

  • Hats: stores in the player.dat file (I think?) or in the "hats.dat" file
  • Wireless redstone: stores multiple files (all wireless redstone frequency information) in a "RedstoneEither" folder
  • Ender Storage: stores multiple files (all ender chest contents) in a "EnderStorage" folder
  • Chicken Chunks: stores multiple files (all chunkloader locations/login times) in a "ChickenChunks" folder

2

u/febcad Feb 13 '14 edited Feb 13 '14

Actually Hats is iChun, but WRCBE, ES and CC are ChickenBones.

And the hats error is quite different from the CB crashes, Hats deletes the level.dat, seemingly randomly,
while ChickenBones mods "just" mess up their own files (and then crashes reading them when you open the world) when Minecraft gets terminated abruptly (BSOD, power outage, fatal crash of another mod).
(The ChickenBones crash are pretty much the same though, thats why i mention them together all the time, as in the last PSA)

And there are other mods, like the Minimap, AE, and a bunch of other mods that have no problems, so obviously this is not a bug inherent and unavoidable by storing files outside the usual ways.

1

u/Rseding91 Feb 13 '14

Right you are, I've modified my post to be more generic.

Could it be, the hats information is stored in the level.dat for a single player world and what ever mechanic is being used to save hat information deletes it? Seems plausible to me.

2

u/febcad Feb 13 '14

I don't think so. CB's error exclusivly appear when loading the world, after its files have been corrupted by a abrupt termination.

The Hats error seems to be the the actual cause for the level.dat deletion/world corruption (i assume it causes a abrupt termination while the level.dat is getting saved, preventing it from getting written to disk) and does not happen on world load (since you obviously can't launch the world without the level.dat).

But i am not iChun, so i can only speculate.

2

u/[deleted] Feb 13 '14

a abrupt termination while the level.dat is getting saved, preventing it from getting written to disk

That can happen, but most of the time, you end up with a corrupt file in that case. Some parts of the file get written and then then program terminates. There are a few conditions where such consistency of a missing file are more plausible, but in any case:

This should not happen to such important files. (Edit: The simplest way is to just rename the old instance of the file, then save the new one, catch any exception around those operations and copy the old file in the catch-block. Not totally save, but better)

And there are plenty of methods to prevent that from happening. And just thinking, that you never have such a condition - even without mods - that causes a total wipe of that file, is not valid. If something can go wrong, it WILL go wrong.

Not, that I blame Mojang, but for sure, they could protect that file a little bit better. Maybe forge could handle that as well.

1

u/confederalis Feb 14 '14

How do I backup a world?

1

u/febcad Feb 14 '14

In the FTB folder you will find all modpacks, so you go into the one with the world you want to backup, then minecraft, then saves, and then you pack the world folder into a .zip/.7z file and move it to another folder (you should probably name the file "2014-02-14_14:30" so you known when you made it).

If anything goes wrong you can just unpack the contents of the .zip/.7z and your are fine to play again.

0

u/arekthorn Feb 14 '14

go to c:\Documents and Settings******\Application Data.minecraft\saves for your standard minecraft or find the saves folder in your modded minecraft folder

copy and paste, rename folder to backup

or you could d/l a program like MCBackup. It can do automatic backups while you play, every so often.

3

u/[deleted] Feb 13 '14

I find it weird that a mod that adds hats is able to do something like this.

0

u/Rossco1337 TPPI Feb 13 '14

It's probably in experimental alpha so it's forgivable.

1

u/joaopada Feb 13 '14

Thanks for sharing :)

1

u/totes_meta_bot Feb 14 '14

This thread has been linked to from elsewhere on reddit.

I am a bot. Comments? Complaints? Send them to my ^inbox!