Saving doesn't work

Create issue
Issue #37 resolved
Fabian Maurer created an issue

Using 0.3.3 alpha.

Saving doesn't work. The following code (used with a scriptpack, num is in SavedVariables):

if(not num) then
 num = {};
 num[0] = 0;
 else
  num[0] =  num[0]+1;
 end
say "num: ".. num[0];

produces this exception:

Saving SavedVariables for 'Skeleton'
2014-06-19 05:30:48 [WARNING] [MobTalker2] [S] Unable to serialize variable num!
java.lang.NullPointerException
    at mobtalker2.server.script.serialization.MtsToNbtSerializer.serialize(MtsToNbtSerializer.java:16)
    at mobtalker2.server.script.serialization.MtsToNbtSerializer.serialize(MtsToNbtSerializer.java:11)
    at mobtalker2.server.script.serialization.MtsToNbtSerializer.serializeTable(MtsToNbtSerializer.java:79)
    at mobtalker2.server.script.serialization.MtsToNbtSerializer.serialize(MtsToNbtSerializer.java:34)
    at mobtalker2.server.script.serialization.MtsToNbtSerializer.serializeTo(MtsToNbtSerializer.java:44)
    at mobtalker2.server.script.InteractionScript.saveBindingsToNBT(InteractionScript.java:87)
    at mobtalker2.server.entity.BasicInteractionAdapter.saveSavedVariablesToNBT(BasicInteractionAdapter.java:547)
    at mobtalker2.server.entity.BasicInteractionAdapter.saveNBTData(BasicInteractionAdapter.java:517)
    at net.minecraft.entity.Entity.func_70109_d(Entity.java:1581)
    at net.minecraft.entity.Entity.func_70039_c(Entity.java:1545)
    at net.minecraft.world.chunk.storage.AnvilChunkLoader.func_75820_a(AnvilChunkLoader.java:292)
    at net.minecraft.world.chunk.storage.AnvilChunkLoader.func_75816_a(AnvilChunkLoader.java:127)
    at net.minecraft.world.gen.ChunkProviderServer.func_73242_b(ChunkProviderServer.java:232)
    at net.minecraft.world.gen.ChunkProviderServer.func_73151_a(ChunkProviderServer.java:284)
    at net.minecraft.world.WorldServer.func_73044_a(WorldServer.java:901)
    at net.minecraft.server.MinecraftServer.func_71267_a(MinecraftServer.java:358)
    at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:124)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
    at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:582)

Comments (2)

  1. Log in to comment