LootTweaker

LootTweaker

17M Downloads

Attempting to get the loot pool for a mod-added pool causes error

belathus opened this issue ยท 6 comments

commented

I get the following error when attempting to get a pool:

https://gist.github.com/belathus/1618116e7b3db66c2e7667f08fbd2520

My code looks like what is posted below, and is referencing this dumped loot table: https://github.com/belathus/Wanderlust-Renewed/blob/master/dumps/loot_tables/levelup/digging/common_dig.json

import loottweaker.vanilla.loot.LootTables;
import loottweaker.vanilla.loot.LootTable;
import loottweaker.vanilla.loot.LootPool;
import loottweaker.vanilla.loot.Conditions;
import loottweaker.vanilla.loot.Functions;

# Level Up
    val digCommon =   LootTables.getTable("levelup:digging/common_dig");
    val digUncommon = LootTables.getTable("levelup:digging/uncommon_dig");
    val digRare =     LootTables.getTable("levelup:digging/rare_dig");
    val digCommonPool =   digCommon.getPool("common_treasure");

The full script is mostly commented out, but it is here: https://github.com/belathus/Wanderlust-Renewed/blob/master/scripts/loot.zs

I'm not sure if I'm doing something wrong or what. The error doesn't make much sense to me.

commented

LootTweaker version please

commented

Ah, my mistake. 1.10.2-0.0.6.1

commented

And now I see the message on Curseforge about 0.0.6.1. I'll try updating it.

commented

@belathus Did 0.0.6.2 solve this issue?

commented

I'm getting other errors. I'm trying to work my way through them, as I've found a few errors in my script. If I come across something that I can't fix, I'll comment here again about it.

commented

Okay, I'm getting the following error when I try to remove something from LevelUp!'s digging common loot pool (which the dump is here, and the script and line causing the error is here):

[SERVER_STARTED][SERVER][ERROR] Error executing loot.zs: null
java.lang.NullPointerException
	at leviathan143.loottweaker.common.zenscript.ZenLootPoolWrapper$RemoveLootEntry.describe(ZenLootPoolWrapper.java:252)
	at minetweaker.runtime.MTTweaker.apply(MTTweaker.java:37)
	at minetweaker.MineTweakerAPI.apply(MineTweakerAPI.java:137)
	at leviathan143.loottweaker.common.zenscript.ZenLootPoolWrapper.removeEntry(ZenLootPoolWrapper.java:68)
	at leviathan143.loottweaker.common.zenscript.ZenLootPoolWrapper.removeItemEntry(ZenLootPoolWrapper.java:51)
	at Loot.__script__(loot.zs:48)
	at __ZenMain__.run(loot.zs)
	at minetweaker.runtime.MTTweaker.load(MTTweaker.java:147)
	at minetweaker.MineTweakerImplementationAPI.reload(MineTweakerImplementationAPI.java:507)
	at minetweaker.MineTweakerImplementationAPI.lambda$static$0(MineTweakerImplementationAPI.java:70)
	at minetweaker.MineTweakerImplementationAPI$3.execute(MineTweakerImplementationAPI.java:492)
	at minetweaker.mc1102.server.MCServer$MCCommand.func_184881_a(MCServer.java:110)
	at net.minecraft.command.CommandHandler.func_175786_a(CommandHandler.java:104)
	at net.minecraft.command.CommandHandler.func_71556_a(CommandHandler.java:83)
	at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:913)
	at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:892)
	at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(SourceFile:37)
	at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(SourceFile:9)
	at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at net.minecraft.util.Util.func_181617_a(SourceFile:45)
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:668)
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:613)
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:149)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:471)
	at java.lang.Thread.run(Thread.java:745)