Flaghacker

MyMod.java

Aug 26th, 2014
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.48 KB | None | 0 0
  1. package net.flaghacker.myMod;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.creativetab.CreativeTabs;
  5. import net.minecraft.init.Items;
  6. import net.minecraft.item.Item;
  7. import cpw.mods.fml.common.Mod;
  8. import cpw.mods.fml.common.Mod.EventHandler;
  9. import cpw.mods.fml.common.event.FMLInitializationEvent;
  10. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  11. import cpw.mods.fml.common.registry.GameRegistry;
  12.  
  13. //Initiate mod settings
  14. @Mod(modid = MyMod.MODID, version = MyMod.VERSION)
  15.  
  16. public class MyMod {
  17.     //Variables
  18.     public static final String MODID = "MyMod";
  19.     public static final String VERSION = "0.0";
  20.    
  21.     //Make a variables
  22.     public static Block blockRed;
  23.     public static Item itemDisk;
  24.    
  25.    
  26.     //Create creative tab
  27.     public static CreativeTabs myModTab1 = new CreativeTabs("myModTab1") {
  28.         public Item getTabIconItem() {
  29.             return Items.emerald;
  30.         }
  31.     };
  32.    
  33.     @EventHandler
  34.     public void init(FMLPreInitializationEvent event) {
  35.         //Make block
  36.         blockRed = new BlockRed();
  37.         blockRed.setBlockName("blockRed");
  38.         blockRed.setCreativeTab(myModTab1);
  39.         blockRed.setBlockTextureName(MODID + ":blockRed");
  40.         GameRegistry.registerBlock(blockRed, "blockRed");
  41.        
  42.         //Make item
  43.         itemDisk = new Item();
  44.         itemDisk.setUnlocalizedName("itemDisk");
  45.         itemDisk.setCreativeTab(myModTab1);
  46.         itemDisk.setTextureName(MODID + ":itemDisk");
  47.         GameRegistry.registerItem(itemDisk, "itemDisk");
  48.     }
  49.    
  50.     @EventHandler
  51.     public void init(FMLInitializationEvent event) {
  52.        
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment