Posted December 21, 201410 yr Code from 1.7.10: public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if(!par3World.isRemote && /*par3World.getBlockId(par4, par5, par6) == 2 &&*/ par2EntityPlayer.capabilities.isCreativeMode == false) { par2EntityPlayer.addExperienceLevel(1); par1ItemStack.damageItem(2, par2EntityPlayer); this.dropItemStack(new ItemStack(LOZmod.itemizedExperienceEmpty, 1), par3World, par4, par5, par6); } return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); } What's the replacement for the the "return super.onItemUse" part? Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
December 21, 201410 yr Well, that would depend on the function being overriden. If you aren't overriding an existent function, you can't call super (well, you can, but generally speaking you don't ask the superclass to run a different function than the one the subclass is running). Ten bucks says if you comment the line and run the code, this function never gets called. 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.
December 21, 201410 yr Author Well, that would depend on the function being overriden. If you aren't overriding an existent function, you can't call super (well, you can, but generally speaking you don't ask the superclass to run a different function than the one the subclass is running). Ten bucks says if you comment the line and run the code, this function never gets called. If I comment the line it tells me I need a return statement. In 1.7.10 the code worked just fine. Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
December 21, 201410 yr Obviously add "return false" just so you can run it. But seriously, are you sure you have the right method signature? If you put @Override on the line above this method, what does Eclipse tell you? 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.
December 21, 201410 yr Author Found the replacement: public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
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.