LootTweaker

LootTweaker

17M Downloads

Crash when silverfish was suffocated with a gravel block

Lothrazar opened this issue ยท 3 comments

commented

Please fill out all applicable sections in the template below:

Description:
Crash when silverfish was suffocated with a gravel block

Steps to reproduce:
suffocated with a gravel block
Script Used
val silverPool = LootTables.getTable("minecraft:entities/silverfish").addPool("OPNC", 1, 1, 1, 1);
silverPool.addItemEntryHelper(minecraft:iron_nugget, 50, 5, [Functions.parse("count:{min:1.0,max: 9.0}, function: 'minecraft:set_count'")], []);

Version Info(Exact versions only):
LootTweaker:
LootTweaker-1.11.2-0.0.6.2
CraftTweaker:
CraftTweaker-1.11.2-3.0.25
Forge:
13.20.0.23.11
Minecraft: 1.11.2

Logs and other useful information:

Time: 6/11/17 8:07 PM
Description: Ticking entity

com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: Attempted to modify LootPool after being frozen!
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827)
at net.minecraft.world.storage.loot.LootTableManager.func_186521_a(LootTableManager.java:39)
at net.minecraft.entity.EntityLiving.func_184610_a(EntityLiving.java:633)
at net.minecraft.entity.EntityLivingBase.func_70645_a(EntityLivingBase.java:1149)
at net.minecraft.entity.EntityLivingBase.func_70097_a(EntityLivingBase.java:990)
at net.minecraft.entity.monster.EntityMob.func_70097_a(SourceFile:67)
at net.minecraft.entity.monster.EntitySilverfish.func_70097_a(SourceFile:112)
at net.minecraft.entity.EntityLivingBase.func_70030_z(EntityLivingBase.java:230)
at net.minecraft.entity.EntityLiving.func_70030_z(EntityLiving.java:279)
at net.minecraft.entity.Entity.func_70071_h_(Entity.java:378)
at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2006)
at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:384)
at net.minecraft.entity.monster.EntityMob.func_70071_h_(SourceFile:46)
at net.minecraft.entity.monster.EntitySilverfish.func_70071_h_(SourceFile:126)
at net.minecraft.world.World.func_72866_a(World.java:1965)
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:840)
at net.minecraft.world.World.func_72870_g(World.java:1934)
at net.minecraft.world.World.func_72939_s(World.java:1748)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:621)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:720)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:624)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:240)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Attempted to modify LootPool after being frozen!
at net.minecraft.world.storage.loot.LootPool.checkFrozen(LootPool.java:98)
at net.minecraft.world.storage.loot.LootPool.addEntry(LootPool.java:129)
at leviathan143.loottweaker.common.zenscript.ZenLootPoolWrapper$AddLootEntry.applyTweak(ZenLootPoolWrapper.java:223)
at leviathan143.loottweaker.common.zenscript.ZenLootPoolWrapper$AddLootEntry.applyTweak(ZenLootPoolWrapper.java:199)
at leviathan143.loottweaker.common.zenscript.ZenLootPoolWrapper.applyLootTweaks(ZenLootPoolWrapper.java:190)
at leviathan143.loottweaker.common.zenscript.ZenLootTableWrapper$AddPool.applyTweak(ZenLootTableWrapper.java:133)
at leviathan143.loottweaker.common.zenscript.ZenLootTableWrapper$AddPool.applyTweak(ZenLootTableWrapper.java:110)
at leviathan143.loottweaker.common.zenscript.ZenLootTableWrapper.applyLootTweaks(ZenLootTableWrapper.java:90)
at leviathan143.loottweaker.common.tweakers.loot.LootTableTweaker.applyTweaks(LootTableTweaker.java:60)
at leviathan143.loottweaker.common.tweakers.loot.LootTableTweaker.onTableLoad(LootTableTweaker.java:53)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_141_LootTableTweaker_onTableLoad_LootTableLoadEvent.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185)
at net.minecraftforge.event.ForgeEventFactory.loadLootTable(ForgeEventFactory.java:688)
at net.minecraftforge.common.ForgeHooks.loadLootTable(ForgeHooks.java:1162)
at net.minecraft.world.storage.loot.LootTableManager$Loader.func_186518_c(LootTableManager.java:148)
at net.minecraft.world.storage.loot.LootTableManager$Loader.load(LootTableManager.java:71)
at net.minecraft.world.storage.loot.LootTableManager$Loader.load(LootTableManager.java:52)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
... 27 more

commented

I'm gonna close this since I can't reproduce it, it's a weird bug in the first place, and I'm pretty sure whatever it is should have been fixed by the fix for #25.

commented

Update: it worked if i changed the script to this

val silverPool = LootTables.getTable("minecraft:entities/silverfish").addPool("OPNC", 1, 1, 1, 1);
silverPool.addItemEntryHelper(minecraft:iron_nugget* 4, 50, 5, [], [Conditions.killedByPlayer()]);

commented

Failed to reproduce using listed versions and supplied script.

I have no idea what's going on here. This should be physically impossible, unless another mod is firing LootTableLoadEvent after LootTables are frozen.