MehVahdJukaar / SnowySpirit

Other
7 stars 14 forks source link

Loottable from Snowy Spirit tripping Lib39's Sandman #32

Closed SleepyEmber closed 1 year ago

SleepyEmber commented 1 year ago

1.19.2 Quilt 0.17.6

https://mclo.gs/rBK7o3c (not reproducible without yttr and kahur installed)

Reported to Lib39's repo - https://git.sleeping.town/unascribed/Lib39/issues/6

It seems Snowy Spirit is trying to initialize it's loottable upon an inventory being read?

MehVahdJukaar commented 1 year ago

I'm not sure what I would be doing wrong here. Loading up a loot table there should be completely valid. In fact it's the same exact thing that vanilla does when you open a treasure chest

unascribed commented 1 year ago

Yes, but I presume you shouldn't be throwing an exception when your inventory is being read? Sandman isn't doing anything weird, it just notices you implement Inventory and tries to read a stack.

I call out the loot table initialization because it seems like it's predicated on something having already been defined, but that won't necessarily be defined if someone else calls your method unqualified.

I'm adding a workaround to Sandman regardless.

MehVahdJukaar commented 1 year ago

I'm not throwing any exceptions. Infact I'm using same exact copy pasted code chest minecarts use https://github.com/MehVahdJukaar/SnowySpirit/blob/fadbfa1221dfeac3b3a8f414c762d2bbaba4610a/common/src/main/java/net/mehvahdjukaar/snowyspirit/common/entity/ContainerHolderEntity.java#L448

MehVahdJukaar commented 1 year ago

Not sure what you mean by all that. What would be "my method"?

unascribed commented 1 year ago

...Read the crash report linked in the OP.

java.lang.IllegalArgumentException: Parameters not allowed in this parameter set: [<parameter minecraft:killer_entity>]
    at net.minecraft.class_47$class_48.method_309(class_47.java:204)
    at net.mehvahdjukaar.snowyspirit.common.entity.ContainerHolderEntity.unpackLootTable(ContainerHolderEntity.java:463)
    at net.mehvahdjukaar.snowyspirit.common.entity.ContainerHolderEntity.method_5438(ContainerHolderEntity.java:328)
    at com.unascribed.lib39.sandman.TickAlwaysItemHandler.startServerWorldTick(TickAlwaysItemHandler.java:111)
    at net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents.lambda$static$6(ServerTickEvents.java:56)
    at org.quiltmc.qsl.lifecycle.api.event.ServerWorldTickEvents.lambda$static$0(ServerWorldTickEvents.java:39)
    at net.minecraft.class_3218.handler$kdn000$startTick(class_3218.java:15725)
    at net.minecraft.class_3218.method_18765(class_3218.java)
    at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:875)
    at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:819)
    at net.minecraft.class_1132.method_3748(class_1132.java:98)
    at net.minecraft.server.MinecraftServer.handler$ghh000$modifiedRunLoop(MinecraftServer.java:7385)
    at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:644)
    at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257)
    at java.base/java.lang.Thread.run(Thread.java:833)

I don't modify anything about how loot tables work; Sandman is literally just calling getStack on your entity. Something about your code or loot table is crashing, or this is a more complex mod conflict.

MehVahdJukaar commented 1 year ago

Seems like the method I copied included a forge patch.that exception doesn't even exist ok forge. I'll platform only it. Explains why I couldn't replicate