ChaKha Posted January 19, 2016 Share Posted January 19, 2016 Hello, So I've been trying to get this ItemBlock going, but I've run into a snag. These two methods: @SideOnly(Side.CLIENT) @Override public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) @SideOnly(Side.CLIENT) @Override public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) I'm trying to override these methods from the original ItemBlock/Item classes, but I keep recieving the message (from eclipse) that I can't override them and that it's causing a name clash. Any solutions or work-arounds would be greatly appreciated. Edit: Using forge version 1.8-11.14.4.1577. Quote Link to comment Share on other sites More sharing options...
Draco18s Posted January 19, 2016 Share Posted January 19, 2016 Have you included only method stubs here, or are you actually defining them as methods with { } (optionally with code in between)? Quote 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. Link to comment Share on other sites More sharing options...
ChaKha Posted January 19, 2016 Author Share Posted January 19, 2016 I definitely included more than just the method stubs, sorry if it wasn't clear that I was omitting the rest of the code! Quote Link to comment Share on other sites More sharing options...
jabelar Posted January 19, 2016 Share Posted January 19, 2016 It usually means that you either did not make your class properly extend the parent class (i.e. there are no parent methods to override), or it means that you didn't exactly get the prototype of the method correct (either the return type or the parameter list differs from the parent method). Can you just post the whole code for your class? Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
Draco18s Posted January 19, 2016 Share Posted January 19, 2016 I definitely included more than just the method stubs, sorry if it wasn't clear that I was omitting the rest of the code! I asked because the way you posted it, you posted an abstract method, which has different rules. Quote 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. Link to comment Share on other sites More sharing options...
jeffryfisher Posted January 19, 2016 Share Posted January 19, 2016 The super profile for addInformation (as of mc 1.8 ): @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) {} It looks as if you qualified the List in yours. And getSubitems: @SideOnly(Side.CLIENT) public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { this.block.getSubBlocks(itemIn, tab, subItems); } It looks as if you again added a qualifier to your List. If these are still like this in 1.8.9, then try again without qualifiers. If that works, and you still want to enforce the nature of the lists, then you might need a runtime data-integrity check. Quote The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting. Link to comment Share on other sites More sharing options...
Choonster Posted January 19, 2016 Share Posted January 19, 2016 The super profile for addInformation (as of mc 1.8 ): @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) {} It looks as if you qualified the List in yours. And getSubitems: @SideOnly(Side.CLIENT) public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { this.block.getSubBlocks(itemIn, tab, subItems); } It looks as if you again added a qualifier to your List. If these are still like this in 1.8.9, then try again without qualifiers. If that works, and you still want to enforce the nature of the lists, then you might need a runtime data-integrity check. 1.8.8 added generics to vanilla code. The OP has the correct method signatures. Edit: The title says 1.8.9, but the OP is actually using 1.8; so there aren't any generics. Quote Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future. Link to comment Share on other sites More sharing options...
ChaKha Posted January 20, 2016 Author Share Posted January 20, 2016 Alright, so Jabelar and jeffryfisher were correct, I had overlooked the parameters (the lists in specific). All I needed to do was to correct them as jeffryfisher had done above. Thanks all of you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.