Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package phnxflms.unidye;
- 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.common.Mod.EventHandler;
- import net.minecraftforge.common.MinecraftForge;
- import net.minecraftforge.oredict.OreDictionary;
- import cpw.mods.fml.common.Mod;
- import cpw.mods.fml.common.Mod.PreInit; // used in 1.5.2
- import cpw.mods.fml.common.Mod.Init; // used in 1.5.2
- import cpw.mods.fml.common.Mod.PostInit; // used in 1.5.2
- import cpw.mods.fml.common.Mod.Instance;
- 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.event.FMLPreInitializationEvent;
- import cpw.mods.fml.common.network.NetworkMod;
- import cpw.mods.fml.common.registry.GameRegistry;
- import cpw.mods.fml.common.registry.LanguageRegistry;
- @Mod(modid = "unidye", name = "Unidye", version = "1.1.2")
- @NetworkMod(clientSideRequired = true)
- public class Unidye {
- public static final String modid = "unidye"; //Setting the modid for registerIcons
- public static Item woolPart; //Declaring the Items of Unidye
- public static Item uniDye;
- public static Item blueDye;
- public static int woolPartID; //Declaring the Item ID of Unidye
- public static int uniDyeID;
- public static int blueDyeID;
- public static int dyeOutOfMesh; //Config Variables
- public static int uniDyeOutOfMesh;
- public static boolean blueDyeUsed;
- // The instance of your mod that Forge uses.
- @Instance(value = "unidye")
- public static Unidye instance;
- // Says where the client and server 'proxy' code is loaded.
- @SidedProxy(clientSide = "phnxflms.unidye.client.ClientProxy", serverSide = "phnxflms.unidye.CommonProxy")
- public static CommonProxy proxy;
- @EventHandler // used in 1.6.2
- @PreInit
- public void preInit(FMLPreInitializationEvent event) {
- // you will be able to find the config file in .minecraft/config/ and it will be named unidye.cfg
- // here our Configuration has been instantiated, and saved under the name "config"
- Configuration config = new Configuration(event.getSuggestedConfigurationFile());
- // loading the configuration from its file
- config.load();
- // the NameOfProperty is a String, and the defaultID is an int or Integer
- woolPartID = config.getItem("woolPart", 22022).getInt();
- uniDyeID = config.getItem("uniDye", 22023).getInt();
- blueDyeID = config.getItem("blueDye", 22024).getInt();
- dyeOutOfMesh = config.get(Configuration.CATEGORY_GENERAL, "DyeOutOfMesh", 1).getInt(); //How many Dyes are extracted out of 1 Mesh
- uniDyeOutOfMesh = config.get(Configuration.CATEGORY_GENERAL, "UniDyeOutOfMesh", 1).getInt(); //How much Unidye you get for 1 mesh
- blueDyeUsed = config.get(Configuration.CATEGORY_GENERAL, "BlueDyeUsed", true).getBoolean(true); //If Blue Dye should be used in Unidye instead of Lapis Lazuli
- // saving the configuration to its file
- config.save();
- }
- @EventHandler // used in 1.6.2
- //@Init
- // used in 1.5.2
- public void load(FMLInitializationEvent event) {
- woolPart = new ItemWoolPart(woolPartID).setUnlocalizedName("woolPart"); //Creating the item Wool Part !!!Line with the Error!!!
- uniDye = new ItemUnidye(uniDyeID).setUnlocalizedName("uniDye"); //Creating the item uniDye
- blueDye = new ItemBlueDye(blueDyeID).setUnlocalizedName("blueDye"); // Creating the item blueDye
- LanguageRegistry.addName(uniDye, "Unidye"); // Setting the name for the item uniDye
- LanguageRegistry.addName(blueDye, "Blue Dye"); // Setting the name for the item blueDye
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 0), "White Wool Mesh"); //Setting the names for the various metadata configurations of Wool Part
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 1), "Orange Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 2), "Magenta Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 3), "Light Blue Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 4), "Yellow Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 5), "Lime Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 6), "Pink Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 7), "Gray Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 8), "Light Gray Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 9), "Cyan Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 10), "Purple Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 11), "Blue Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 12), "Brown Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 13), "Green Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 14), "Red Wool Mesh");
- LanguageRegistry.addName(new ItemStack(woolPart, 1, 15), "Black Wool Mesh");
- if (blueDyeUsed){
- OreDictionary.registerOre("dyeBlue", new ItemStack(blueDye));
- }
- GameRegistry.registerFuelHandler(new UnidyeFuelHandler());
- UnidyeCrafting.loadRecipes(); // Loads the Recipes from the Class UnidyeCrafting
- proxy.registerRenderers();
- }
- @EventHandler // used in 1.6.2
- //@PostInit
- // used in 1.5.2
- public void postInit(FMLPostInitializationEvent event) {
- // Stub Method
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement