Jump to content

[1.19.2] Interface method isn't being recognised as implemented, but it totally is?


Recommended Posts

Posted

I got this crash while running my mod on the Forge client
https://pastebin.com/GkGJi2gx

java.lang.AbstractMethodError: Receiver class com.solegendary.reignofnether.unit.units.villagers.IronGolemUnit does not define or inherit an implementation of the resolved method 'abstract float getAttackDamage()' of interface

For some context, I have an interface "AttackerUnit" with an abstract method "getAttackDamage" defined here:

https://github.com/SoLegendary/reignofnether/blob/1.19/src/main/java/com/solegendary/reignofnether/unit/interfaces/AttackerUnit.java#L28

A few of my mod's mobs implement AttackerUnit, including my IronGolemUnit and VindicatorUnit, defined here:
https://github.com/SoLegendary/reignofnether/blob/1.19/src/main/java/com/solegendary/reignofnether/unit/units/villagers/IronGolemUnit.java#L75

https://github.com/SoLegendary/reignofnether/blob/1.19/src/main/java/com/solegendary/reignofnether/unit/units/villagers/VindicatorUnit.java#L84

 

I am very confused as to why the client thinks that method isn't implemented when it clearly is, right there on line 75. IntelliJ would have highlighted a build error and not allowed me to compile. Even weirder is that my other AttackerUnit classes like the VindicatorUnit implement the method in the exact same way and they DO work, it's the just the IronGolemUnit that causes this crash. As far as I can tell they're implemented in identical ways.

Additionally, for some reason this crash ONLY happens on the Forge client. When I run the code on my local testing environment (single player and multiplayer) it works completely fine.

 

Posted

Ok actually I just realised it may be related to the fact that the vanilla IronGolem class already has a getAttackDamage method so maybe the client thinks i'm trying to override that instead of implementing the attackerUnit method?

I'm still confused as to why this only happens in the Forge client and not my local environment though. If anyone can please enlighten me that would be great to avoid issues like this in the future.

Posted

Obfusication, thats why. During runtime the vanilla methods are named with SRG names. So m_12345_ not getAttackDamage.

You'll need to pick a different name for your interface.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.