Choonster Posted September 23, 2015 Posted September 23, 2015 I've run into a strange issue where using a lambda to implement ItemMeshDefinition crashes the game with an AbstractMethodError any time the item is rendered in a GUI. This only happens in the obfuscated client, not in the development environment. I've set up a small test case here. The lambda is used here. To reproduce, simply open the mod's creative tab or spawn in its block. The block will render without issue in the world, but as soon as it's rendered in a GUI or a player's hand the game crashes. You can see the crash report here. Does anyone know why this happens or how to fix it? It seems like it may be some weird interaction between lambdas and the reobfuscation process. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
kauan99 Posted September 23, 2015 Posted September 23, 2015 I don't know much about 1.8 or models, but that lambda seems weird... Are you sure that's what you meant to write? Quote WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons
Choonster Posted September 23, 2015 Author Posted September 23, 2015 I don't know much about 1.8 or models, but that lambda seems weird... Are you sure that's what you meant to write? Yes, it's just mapping to a constant model location regardless of the ItemStack 's metadata/NBT. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
kauan99 Posted September 23, 2015 Posted September 23, 2015 java thinks you're invoking an interface method without implementation though. well if only I knew more about that model stuff... Quote WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons
Choonster Posted September 23, 2015 Author Posted September 23, 2015 java thinks you're invoking an interface method without implementation though. well if only I knew more about that model stuff... Lambdas can be used in place of any interface with a single method (like ItemMeshDefinition ), they act like an implementation of the interface with the lambda's body as the method body. This works in the development environment, just not in the obfuscated client. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
kauan99 Posted September 23, 2015 Posted September 23, 2015 I didn't know there was such interface. then your lambda seems fine. maybe it's the java version you're targeting? I don't know the language used in build.gradle, but maybe there's something wrong there? for instance, I was told I should choose java version for building using these lines: sourceCompatibility = 1.8 targetCompatibility = 1.8 but you do something different. Quote WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons
Choonster Posted September 23, 2015 Author Posted September 23, 2015 Thanks diesieben07, that works perfectly. I looked at the bytecode earlier using Bytecode Viewer and noticed the INVOKEDYNAMIC instruction (though I wasn't fully aware of what it did), but it seems that the program doesn't know how to display it properly. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.