desht / ModularRouters

A Forge Mod for item routers with pluggable modules
16 stars 20 forks source link

OreDictMatch logic filter can pass invalid stack to OreDictionary.getOreIDs #54

Closed noobanidus closed 5 years ago

noobanidus commented 5 years ago

Minecraft Version

1.12.2

Forge Version

2836

Mod Version

1.12.2-3.2.1

Describe your problem, including steps to reproduce it

No steps for repeating it. Simply a check to make sure the item is valid at some point in the chain to prevent erroring tile entities. See crash log: crash-2019-06-25_12.23.52-server.txt

Any other comments?

desht commented 5 years ago

This happened because an ItemStack.EMPTY was passed into the ore dict matcher, which isn't valid. Under normal circumstances, this shouldn't happen, since empty itemstacks are never saved to the module's filter NBT. However, if a mod were to be removed, the module stack would contain effectively invalid NBT - upon deserialization, the filter would contain an empty item. I suspect that's what's happened here.

Easy fix, anyway - also validate and ignore empty itemstacks when the filter is deserialized from the module itemstack.

desht commented 5 years ago

Fixed in 3.2.2 release