Guest User

compactblocks.java

a guest
Nov 18th, 2012
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package sidthesloth.compact.blocks;
  2.  
  3. import net.minecraft.src.Block;
  4. import net.minecraft.src.CreativeTabs;
  5. import net.minecraft.src.Item;
  6. import net.minecraft.src.ItemStack;
  7. import net.minecraft.src.Material;
  8. import net.minecraftforge.common.Configuration;
  9. import net.minecraftforge.common.MinecraftForge;
  10. import cpw.mods.fml.common.Mod;
  11. import cpw.mods.fml.common.Mod.Init;
  12. import cpw.mods.fml.common.Mod.Instance;
  13. import cpw.mods.fml.common.Mod.PostInit;
  14. import cpw.mods.fml.common.Mod.PreInit;
  15. import cpw.mods.fml.common.SidedProxy;
  16. import cpw.mods.fml.common.event.FMLInitializationEvent;
  17. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  18. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  19. import cpw.mods.fml.common.network.NetworkMod;
  20. import cpw.mods.fml.common.registry.GameRegistry;
  21. import cpw.mods.fml.common.registry.LanguageRegistry;
  22.  
  23. @Mod(modid="compactblocks", name="compactblocks", version="0.0.01")
  24. @NetworkMod(clientSideRequired=true, serverSideRequired=false)
  25. public class compactblocks {
  26.  
  27.         // The instance of your mod that Forge uses.
  28.     @Instance("compactblocks")
  29.     public static compactblocks instance;
  30.     ///id's
  31.     public static int compactdirtID;
  32.     public static int compactcobblestoneID;
  33.      ///id's
  34.     public final static Block compactdirt = new compactdirt(compactdirtID, 2, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact Dirt").setCreativeTab(CreativeTabs.tabBlock);
  35.     public final static Block compactcobblestone = new compactcobblestone(compactcobblestoneID, 3, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact cobblestone").setCreativeTab(CreativeTabs.tabBlock);
  36.     public final static Block compactstone = new compactstone(502, 4, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact stone").setCreativeTab(CreativeTabs.tabBlock);
  37.     public final static Block compactgravel = new compactgravel(503, 5, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact gravel").setCreativeTab(CreativeTabs.tabBlock);
  38.     public final static Block compactsand = new compactsand(504, 6, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact sand").setCreativeTab(CreativeTabs.tabBlock);
  39.     public final static Block compactobsidian = new compactobsidian(505, 7, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact obsidian").setCreativeTab(CreativeTabs.tabBlock);
  40.     public final static Block compactcactus = new compactcactus(506, 8, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact cactus").setCreativeTab(CreativeTabs.tabBlock);
  41.     public final static Block compactlogs = new compactlogs(507, 9, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact log").setCreativeTab(CreativeTabs.tabBlock);
  42.     public final static Block compactsandstone = new compactsandstone(508, 10, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact sandstone").setCreativeTab(CreativeTabs.tabBlock);
  43.     public final static Block compactnetherrack = new compactnetherrack(509, 13, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact netherrack").setCreativeTab(CreativeTabs.tabBlock);
  44.     //public final static Block compactdirt = new compactdirt(500, 2, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact Dirt").setCreativeTab(CreativeTabs.tabBlock);
  45.     //public final static Block compactdirt = new compactdirt(500, 2, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact Dirt").setCreativeTab(CreativeTabs.tabBlock);
  46.     //public final static Block compactdirt = new compactdirt(500, 2, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact Dirt").setCreativeTab(CreativeTabs.tabBlock);
  47.     //public final static Block compactdirt = new compactdirt(500, 2, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact Dirt").setCreativeTab(CreativeTabs.tabBlock);
  48.     public final static Block compactredstone = new compactredstone(510, 11, Material.wood).setHardness(0.5F).setStepSound(Block.soundWoodFootstep).setBlockName("compact redstone").setCreativeTab(CreativeTabs.tabBlock);
  49.     private final static Item compactItemone = new compactItemone(5000);
  50.     public final static Item compactItemtwo = new compactItemtwo(5001).setMaxStackSize(16).setIconIndex(1).setItemName("compactItemtwo");
  51.     // Says where the client and server 'proxy' code is loaded.
  52.     @SidedProxy(clientSide="sidthesloth.compact.blocks.client.ClientProxy", serverSide="sidthesloth.compact.blocks.CommonProxy")
  53.     public static CommonProxy proxy;
  54.    
  55.     @PreInit
  56.     public void preInit(FMLPreInitializationEvent event) {
  57.         // Stub Method
  58.         Configuration config = new Configuration(event.getSuggestedConfigurationFile());
  59.        
  60.         config.load();
  61.        
  62.          compactdirtID= config.get(Configuration.CATEGORY_BLOCK, "compact dirt ID", 500).getInt();
  63.          compactcobblestoneID= config.get(Configuration.CATEGORY_BLOCK, "compact cobblestone ID", 501).getInt();
  64.        
  65.         config.save();
  66.        
  67.     }
  68.    
  69.     @Init
  70.     public void load(FMLInitializationEvent event) {
  71.         LanguageRegistry.addName(compactItemone, "compactItemone");
  72.        
  73.         LanguageRegistry.addName(compactItemtwo, "compactItemtwo");
  74.        
  75.         LanguageRegistry.addName(compactdirt, "compact Dirt");
  76.         MinecraftForge.setBlockHarvestLevel(compactdirt, "axe", 0);
  77.         GameRegistry.registerBlock(compactdirt);
  78.        
  79.         LanguageRegistry.addName(compactcobblestone, "compact cobblestone");
  80.         MinecraftForge.setBlockHarvestLevel(compactcobblestone, "axe", 0);
  81.         GameRegistry.registerBlock(compactcobblestone);
  82.        
  83.         LanguageRegistry.addName(compactstone, "compact stone");
  84.         MinecraftForge.setBlockHarvestLevel(compactstone, "axe", 0);
  85.         GameRegistry.registerBlock(compactstone);
  86.        
  87.         LanguageRegistry.addName(compactgravel, "compact gravel");
  88.         MinecraftForge.setBlockHarvestLevel(compactgravel, "axe", 0);
  89.         GameRegistry.registerBlock(compactgravel);
  90.        
  91.         LanguageRegistry.addName(compactsand, "compact sand");
  92.         MinecraftForge.setBlockHarvestLevel(compactsand, "axe", 0);
  93.         GameRegistry.registerBlock(compactsand);
  94.        
  95.         LanguageRegistry.addName(compactobsidian, "compact obsidian");
  96.         MinecraftForge.setBlockHarvestLevel(compactobsidian, "axe", 0);
  97.         GameRegistry.registerBlock(compactobsidian);
  98.        
  99.         LanguageRegistry.addName(compactcactus, "compact cactus");
  100.         MinecraftForge.setBlockHarvestLevel(compactcactus, "axe", 0);
  101.         GameRegistry.registerBlock(compactcactus);
  102.        
  103.         LanguageRegistry.addName(compactlogs, "compact logs");
  104.         MinecraftForge.setBlockHarvestLevel(compactlogs, "axe", 0);
  105.         GameRegistry.registerBlock(compactlogs);
  106.        
  107.         LanguageRegistry.addName(compactsandstone, "compact sandstone");
  108.         MinecraftForge.setBlockHarvestLevel(compactsandstone, "axe", 0);
  109.         GameRegistry.registerBlock(compactsandstone);
  110.        
  111.         LanguageRegistry.addName(compactnetherrack, "compact netherrack");
  112.         MinecraftForge.setBlockHarvestLevel(compactnetherrack, "axe", 0);
  113.         GameRegistry.registerBlock(compactnetherrack);
  114.        
  115.         LanguageRegistry.addName(compactredstone, "compact redstone");
  116.         MinecraftForge.setBlockHarvestLevel(compactredstone, "axe", 0);
  117.         GameRegistry.registerBlock(compactredstone);
  118.        
  119.        
  120.         //LanguageRegistry.addName(genericOre, "Generic Ore");
  121.         //MinecraftForge.setBlockHarvestLevel(genericOre, "pickaxe", 3);
  122.         //.registerBlock(genericOre);
  123.         // End Basic Blocks#
  124.         ItemStack compactItemoneStack = new ItemStack(compactItemone);
  125.         GameRegistry.addRecipe(new ItemStack(compactItemone, 16), "xxx", " y ", "xxx",
  126.                 'x', Block.planks, 'y', Item.stick);
  127.         //
  128.        
  129.         ItemStack compactdirtStack= new ItemStack(compactdirt);
  130.         GameRegistry.addRecipe(new ItemStack(compactdirt), "xxx", "xyx", "xxx",
  131.                 'x', Block.dirt, 'y', compactItemone);
  132.        
  133.         ItemStack compactcobblestoneStack= new ItemStack(compactcobblestone);
  134.         GameRegistry.addRecipe(new ItemStack(compactcobblestone), "xxx", "xyx", "xxx",
  135.                 'x', Block.cobblestone, 'y', compactItemone);
  136.        
  137.         ItemStack compactstoneStack= new ItemStack(compactstone);
  138.         GameRegistry.addRecipe(new ItemStack(compactstone), "xxx", "xyx", "xxx",
  139.                 'x', Block.stone, 'y', compactItemone);
  140.        
  141.         ItemStack compactgravelStack= new ItemStack(compactgravel);
  142.         GameRegistry.addRecipe(new ItemStack(compactgravel), "xxx", "xyx", "xxx",
  143.                 'x', Block.gravel, 'y', compactItemone);
  144.        
  145.         ItemStack compactsandStack= new ItemStack(compactsand);
  146.         GameRegistry.addRecipe(new ItemStack(compactsand), "xxx", "xyx", "xxx",
  147.                 'x', Block.sand, 'y', compactItemone);
  148.        
  149.         ItemStack compactobsidianStack= new ItemStack(compactobsidian);
  150.         GameRegistry.addRecipe(new ItemStack(compactobsidian), "xxx", "xyx", "xxx",
  151.                 'x', Block.obsidian, 'y', compactItemone);
  152.        
  153.         ItemStack compactcactusStack= new ItemStack(compactcactus);
  154.         GameRegistry.addRecipe(new ItemStack(compactcactus), "xxx", "xyx", "xxx",
  155.                 'x', Block.cactus, 'y', compactItemone);
  156.        
  157.         ItemStack compactlogsStack= new ItemStack(compactlogs);
  158.         GameRegistry.addRecipe(new ItemStack(compactlogs), "xxx", "xyx", "xxx",
  159.                 'x', Block.wood, 'y', compactItemone);
  160.        
  161.         ItemStack compactsandstoneStack= new ItemStack(compactsandstone);
  162.         GameRegistry.addRecipe(new ItemStack(compactsandstone), "xxx", "xyx", "xxx",
  163.                 'x', Block.sandStone, 'y', compactItemone);
  164.        
  165.         ItemStack compactnetherrackStack= new ItemStack(compactnetherrack);
  166.         GameRegistry.addRecipe(new ItemStack(compactnetherrack), "xxx", "xyx", "xxx",
  167.                 'x', Block.netherrack, 'y', compactItemone);
  168.        
  169.         ItemStack compactredstoneStack= new ItemStack(compactredstone);
  170.         GameRegistry.addRecipe(new ItemStack(compactredstone), "xxx", "xyx", "xxx",
  171.                 'x', Item.redstone, 'y', compactItemone);
  172.        
  173.         //ItemStack compactItemoneStack = new ItemStack(compactItemone);
  174.         GameRegistry.addShapelessRecipe(new ItemStack(Block.dirt, 8), new ItemStack(compactdirt));
  175.         //proxy.registerRenderers();
  176.        
  177.         GameRegistry.addShapelessRecipe(new ItemStack(Block.cobblestone, 8), new ItemStack(compactcobblestone));
  178.         //proxy.registerRenderers();
  179.        
  180.         GameRegistry.addShapelessRecipe(new ItemStack(Block.stone, 8), new ItemStack(compactstone));
  181.         //proxy.registerRenderers();
  182.        
  183.         GameRegistry.addShapelessRecipe(new ItemStack(Block.gravel, 8), new ItemStack(compactgravel));
  184.         //proxy.registerRenderers();
  185.        
  186.         GameRegistry.addShapelessRecipe(new ItemStack(Block.sand, 8), new ItemStack(compactsand));
  187.         //proxy.registerRenderers();
  188.        
  189.         GameRegistry.addShapelessRecipe(new ItemStack(Block.obsidian, 8), new ItemStack(compactobsidian));
  190.         //proxy.registerRenderers();
  191.        
  192.         GameRegistry.addShapelessRecipe(new ItemStack(Block.cactus, 8), new ItemStack(compactcactus));
  193.         //proxy.registerRenderers();
  194.        
  195.         GameRegistry.addShapelessRecipe(new ItemStack(Block.wood, 8), new ItemStack(compactlogs));
  196.         //proxy.registerRenderers();
  197.        
  198.         GameRegistry.addShapelessRecipe(new ItemStack(Block.sandStone, 8), new ItemStack(compactsandstone));
  199.         //proxy.registerRenderers();
  200.        
  201.         GameRegistry.addShapelessRecipe(new ItemStack(Block.netherrack, 8), new ItemStack(compactnetherrack));
  202.         //proxy.registerRenderers();
  203.        
  204.         GameRegistry.addShapelessRecipe(new ItemStack(Item.redstone, 8), new ItemStack(compactredstone));
  205.         //proxy.registerRenderers();
  206.        
  207.         proxy.registerRenderers();
  208.     }
  209.    
  210.     @PostInit
  211.     public void postInit(FMLPostInitializationEvent event) {
  212.         // Stub Method
  213.     }
  214. }
RAW Paste Data