Jump to content

Recommended Posts

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

Posted

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.

Posted

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.

Posted

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?

Posted

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.

Posted

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

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