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

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]

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.

  • 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]

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.

  • 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.

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.