Guest User

mainmod file

a guest
Dec 15th, 2014
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 9.08 KB | None | 0 0
  1. package net.stolenchristmas.mods;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.block.material.Material;
  5. import net.minecraft.creativetab.CreativeTabs;
  6. import net.minecraft.init.Blocks;
  7. import net.minecraft.init.Items;
  8. import net.minecraft.item.Item;
  9. import net.minecraft.item.Item.ToolMaterial;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.item.ItemTool;
  12. import net.minecraftforge.common.util.EnumHelper;
  13. import net.minecraftforge.oredict.OreDictionary;
  14. import net.stolenchristmas.mods.blocks.XMASOven;
  15. import net.stolenchristmas.mods.blocks.XmasTable;
  16. import net.stolenchristmas.mods.blocks.blockCoalesBlock;
  17. import net.stolenchristmas.mods.blocks.blockCoalesOre;
  18. import net.stolenchristmas.mods.blocks.blockTitaniumBlock;
  19. import net.stolenchristmas.mods.handler.CraftingHandler;
  20. import net.stolenchristmas.mods.handler.FuelHandler;
  21. import net.stolenchristmas.mods.handler.GuiHandler;
  22. import net.stolenchristmas.mods.items.SCItems;
  23. import net.stolenchristmas.mods.items.hammerItem;
  24. import net.stolenchristmas.mods.items.itemTitaniumAxe;
  25. import net.stolenchristmas.mods.items.itemTitaniumHoe;
  26. import net.stolenchristmas.mods.items.itemTitaniumPick;
  27. import net.stolenchristmas.mods.items.itemTitaniumShovel;
  28. import net.stolenchristmas.mods.items.itemTitaniumSword;
  29. import net.stolenchristmas.mods.items.portFurnaceItem;
  30. import net.stolenchristmas.mods.items.welderItem;
  31. import net.stolenchristmas.mods.proxy.CommonProxy;
  32. import net.stolenchristmas.mods.tileentity.TileEntityXMASOven;
  33. import net.stolenchristmas.mods.worldgen.XMASWorldGen;
  34. import cpw.mods.fml.common.FMLCommonHandler;
  35. import cpw.mods.fml.common.Mod;
  36. import cpw.mods.fml.common.Mod.EventHandler;
  37. import cpw.mods.fml.common.Mod.Instance;
  38. import cpw.mods.fml.common.SidedProxy;
  39. import cpw.mods.fml.common.event.FMLInitializationEvent;
  40. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  41. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  42. import cpw.mods.fml.common.network.NetworkRegistry;
  43. import cpw.mods.fml.common.registry.GameRegistry;
  44. import cpw.mods.fml.relauncher.Side;
  45. import cpw.mods.fml.relauncher.SideOnly;
  46.  
  47. @Mod(modid = stolenchristmas.modid, version = stolenchristmas.version, name = "How Nick Stole Christmas!")
  48.  
  49. public class stolenchristmas {
  50.  
  51.     public static final String modid = "XMAS";
  52.     public static final String version = "Alpha";
  53.    
  54.     //WorldGEN
  55.     XMASWorldGen eventWorldGen = new XMASWorldGen();
  56.    
  57.     //CreativeTAB
  58.     public static CreativeTabs xmasTab;
  59.    
  60.     //Toolkit
  61.     public static ToolMaterial TitaniumMaterial = EnumHelper.addToolMaterial("Titanium", 3, 10000, 15.0F, 20.0F, 25);
  62.    
  63.     @Instance(modid)
  64.     public static stolenchristmas instance;
  65.    
  66.     //XMASTABLECRAFTING 5x5
  67.     public static Block blockXmasTable;
  68.     public static final int guiIDWorkSurface = 1;
  69.    
  70.     public static Item TitaniumSword;
  71.     public static Item TitaniumAxe;
  72.     public static Item TitaniumPick;
  73.     public static Item TitaniumHoe;
  74.     public static Item TitaniumShovel;
  75.    
  76.     public static Item ItemPortFurnace;
  77.     public static Item ItemHammer;
  78.     public static Item ItemWelder;
  79.    
  80.     //Items....
  81.     public static Item ItemCoalesence;
  82.     public static Item ItemPineCone;
  83.     public static Item ItemTitanium;
  84.     public static Item ItemStarDust;
  85.    
  86.    
  87.     //Blocks.....
  88.     public static Block XMASOvenIdle;
  89.     public static Block XMASOvenActive;
  90.     public static final int guiIDXMASOven = 0;
  91.    
  92.     //Ores and metal blocks
  93.     public static Block CoalesOre;
  94.     public static Block CoalesBlock;
  95.     public static Block TitaniumOre;
  96.     public static Block TitaniumBlock;
  97.     public static Block StarDustOre;
  98.    
  99.     @SidedProxy(clientSide = "net.stolenchristmas.mods.proxy.ClientProxy", serverSide = "net.stolenchristmas.mods.proxy.CommonProxy")
  100.     public static CommonProxy xmasProxy;
  101.    
  102.    
  103.     @EventHandler
  104.     public void PreInit(FMLPreInitializationEvent preEvent){
  105.        
  106.         xmasTab = new CreativeTabs("XMAS"){
  107.  
  108.            
  109.            
  110.             @Override
  111.             public Item getTabIconItem() {
  112.                 // TODO Auto-generated method stub
  113.                 return stolenchristmas.ItemCoalesence;
  114.             }
  115.    
  116.         };
  117.        
  118.         //Item Registry
  119.         ItemCoalesence = new SCItems().setUnlocalizedName("CoalesenceItem").setTextureName("XMAS:Coalesence");
  120.         GameRegistry.registerItem(ItemCoalesence, "CoalesenceItem");
  121.         ItemPineCone = new SCItems().setUnlocalizedName("PineCone").setTextureName("XMAS:PineCone");
  122.         GameRegistry.registerItem(ItemPineCone, "PineCone");
  123.         ItemTitanium = new SCItems().setUnlocalizedName("Titanium").setTextureName("XMAS:Titanium");
  124.         GameRegistry.registerItem(ItemTitanium, "Titanium");
  125.         ItemStarDust = new SCItems().setUnlocalizedName("StarDust").setTextureName("XMAS:StarDust");
  126.         GameRegistry.registerItem(ItemStarDust, "StarDust");
  127.        
  128.         //ToolKit Reg
  129.         ItemPortFurnace = new portFurnaceItem().setUnlocalizedName("PortableFurnace").setTextureName("XMAS:PortableFurnace");
  130.         GameRegistry.registerItem(ItemPortFurnace, "PortableFurnace");
  131.         ItemHammer = new hammerItem().setUnlocalizedName("Hammer").setTextureName("XMAS:Hammer");
  132.         GameRegistry.registerItem(ItemHammer, "Hammer");
  133.         ItemWelder = new welderItem().setUnlocalizedName("Welder").setTextureName("XMAS:Welder");
  134.         GameRegistry.registerItem(ItemWelder, "Welder");
  135.        
  136.         TitaniumSword = new itemTitaniumSword(TitaniumMaterial).setUnlocalizedName("TitaniumSword").setTextureName("XMAS:TitaniumSword");
  137.         GameRegistry.registerItem(TitaniumSword, "TitaniumSword");
  138.         TitaniumAxe = new itemTitaniumAxe(TitaniumMaterial).setUnlocalizedName("TitaniumAxe").setTextureName("XMAS:TitaniumAxe");
  139.         GameRegistry.registerItem(TitaniumAxe, "TitaniumAxe");
  140.         TitaniumPick = new itemTitaniumPick(TitaniumMaterial).setUnlocalizedName("TitaniumPick").setTextureName("XMAS:TitaniumPick");
  141.         GameRegistry.registerItem(TitaniumPick, "TitaniumPick");
  142.         TitaniumHoe = new itemTitaniumHoe(TitaniumMaterial).setUnlocalizedName("TitaniumHoe").setTextureName("XMAS:TitaniumHoe");
  143.         GameRegistry.registerItem(TitaniumHoe, "TitaniumHoe");
  144.         TitaniumShovel = new itemTitaniumShovel(TitaniumMaterial).setUnlocalizedName("TitaniumShovel").setTextureName("XMAS:TitaniumShovel");
  145.         GameRegistry.registerItem(TitaniumShovel, "TitaniumShovel");
  146.        
  147.         //Block Registry
  148.         CoalesOre = new blockCoalesOre(Material.rock).setBlockTextureName("XMAS:CoalesenceOre").setBlockName("CoalesenceOre");
  149.         GameRegistry.registerBlock(CoalesOre, "CoalesenceOre");
  150.         CoalesBlock = new blockCoalesBlock(Material.iron).setBlockTextureName("XMAS:CoalesenceBlock").setBlockName("CoalesenceBlock");
  151.         GameRegistry.registerBlock(CoalesBlock, "CoalesenceBlock");
  152.        
  153.         //Custom Table
  154.         blockXmasTable = new XmasTable(Material.cloth).setBlockTextureName("XMAS:XmasTable").setBlockName("XmasTable");
  155.         GameRegistry.registerBlock(blockXmasTable, "XmasTable");
  156.        
  157.         //Ores
  158.         TitaniumOre = new blockCoalesOre(Material.rock).setBlockTextureName("XMAS:TitaniumOre").setBlockName("TitaniumOre");
  159.         GameRegistry.registerBlock(TitaniumOre, "TitaniumOre");
  160.         TitaniumBlock = new blockTitaniumBlock(Material.iron).setBlockTextureName("XMAS:TitaniumBlock").setBlockName("TitaniumBlock");
  161.         GameRegistry.registerBlock(TitaniumBlock, "TitaniumBlock");
  162.        
  163.         StarDustOre = new blockCoalesOre(Material.rock).setBlockTextureName("XMAS:StarDustOre").setBlockName("StarDustOre");
  164.         GameRegistry.registerBlock(StarDustOre, "StarDustOre");
  165.        
  166.         //Machines
  167.         XMASOvenIdle = new XMASOven(false).setBlockName("XMASOvenIdle").setCreativeTab(xmasTab);
  168.         XMASOvenActive = new XMASOven(true).setBlockName("XMASOvenIdle").setLightLevel(0.625F);
  169.         GameRegistry.registerBlock(XMASOvenIdle, "XMASOvenIdle");
  170.         GameRegistry.registerBlock(XMASOvenActive, "XMASOvenActive");
  171.        
  172.        
  173.         //WorldGen
  174.         GameRegistry.registerWorldGenerator(eventWorldGen, 0);
  175.        
  176.         //Renders
  177.         xmasProxy.registerRenderThings();
  178.    
  179.     }
  180.    
  181.     @EventHandler
  182.     public void Init(FMLInitializationEvent event){
  183.        
  184.         FMLCommonHandler.instance().bus().register(new CraftingHandler());
  185.        
  186.         NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler());
  187.        
  188.         GameRegistry.registerTileEntity(TileEntityXMASOven.class, "XMASOven");
  189.        
  190.         //Recipes
  191.         GameRegistry.addRecipe(new ItemStack(CoalesBlock), new Object[] {"XXX", "XXX", "XXX", 'X', ItemCoalesence});
  192.        
  193.         //Smelting
  194.         GameRegistry.addSmelting(CoalesOre, new ItemStack(ItemCoalesence, 5), 20);
  195.         GameRegistry.addSmelting(TitaniumOre, new ItemStack(ItemTitanium, 1), 20);
  196.        
  197.         GameRegistry.addRecipe(new ItemStack(Items.iron_ingot, 4), new Object[] {"IH", 'I', Blocks.iron_ore, 'H', new ItemStack(ItemPortFurnace, 1, OreDictionary.WILDCARD_VALUE)});
  198.         GameRegistry.addRecipe(new ItemStack(Items.gold_ingot, 2), new Object[] {"IH", 'I', Blocks.gold_ore, 'H', new ItemStack(ItemPortFurnace, 1, OreDictionary.WILDCARD_VALUE)});
  199.         GameRegistry.addRecipe(new ItemStack(ItemCoalesence, 5), new Object[] {"IH", 'I', CoalesOre, 'H', new ItemStack(ItemPortFurnace, 1, OreDictionary.WILDCARD_VALUE)});
  200.         GameRegistry.addRecipe(new ItemStack(ItemTitanium, 2), new Object[] {"IH", 'I', TitaniumOre, 'H', new ItemStack(ItemPortFurnace, 1, OreDictionary.WILDCARD_VALUE)});
  201.  
  202.        
  203.        
  204.         //Fuels
  205.         GameRegistry.registerFuelHandler(new FuelHandler());
  206.        
  207.     }
  208.    
  209.     @EventHandler
  210.     public void PostInit(FMLPostInitializationEvent postEvent){
  211.        
  212.     }  
  213.  
  214. }
Advertisement
Add Comment
Please, Sign In to add comment