In my mod, EnFusion (http://github.com/shadowfacts/enfusion), I have a RF generating block which is a solar panel. For some unknown reason the data in my TileEntity won't get saved to NBT. Here's the TileEntitySolarPanel class: http://github.com/shadowfacts/EnFusion/blob/master/src/main/java/net/shadowfacts/enfusion/machine/generator/solar/TileEntitySolarPanel.java.
Every time the addDataToNBT is called, Minecraft spews out this message to the log:
[21:33:53] [server thread/ERROR] [FML]: A TileEntity type net.shadowfacts.enfusion.machine.generator.solar.TileEntitySolarPanel has throw an exception trying to write state. It will not persist. Report this to the mod author
java.lang.RuntimeException: class net.shadowfacts.enfusion.machine.generator.solar.TileEntitySolarPanel is missing a mapping! This is a bug!
at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:96) ~[TileEntity.class:?]
at net.shadowfacts.shadowcore.tileentity.BaseModTileEntity.writeToNBT(BaseModTileEntity.java:20) ~[baseModTileEntity.class:?]
at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:395) [AnvilChunkLoader.class:?]
at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:204) [AnvilChunkLoader.class:?]
at net.minecraft.world.gen.ChunkProviderServer.safeSaveChunk(ChunkProviderServer.java:287) [ChunkProviderServer.class:?]
at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:340) [ChunkProviderServer.class:?]
at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:862) [WorldServer.class:?]
at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:370) [MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:113) [integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
Note: My tile entity class extends a custom modified TileEntity which is here: https://github.com/shadowfacts/ShadowCore/blob/master/src/main/java/net/shadowfacts/shadowcore/tileentity/BaseModTileEntity.java.
I'm not sure but I think the problem is when Minecraft tries to turn the name of my tile entity into a string at line 92 of the default TileEntity.java. If anyone knows what I'm doing wrong, help would be greatly appreciated .
P.S. Feel free to submit a pull request on GitHub (http://github.com/shadowfacts/EnFusion/pulls).