Skip to content

Instantly share code, notes, and snippets.

/main.java Secret

Created July 23, 2015 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/0924e7591441973b2736 to your computer and use it in GitHub Desktop.
Save anonymous/0924e7591441973b2736 to your computer and use it in GitHub Desktop.
package mymod;
import java.util.Stack;
import mymod.armor.MyArmor;
import mymod.armor.MyArmor2;
import mymod.armor.MyArmor3;
import mymod.blocks.MyBlock;
import mymod.blocks.MyBlock2;
import mymod.blocks.MyBlock3;
import mymod.blocks.MyBlockGen;
import mymod.blocks.MyBlockGen2;
import mymod.items.MyItem;
import mymod.items.MyItem2;
import mymod.items.MyItem3;
import mymod.items.MyPickaxe;
import mymod.items.MyPickaxe2;
import mymod.items.MyPickaxe3;
import mymod.items.MySword;
import mymod.items.MySword2;
import mymod.items.MySword3;
import mymod.items.MySword4;
import mymod.proxies.CommonProxy;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
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;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraftforge.common.MinecraftForge;
/* MOD INFO */
@Mod( modid = "mymod", name = "Sapphire items mod", version = "1.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class Main {
/* PROXY INFO */
@SidedProxy(clientSide = "mymod.proxies.ClientProxy", serverSide = "mymod.proxies.CommonProxy")
public static CommonProxy proxy;
/**
* DECLARATION SECTION
* *********************************************************** */
// DECLARE THE ARMOR MATERIAL
public static EnumArmorMaterial Jaspera = EnumHelper.addArmorMaterial("JASPER", 35, new int[]{2, 7, 5, 2}, 10);
// DECLARE NEW TOOL MATERIAL
public static EnumToolMaterial Jasper = EnumHelper.addToolMaterial("JASPER", 3, 1600, 9.0F, 4.0F, 10);
// DECLARE THE SWORD
public static Item MySword_4;
// DECLARE THE ARMOR MATERIAL
public static EnumArmorMaterial Malachitearmor = EnumHelper.addArmorMaterial("MALACHITEARMOR", 40 , new int[]{4, 9, 7, 4}, 30);
// DECLARE THE ITEM
public static Item MyItem_2;
// DECLARE THE BLOCK
public static Block MyBlock_2;
// DECLARE NEW TOOL MATERIAL
public static EnumToolMaterial Malachiteaxe = EnumHelper.addToolMaterial("MALACHITEAXE", 3, 1660, 9.5F, 4.5F, 36);
// DECLARE NEW TOOL MATERIAL
public static EnumToolMaterial Malachite = EnumHelper.addToolMaterial("MALACHITE", 3, 1651, 9.0F, 4.0F, 35);
// DECLARE THE ARMOR MATERIAL
public static EnumArmorMaterial sapphirearmor = EnumHelper.addArmorMaterial("SAPPHIREARMOR", 33 , new int[]{2, 6, 5, 2}, 27);
// DECLARE NEW TOOL MATERIAL
public static EnumToolMaterial sapphire= EnumHelper.addToolMaterial("SAPPIHIRE", 2, 1009, 7.0F, 2.5F, 30);
// DECLARE THE PICKAXE
public static Item MyPickaxe_3;
// DECLARE THE PICKAXE
public static Item MyPickaxe_1;
// DECLARE THE SWORD
public static Item MySword_1;
// DECLARE THE ITEM
public static Item MyItem_1;
// DECLARE THE BLOCK
public static Block MyBlock_1;
// DECLARE THE ARMOR
public static Item MyHelmet_1;
public static Item MyChest_1;
public static Item MyLeggings_1;
public static Item MyBoots_1;
// DECLARE THE SWORD
public static Item MySword_2;
// DECLARE THE PICKAXE
public static Item MyPickaxe_2;
// DECLARE THE ARMOR
public static Item MyHelmet_2;
public static Item MyChest_2;
public static Item MyLeggings_2;
public static Item MyBoots_2;
// DECLARE THE ITEM
public static Item MyItem_3;
// DECLARE THE BLOCK
public static Block MyBlock_3;
// DECLARE THE SWORD
public static Item MySword_3;
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
@EventHandler
public void preInit( FMLPreInitializationEvent event )
{
/**
* LOAD SECTION
* *********************************************************** */
// LOAD THE SWORD
MySword_4 = new MySword4(2021, Jasper, "MySword_4");
GameRegistry.registerItem(MySword_4, "MySword_4");
LanguageRegistry.addName(MySword_4, "Jasper Sword");
// LOAD THE SWORD
MySword_1 = new MySword(3003, sapphire, "MySword_1");
GameRegistry.registerItem(MySword_1, "MySword_1");
LanguageRegistry.addName(MySword_1, "Sapphire Sword");
// LOAD THE PICKAXE
MyPickaxe_1 = new MyPickaxe(3002,sapphire, "MyPickaxe_1");
GameRegistry.registerItem(MyPickaxe_1, "MyPickaxe_1");
LanguageRegistry.addName(MyPickaxe_1, "Sapphire Pickaxe");
// LOAD THE ITEM
MyItem_1 = new MyItem(3001, "MyItem_1").setCreativeTab(CreativeTabs.tabMaterials);
GameRegistry.registerItem(MyItem_1, "MyItem_1");
LanguageRegistry.addName(MyItem_1, "Sapphire Gem");
// LOAD THE BLOCK
MyBlock_1 = new MyBlock(3000, Material.rock, "MyBlock_1");
GameRegistry.registerBlock(MyBlock_1, "MyBlock_1");
LanguageRegistry.addName(MyBlock_1, "Sapphire Ore");
MinecraftForge.setBlockHarvestLevel(MyBlock_1, "pickaxe", 2);
// LOAD HELMET
MyHelmet_1 = new MyArmor(3004, sapphirearmor, 0, 0, "myarmor");
GameRegistry.registerItem(MyHelmet_1, "MyHelmet_1");
LanguageRegistry.addName(MyHelmet_1, "Sapphire Helmet");
// LOAD THE SWORD
MySword_3 = new MySword3(2021, Malachiteaxe, "MySword_3");
GameRegistry.registerItem(MySword_3, "MySword_3");
LanguageRegistry.addName(MySword_3, "Malachite Battleaxe");
// LOAD LEGGINGS
MyLeggings_1 = new MyArmor(3006, sapphirearmor, 0, 2, "myarmor");
GameRegistry.registerItem(MyLeggings_1, "MyLeggings_1");
LanguageRegistry.addName(MyLeggings_1, "Sapphire Leggings");
// LOAD THE ITEM
MyItem_2 = new MyItem2(3011, "MyItem_2").setCreativeTab(CreativeTabs.tabMaterials);
GameRegistry.registerItem(MyItem_2, "MyItem_2");
LanguageRegistry.addName(MyItem_2, "Malachite Shard");
// LOAD BOOTS
MyBoots_1 = new MyArmor(3007, sapphirearmor, 0, 3, "myarmor");
GameRegistry.registerItem(MyBoots_1, "MyBoots_1");
LanguageRegistry.addName(MyBoots_1, "Sapphire Boots ");
// LOAD THE SWORD
MySword_2 = new MySword2(30009, Malachite, "MySword_2");
GameRegistry.registerItem(MySword_2, "MySword_2");
LanguageRegistry.addName(MySword_2, "Malachite Sword");
// LOAD THE PICKAXE
MyPickaxe_2 = new MyPickaxe2(3010, Malachite, "MyPickaxe_2");
GameRegistry.registerItem(MyPickaxe_2, "MyPickaxe_2");
LanguageRegistry.addName(MyPickaxe_2, "Malachite Pickaxe");
// LOAD THE BLOCK
MyBlock_2 = new MyBlock2(3011, Material.rock, "MyBlock_2");
GameRegistry.registerBlock(MyBlock_2, "MyBlock_2");
LanguageRegistry.addName(MyBlock_2, "Block of Malachite");
MinecraftForge.setBlockHarvestLevel(MyBlock_2, "pickaxe", 3);
// LOAD HELMET
MyHelmet_2 = new MyArmor2(3012, Malachitearmor, 0, 0, "myarmor2");
GameRegistry.registerItem(MyHelmet_2, "MyHelmet_2");
LanguageRegistry.addName(MyHelmet_2, "Malachite Helmet");
// LOAD CHESTPLATE
MyChest_2 = new MyArmor2(3013, Malachitearmor, 0, 1, "myarmor2");
GameRegistry.registerItem(MyChest_2, "MyChest_2");
LanguageRegistry.addName(MyChest_2, "Malachite Chest");
// LOAD LEGGINGS
MyLeggings_2 = new MyArmor2(3014, Malachitearmor, 0, 2, "myarmor2");
GameRegistry.registerItem(MyLeggings_2, "MyLeggings_2");
LanguageRegistry.addName(MyLeggings_2, "Malachite Leggings");
// LOAD THE BLOCK
MyBlock_3 = new MyBlock3(3018, Material.rock, "MyBlock_3");
GameRegistry.registerBlock(MyBlock_3, "MyBlock_3");
LanguageRegistry.addName(MyBlock_3, "Jasper Ore");
MinecraftForge.setBlockHarvestLevel(MyBlock_3, "pickaxe", 3);
// LOAD BOOTS
MyBoots_2 = new MyArmor2(3015, Malachitearmor, 0, 3, "myarmor2");
GameRegistry.registerItem(MyBoots_2, "MyBoots_2");
LanguageRegistry.addName(MyBoots_2, "Malachite Boots");
// LOAD THE ITEM
MyItem_3 = new MyItem3(3016, "MyItem_3").setCreativeTab(CreativeTabs.tabMaterials);
GameRegistry.registerItem(MyItem_3, "MyItem_3");
LanguageRegistry.addName(MyItem_3, "Jasper");
// LOAD THE PICKAXE
MyPickaxe_3 = new MyPickaxe3(3017, Jasper, "MyPickaxe_3");
GameRegistry.registerItem(MyPickaxe_3, "MyPickaxe_3");
LanguageRegistry.addName(MyPickaxe_3, "Jasper Pickaxe");
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
}
@EventHandler
public static void init( FMLInitializationEvent event )
{
/**
* RECIPES SECTION
* *********************************************************** */
// SWORD RECIPE
GameRegistry.addRecipe(new ItemStack(MySword_1, 1), new Object[]
{
" X ",
" X ",
" S ",
'S', Item.stick,
'X', Main.MyItem_1,
});
// PICKAXE RECIPE
GameRegistry.addRecipe(new ItemStack(MyPickaxe_1, 1), new Object[]
{
"XXX",
" S ",
" S ",
'S', Item.stick,
'X', Main.MyItem_1,
});
// SMELTING RECIPE
GameRegistry.addSmelting(MyBlock_1.blockID, (new ItemStack(MyItem_1, 1)), 35);
// HELMET RECIPE
GameRegistry.addRecipe(new ItemStack(MyHelmet_1, 1), new Object[]
{
"XXX",
"X X",
'X', MyItem_1,
});
// CHESTPLATE RECIPE
GameRegistry.addRecipe(new ItemStack(MyChest_1, 1), new Object[]
{
"X X",
"XXX",
"XXX",
'X', MyItem_1,
});
// SWORD RECIPE
GameRegistry.addRecipe(new ItemStack(MySword_4, 1), new Object[]
{
" X ",
" X ",
" S ",
'S', Item.stick,
'X', MyItem_3,
});
// LEGGINGS RECIPE
GameRegistry.addRecipe(new ItemStack(MyLeggings_1, 1), new Object[]
{
"XXX",
"X X",
"X X",
'X', MyItem_1,
});
// BOOTS RECIPE
GameRegistry.addRecipe(new ItemStack(MyBoots_1, 1), new Object[]
{
"X X",
"X X",
'X', MyItem_1,
});
// SWORD RECIPE
GameRegistry.addRecipe(new ItemStack(MySword_3, 1), new Object[]
{
" XXX ",
" XSX ",
" S ",
'S', Item.stick,
'X', MyItem_2,
});
// SWORD RECIPE
GameRegistry.addRecipe(new ItemStack(MySword_2, 1), new Object[]
{
" X ",
" X ",
" S ",
'S', Item.stick,
'X', MyItem_2,
});
// PICKAXE RECIPE
GameRegistry.addRecipe(new ItemStack(MyPickaxe_2, 1), new Object[]
{
"XXX",
" S ",
" S ",
'S', Item.stick,
'X', MyItem_2,
});
// Block RECIPE
GameRegistry.addRecipe(new ItemStack(MyBlock_2, 1), new Object[]
{
"XXX",
"XXX ",
"XXX",
'X', MyItem_2,
});
// Block RECIPE
GameRegistry.addRecipe(new ItemStack(MyItem_2, 9), new Object[]
{
"X",
'X', MyBlock_2,
});
// HELMET RECIPE
GameRegistry.addRecipe(new ItemStack(MyHelmet_2, 1), new Object[]
{
"XXX",
"X X",
'X', MyItem_2,
});
// CHESTPLATE RECIPE
GameRegistry.addRecipe(new ItemStack(MyChest_2, 1), new Object[]
{
"X X",
"XXX",
"XXX",
'X', MyItem_2,
});
// LEGGINGS RECIPE
GameRegistry.addRecipe(new ItemStack(MyLeggings_2, 1), new Object[]
{
"XXX",
"X X",
"X X",
'X', MyItem_2,
});
// ITEM RECIPE
GameRegistry.addRecipe(new ItemStack(MyItem_2, 1), new Object[]
{
"CC",
"CX",
'X', MyItem_1,
'C', MyItem_3
});
// BOOTS RECIPE
GameRegistry.addRecipe(new ItemStack(MyBoots_2, 1), new Object[]
{
"X X",
"X X",
'X', MyItem_2,
});
// SMELTING RECIPE
GameRegistry.addSmelting(MyBlock_3.blockID, (new ItemStack(MyItem_3, 1)), 50);
// PICKAXE RECIPE
; GameRegistry.addRecipe(new ItemStack(MyPickaxe_3, 1), new Object[]
{
"XXX",
" S ",
" S ",
'S', Item.stick,
'X', MyItem_3,
});
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
/**
* EXTRA METHODS SECTION
* *********************************************************** */
// REGISTER THE ORE GENERATION
GameRegistry.registerWorldGenerator(new MyBlockGen());
// REGISTER THE ORE GENERATION
GameRegistry.registerWorldGenerator(new MyBlockGen2());
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
}
@EventHandler
public static void postInit( FMLPostInitializationEvent event )
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment