Jump to content

Recommended Posts

Posted

Hi, yes, I know 1.6.4 is dead. However this is for a modpack and for compatibility sake. I am backporting some basic code from my mod to 1.6.4, and so far it has worked fine. However, the fuels that I added, while they show no code errors, don't actually work once minecraft has been launched. What gives? Here is my code:

 

Main.java:

 

package com.bored.morefuelsmod;

import net.minecraft.block.Block;
import net.minecraftforge.common.Configuration;
import net.minecraft.block.*;
import net.minecraft.block.material.*;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = Main.MODID, version = Main.VERSION, name = Main.MODNAME)
public class Main
{
    public static final String MODID = "morefuelsmod-1.6.4";
    public static final String VERSION = "1.3.2a";
    public static final String MODNAME = "More Fuels Mod";
    
    @EventHandler
    public void preinit(FMLPreInitializationEvent event){
    	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
    	config.load();
    	boolean enableRFtLrecipe = config.get(Configuration.CATEGORY_GENERAL, "enableRFtLrecipe", true).getBoolean(true);
    	if(enableRFtLrecipe)
    		GameRegistry.addSmelting(367, new ItemStack(Item.leather), 0.3F);
    	config.save();
    	
    }
    public void init(FMLInitializationEvent event)
    {
	GameRegistry.registerFuelHandler(new Fuels());
    }
}

 

 

Fuels.java

 

package com.bored.morefuelsmod;

import cpw.mods.fml.common.IFuelHandler;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;

public class Fuels implements IFuelHandler {

@Override
public int getBurnTime(ItemStack fuel) {
	if(fuel.getItem() == Item.itemFrame){
		return 900;
	}
	if(fuel.getItem() == Item.bed){
		return 1500;
	}
	if(fuel.getItem() == Item.painting){
		return 1000;
	}
	if(fuel.getItem() == Item.sign){
		return 640;
	}
	if(fuel.getItem() == Item.arrow){
		return 60;
	}
	if(fuel.getItem() == Item.feather){
		return 100;
	}
	if(fuel.getItem() == Item.wheat){
		return 100;
	}
	if(fuel.getItem() == Item.seeds){
		return 100;
	}
	if(fuel.getItem() == Item.melonSeeds){
		return 100;
	}
	if(fuel.getItem() == Item.pumpkinSeeds){
		return 100;
	}
	if(fuel.getItem() == Item.doorWood){
		return 600;
	}
	if(fuel.getItem() == Item.minecartCrate){
		return 400;
	}
	if(fuel.getItem() == Item.minecartTnt){
		return 8180;
	}
	return 0;
}

}

 

 

Also, does anyone know how to use blocks. I have only been able to figure out how to do items using this method? There doesnt seem to be a Item.getitemfromblock() which I used. In case anyone is wondering, I am backporting from the 1.7.x source code available on my github https://github.com/boredherobrine13/morefuelsmod-1.7

Posted

You are missing

@EventHandler

above your init method.

So remove that?

 

Seriously!?

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.

Posted

You are missing

@EventHandler

above your init method.

So remove that?

 

Seriously!?

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.

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.