GaeaKat / modularforcefieldsystem-1.12

modularforcefieldsystem
Other
14 stars 21 forks source link

crash with ic2 classic #41

Open Trinsdar opened 5 years ago

Trinsdar commented 5 years ago

so I ran this with ic2 classic and it crashed saying an int was being casted to a collection. https://paste.dimdev.org/uroyejiqun.sql

minecraft 1.12.2 forge 14.23.5.2811 mfss 1.12 4.0.1

I'm guessing this line somehow doesn't work with ic2 classic?

https://github.com/nekosune/modularforcefieldsystem/blob/fc0616f53af992b94fa0c2c63d9f9d07dec14ffa/src/main/java/com/nekokittygames/mffs/common/MFFSRecipes.java#L44

Maybe an if loaded check should be added for that line that checks if ic2 classic is not loaded?

Chocohead commented 5 years ago

That's a bug in Classic's ropey API support. Recipes#matterAmplifier is defined as a map from IRecipeInput to Integers that is applied to ItemStacks. Classic's BasicMachineRecipeList#toIC2Exp raw casts an anonymous IBasicMachineRecipeManager which is only really designed for IRecipeInput to Collection<ItemStack> (applied to ItemStacks). For your macerator type machine that is fine as they're defined using that, but for any of the others this will result in class cast exceptions as Java isn't type checking if the casts are really valid until runtime.

MFFS should work fine otherwise as it is using the API correctly everywhere as far as I can tell.