Jump to content

[1.6.4] Config not working


Bugzoo

Recommended Posts

The config doesnt register the item id's and I dont know where to run the method from.

 

package MinespressoMod; //Package directory

import java.io.File;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="Minedrinks",name="Minespresso Mod",version="v2.1")
@NetworkMod(clientSideRequired=true, serverSideRequired=false,channels={"DrinksNetwork"}, packetHandler = PacketHandler.class)
public class Minespresso
{
//Server Side Stuff
@SidedProxy(clientSide = "MinespressoMod.ClientProxy", serverSide = "MinespressoMod.CommonProxy")
public static CommonProxy proxy;

@Instance("Minedrinks")
public static Minespresso instance;

public static int CoffeeID;
public static int TeaID;
public static int HotChocolateID;
public static int MinespressoID;
public static int CappuccinoID;
public static int LatteID;

public static int SugaryHotChocolateID;
public static int MagicMinespressoID;
public static int SugaryMagicMinespressoID;
public static int TheBombID;
public static int SleepyCoffeeID;
public static int HealTeaID;
public static int XPLatteID;
public static int StrengthCappuccinoID;
public static int MinespressoMachineID;

public static int CurrencyItemID;


public void initConfiguration(FMLInitializationEvent event){
	Configuration config = new Configuration(new File("config/MinespressoMod.cfg"));
	config.load();	
	CoffeeID = config.get("Drinks", "Coffee", 1130).getInt();	
	TeaID = config.get("Drinks", "Tea", 1131).getInt();
	HotChocolateID = config.get("Drinks", "HotChocolate", 1132).getInt();
	MinespressoID = config.get("Drinks", "Minespresso", 1133).getInt();
	CappuccinoID = config.get("Drinks", "Cappuccino", 1134).getInt();
	LatteID = config.get("Drinks", "Latte", 1135).getInt();
	SugaryHotChocolateID = config.get("Drinks", "SugaryHotChocolate", 1136).getInt();
	MagicMinespressoID = config.get("Drinks", "MagicMinespresso", 1137).getInt();
	SugaryMagicMinespressoID = config.get("Drinks", "SugaryMagicMinespresso", 1138).getInt();
	TheBombID = config.get("Drinks", "TheBomb", 1139).getInt();
	SleepyCoffeeID = config.get("Drinks", "SleepyCoffee", 1140).getInt();
	HealTeaID = config.get("Drinks", "HealTea", 1141).getInt();
	XPLatteID = config.get("Drinks", "XPLatte", 1142).getInt();
	StrengthCappuccinoID = config.get("Drinks", "StrengthCappuccino", 1143).getInt();
	MinespressoMachineID = config.get("Blocks", "DrinksMachine", 1144).getInt();
	CurrencyItemID = config.get("Currency", "Currency", 265).getInt();	
	config.save();
}

public static Item Coffee;
public static Item Tea;
public static Item HotChocolate;
public static Item Minespresso;
public static Item Cappuccino;
public static Item Latte;

public static Item SugaryHotChocolate;
public static Item MagicMinespresso;
public static Item SugaryMagicMinespresso;
public static Item TheBombMinespresso;
public static Item XPLatte;
public static Item HealTea;
public static Item StrengthCappuccino;
public static Item SleepyCoffee;

public static Block DrinksMachine;

public Minespresso(){
	// Register Regular Drinks
	Coffee = new ItemDrink(CoffeeID, 4, 4, false).setUnlocalizedName("Coffee");
	Tea = new ItemDrink(TeaID, 6, 6, false).setUnlocalizedName("Tea");
    HotChocolate = new ItemDrink(HotChocolateID, 3, 3, false).setUnlocalizedName("HotChocolate");
    Minespresso = new ItemDrink(MinespressoID, 10, 10, false).setUnlocalizedName("Minespresso");
    Cappuccino = new ItemDrink(CappuccinoID, 6, 6, false).setUnlocalizedName("Cappuccino");
	Latte = new ItemDrink(LatteID, 5, 5, false).setUnlocalizedName("Latte");

	//Register HotChocolate Drinks
	SugaryHotChocolate = new ItemSugaryDrink(SugaryHotChocolateID, 3, 3, false).setUnlocalizedName("SugaryHotChocolate");

	//Register Minespresso Drinks
	MagicMinespresso = new ItemMagicDrink(MagicMinespressoID, 3, 3, false).setUnlocalizedName("MagicMinespresso");
	SugaryMagicMinespresso = new ItemSugaryMagicDrink(SugaryMagicMinespressoID, 3, 3, false).setUnlocalizedName("SugaryMagicMinespresso");
	TheBombMinespresso = new TheBombItem(TheBombID, 14, 14, false).setUnlocalizedName("TheBombMinespresso");

	//Register Coffee Drinks
	SleepyCoffee = new ItemSleepyDrink(SleepyCoffeeID, 3, 3, false).setUnlocalizedName("SleepyCoffee");

	//Register Tea Drinks
	HealTea = new ItemHealDrink(HealTeaID, 6, 6, false).setUnlocalizedName("HealTea");

	//Latte
	XPLatte = new ItemXPDrink(XPLatteID, 5, 5, false).setUnlocalizedName("XPLatte");

	//Cappuccino 
	StrengthCappuccino = new ItemStrength(StrengthCappuccinoID, 6, 6, false).setUnlocalizedName("StrengthCappuccino");

	// Register Blocks
	DrinksMachine = new BlockDrinksMachine(1161, Material.iron).setUnlocalizedName("DrinksMachine").setHardness(3.5F);


	//Register Blocks
	GameRegistry.registerBlock(DrinksMachine, "DrinksMachine");
	GameRegistry.registerTileEntity(TileEntityMinespresso.class, "Minespresso");
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMinespresso.class, new RendererMinespresso());


	LanguageRegistry.addName(Coffee, "Coffee");
	LanguageRegistry.addName(Tea, "Tea");
	LanguageRegistry.addName(HotChocolate, "Hot Chocolate");
	LanguageRegistry.addName(SugaryHotChocolate, "Hot Chocolate");
	LanguageRegistry.addName(Minespresso, "Minespresso");
	LanguageRegistry.addName(Cappuccino, "Cappuccino");
	LanguageRegistry.addName(Latte, "Latte");
	LanguageRegistry.addName(DrinksMachine, "Minespresso Machine");
	LanguageRegistry.addName(MagicMinespresso, "Minespresso");
	LanguageRegistry.addName(SugaryMagicMinespresso, "Minespresso");
	LanguageRegistry.addName(HealTea, "Tea");
	LanguageRegistry.addName(XPLatte, "Latte");
	LanguageRegistry.addName(SleepyCoffee, "Coffee");
	LanguageRegistry.addName(StrengthCappuccino, "Cappuccino");

	LanguageRegistry.addName(TheBombMinespresso, "The Bomb Minespresso");

	GameRegistry.addRecipe(new ItemStack(DrinksMachine), new Object[]{
		"XBX",
		"XSX",
		"XXX",
		'X', Block.blockIron, 'B', Block.stoneButton, 'S', Item.sugar
	});
}			
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.