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

I noticed this warning for the first time today:

RenderEntityKeese.java:48: warning: getEntityTexture (Entity) in RenderEntitykeese overrides getEntityTexture(Entity) in RenderBat; overridden method is a bridge method
     protected ResourceLocation getEntityTexture(Entity entity) {

 

Code responsible:

// RenderEntityKeese extends RenderBat
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return getEntityTexture((EntityKeese) entity); // this is exactly the same as how RenderBat overrides getEntityTexture
}

 

Which got me reading about bridge methods and type erasure, here, here, and here.

 

I tried various things to see if I could get the warning to go away to no avail. Everything seems to work fine, but I don't like getting warnings :P

 

Is this something I can 'fix', or is it not an issue?

  • Author

Ah, that makes sense. For whatever reason, I didn't put 2 and 2 together.

 

I was able to fix all but one of the warnings that way: I have a class that extends EntityVillager and overrides createChild(EntityAgeable), but I cannot change the parameter type without the method signature failing.

@Override
public EntityGoron createChild(EntityAgeable entity) {
EntityGoron goron = new EntityGoron(worldObj);
goron.onSpawnWithEgg(null);
goron.updateEntityAttributes(true);
return goron;
}

  • Author

Uh, but that's not a generic parameter as far as I can tell. Just using the EntityAgeable version should be fine.

In this case it's not a generic parameter, it's the covariant return type that is causing the bridge method to be created, but changing the return type to EntityVillager (or worse, EntityAgeable), even if it were an option, simply does not work to remove the warning.

 

If only I could magically absorb all knowledge of the JVM and javac... :\

  • Author

Ah, right. Well, the bridge method in EntityVillager is called func_180488_b, so that's what you have to override.

 

Edit: Err... *non-bridge.

Hm, in 1.8 yes, but in 1.7.10 the EntityVillager#createChild implementation doesn't call any other methods.

 

Well, I'll just ignore that one, then, since there doesn't seem to be anything to do about it until I update to 1.8. Thanks for the help!

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.