Jump to content

[SOLVED] [1.8] Strange AbstractMethodError Crash With Lambda


Choonster

Recommended Posts

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.

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.

Link to comment
Share on other sites

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?

WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons

Link to comment
Share on other sites

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.

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.

Link to comment
Share on other sites

java thinks you're invoking an interface method without implementation though. well if only I knew more about that model stuff...

WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons

Link to comment
Share on other sites

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.

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.

Link to comment
Share on other sites

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.

WIP mods: easyautomation, easyenergy, easyelectronics, easymoney, easytrasportation, easysecurity, easymultiverse, easyfactions, easymagick, easyalchemy, easyseasons

Link to comment
Share on other sites

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.

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.