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.

Featured Replies

Posted

Forge Version: 11.14.3.1487

 

Basic Setup:

I've created a Helper Interface for Gui Elements called GuiElement, so my custom Gui Elements provide some basic methods like isHovering(), mouseClick() or setEnabled().

 

In my case I created a GuiAdvancedTextField, which extends GuiTextField and implements GuiElement.

To satisfy the interface, I override

void setEnabled(boolean enabled);

 

When calling this Method while in the Development Environment, everything works fine, but after compiling the following error occurs:

java.lang.AbstractMethodError: somepackets.GuiAdvancedTextField.setEnabled(Z)V

 

As far as I understand, this is caused by setEnabled both overriding GuiTextField's setEnabled method with the same signature and implementing GuiElement's setEnabled method where GuiTextField doesn't implement GuiElement.

Renaming the interface's setEnabled method to setElementEnabled was a functioning workaround.

 

Thanks in advance for the fix,

Pixel

  • Author

Thanks, this worked, but your example was wrong - you need the Method's return type in the signature.

What worked for me:

srgExtra "MD: my/mod/my/packages/GuiElement/setEnabled (Z)V my/mod/my/packages/GuiElement/func_146184_c (Z)V"

  • Author

No problem, didn't take too long to figure that out.

I've decided to rename the interface's method now anyway, because of the possibility of other "native" Gui Elements having a method with the setEnabled(Z)V signature, and in that case, it wouldn't work again.

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.