Jump to content

Recommended Posts

Posted

When trying to define an addInformation function to add lore to my custom item, the IDE is telling me that I am not overriding a method from it's superclass. Am I doing something wrong?

My function:

@Override
public void addInformation(ItemStack stack, PlayerEntity player, List list, boolean check) {
    list.add("Lorem ipsum for your troubled soul:");

}
Posted
3 minutes ago, PandaTobi said:

Am I doing something wrong?

Yes, you have marked a method with @Override but are not actually overriding a method. You need to correct the method signature so that you are overriding a method.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

@Draco18s I see what I did wrong. I was getting stuck on a part where I was trying to convert the String into a ITextComponent object, but it turns out that the inbuilt "func_241827_a_" function already did that. A bit of an odd naming scheme, but I like it! LOL.

Posted
41 minutes ago, PandaTobi said:

A bit of an odd naming scheme,

Its called a SRG name. Its an automatically assigned identifier by the decompilation process so that even as obfuscated names get shuffled and changed every time Mojang updates the game, the SRG names stay constant. But it means that when major versions happen the SRG -> MCP name identification and mapping needs to be rediscovered.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

@Draco18s I understand. Have a good day, and thank you for giving the time to help me!

 

I'll just post the working code here just to help any future users that happend to stumble across this thread:

@Override
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn)
{
    super.addInformation(stack, worldIn, tooltip, flagIn);

    tooltip.add(ITextComponent.func_241827_a_("'Lore'em Ipsum! Ha!"));
}

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.