modularforcefieldsystem icon indicating copy to clipboard operation
modularforcefieldsystem copied to clipboard

crash with ic2 classic

Open Trinsdar opened this issue 6 years ago • 1 comments

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?

Trinsdar avatar Feb 15 '19 20:02 Trinsdar

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.

Chocohead avatar Feb 16 '19 02:02 Chocohead