Recurrent Complex

Recurrent Complex

35M Downloads

Unable to save custom loot generator

Saereth opened this issue ยท 2 comments

commented

version 1.2.4
ivtoolkit version 1.2.9

When trying to save a cutom generator with only an enderpearl (or any loot) I get the message in game, "Failed to save inventory_generation_component to 'inactive/test'"

the server throws this message in the console:

[18:38:09] [Server thread/ERROR] [reccomplex]: No entry found: test in
java.util.NoSuchElementException
at ivorius.reccomplex.files.saving.FileSaver.forceGet(FileSaver.java:38) ~[FileSaver.class:?]
at ivorius.reccomplex.files.saving.FileSaver.save(FileSaver.java:104) ~[FileSaver.class:?]
at ivorius.reccomplex.files.saving.FileSaver.trySave(FileSaver.java:83) ~[FileSaver.class:?]
at ivorius.reccomplex.network.PacketSaveInvGenComponentHandler.processServer(PacketSaveInvGenComponentHandler.java:48) ~[PacketSaveInvGenComponentHandler.class:?]
at ivorius.reccomplex.network.PacketSaveInvGenComponentHandler.processServer(PacketSaveInvGenComponentHandler.java:28) ~[PacketSaveInvGenComponentHandler.class:?]
at ivorius.ivtoolkit.network.SchedulingMessageHandler.lambda$onMessageServer$51(SchedulingMessageHandler.java:32) ~[SchedulingMessageHandler.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_111]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_111]
at net.minecraft.util.Util.func_181617_a(SourceFile:45) [h.class:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:668) [MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:387) [ld.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:613) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]

commented

Can you attach the full log?

commented

Ivor, I took a look

    public FileSaverAdapter register(FileSaverAdapter adapter)
    {
        if (adapters.containsKey(adapter.getId()))
            throw new IllegalArgumentException();

        return adapters.put(adapter.getId(), adapter);
    }

Reccomplex is registering with the adapter's id rather than suffix. But when it goes to get it out of the hashtable, it uses this

if (RCCommands.informSaveResult((message.getInventoryGenerator() != null && id != null) &&
                RecurrentComplex.saver.trySave(saveDir.toPath(), RCFileSuffix.INVENTORY_GENERATION_COMPONENT, id), player, saveDir.subDirectoryName(), RCFileSaver.INVENTORY_GENERATION_COMPONENT, id))
        {

Which means it's registered as 'inventory_generation_component' but reccomplex tries to look it up by 'rcig' and can't find it.

I think that's the issue. I've also experience the problem. Depending on what depends on it, maybe patch RCRegistryHandler but more likely PacketSaveInvGenComponentHandler since it seems to be the single point of failure.