Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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.

ย 

  • Author

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.