Posted March 8, 201510 yr 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 Is this something I can 'fix', or is it not an issue? http://i.imgur.com/NdrFdld.png[/img]
March 8, 201510 yr 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; } http://i.imgur.com/NdrFdld.png[/img]
March 8, 201510 yr 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... :\ http://i.imgur.com/NdrFdld.png[/img]
March 8, 201510 yr 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! http://i.imgur.com/NdrFdld.png[/img]
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.