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

Hi guys. I have got problem. I dont know what i must add in FuelHandler.

It it look like that:

 

package net.elementarydiamonds.main;

 

import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.IFuelHandler;

 

public class FuelHandler implements IFuelHandler {

 

@Override

public int getBurnTime(ItemStack fuel)

{

 

 

return 0;

 

}

 

}

 

So what i must give inside. Please help me as fast as it is possible.

~ogrekpl

  • Author

You may want to look up the corresponding page in the Forge Wiki. Otherwise I highly recommend learning more about interfaces in Java.

 

Oh my god. In 1.6.X was .getID now it doesn't works. No do you understand or not?

O wann't listen to some one who would like be as my mum but anyone whou is able to help me.

Oh my god. In 1.6.X was .getID now it doesn't works. No do you understand or not?

O wann't listen to some one who would like be as my mum but anyone whou is able to help me.

 

Most of the parts of this tutorial still work. The only thing you'll need to do is change

Item.customItem.itemID

to

Item.getIdFromItem(Items.apple)

 

If your problem is to determine the item's ID, then please mention it in your root post. Otherwise we're all unable to help.

There is no need to create a class simply to implement an interface. If your class does nothing else, get rid of it.

 

Not really. It's always better to create an extra class implementing an interface just to make your whole project look neatly arranged. However, if you're merging multiple functionalities of the same type to one big compound of methods, then you could also make some kind of handler which handles all events of the same type. Speaking of that, wouldn't it be a good idea to implement the IFuelHandler interface directly into the item to which it belongs to?

wouldn't it be a good idea to implement the IFuelHandler interface directly into the item to which it belongs to?

 

In theory, that works, but you still have to check for the item specifically, and you still have to initialize it separately in your main mod class. Especially for mods checking for multiple things to add fuel values for, and even for mods who add one, it is better just to add a separate class for it, both for simplicity and readability sake.

There is no need to create a class simply to implement an interface. If your class does nothing else, get rid of it.

 

Not really. It's always better to create an extra class implementing an interface just to make your whole project look neatly arranged. However, if you're merging multiple functionalities of the same type to one big compound of methods, then you could also make some kind of handler which handles all events of the same type. Speaking of that, wouldn't it be a good idea to implement the IFuelHandler interface directly into the item to which it belongs to?

 

Utter bull-feces!  Nothing about adding useless classes makes a project look neatly arraigned. It just makes the programmer look retarded, as they have no idea that an interface is for class mix-ins. Any class can implement any number of interfaces and a superclass if desired. This line of reasoning indicates a lack of experience in Java programming.

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.