Guest User

WulfeniteBlocks.java

a guest
Aug 19th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.22 KB | None | 0 0
  1. package com.xenocorpse.wulfenite.init;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.block.material.Material;
  5. import net.minecraft.client.Minecraft;
  6. import net.minecraft.client.resources.model.ModelResourceLocation;
  7. import net.minecraft.creativetab.CreativeTabs;
  8. import net.minecraft.item.Item;
  9. import net.minecraftforge.fml.common.registry.GameRegistry;
  10.  
  11. import com.xenocorpse.wulfenite.Wulfenite;
  12. import com.xenocorpse.wulfenite.WulfeniteTab;
  13. import com.xenocorpse.wulfenite.blocks.BlockFoolsgold;
  14. import com.xenocorpse.wulfenite.blocks.BlockGrinder;
  15. import com.xenocorpse.wulfenite.blocks.BlockMathewmite;
  16. import com.xenocorpse.wulfenite.blocks.BlockMolybdenum;
  17. import com.xenocorpse.wulfenite.blocks.BlockRuby;
  18. import com.xenocorpse.wulfenite.blocks.BlockWulfenite;
  19. import com.xenocorpse.wulfenite.blocks.OreMolybdenum;
  20. import com.xenocorpse.wulfenite.blocks.OrePyrite;
  21. import com.xenocorpse.wulfenite.blocks.OreRuby;
  22. import com.xenocorpse.wulfenite.blocks.OreWulfenite;
  23.  
  24. public class wulfeniteBlocks {
  25.    
  26.     public static Block wulfenite_ore;
  27.     public static Block ruby_ore;
  28.     public static Block wulfenite_block;
  29.     public static Block ruby_block;
  30.     public static Block mathewmite;
  31.     public static Block molybdenum_ore;
  32.     public static Block molybdenum_block;
  33.     public static Block pyrite_ore;
  34.     public static Block foolsgold_block;
  35.     public static Block grinder;
  36.    
  37.     public static void init(){
  38.        
  39.         wulfenite_ore = new OreWulfenite(Material.rock).setUnlocalizedName("wulfenite_ore").setCreativeTab(Wulfenite.tabWulfenite);
  40.         wulfenite_block = new BlockWulfenite(Material.glass).setUnlocalizedName("wulfenite_block").setCreativeTab(Wulfenite.tabWulfenite);
  41.         mathewmite = new BlockMathewmite(Material.glass).setUnlocalizedName("mathewmite").setCreativeTab(Wulfenite.tabWulfenite);
  42.         ruby_ore = new OreRuby(Material.rock).setUnlocalizedName("ruby_ore").setCreativeTab(Wulfenite.tabWulfenite);
  43.         ruby_block = new BlockRuby(Material.iron).setUnlocalizedName("ruby_block").setCreativeTab(Wulfenite.tabWulfenite);
  44.         molybdenum_ore = new OreMolybdenum(Material.rock).setUnlocalizedName("molybdenum_ore").setCreativeTab(Wulfenite.tabWulfenite);
  45.         molybdenum_block = new BlockMolybdenum(Material.iron).setUnlocalizedName("molybdenum_block").setCreativeTab(Wulfenite.tabWulfenite);
  46.         pyrite_ore = new OrePyrite(Material.rock).setUnlocalizedName("pyrite_ore").setCreativeTab(Wulfenite.tabWulfenite);
  47.         foolsgold_block = new BlockFoolsgold(Material.iron).setUnlocalizedName("foolsgold_block").setCreativeTab(Wulfenite.tabWulfenite);
  48.         grinder = new BlockGrinder(Material.iron).setUnlocalizedName("grinder").setCreativeTab(Wulfenite.tabWulfenite);
  49.     }
  50.    
  51.     public static void register(){
  52.        
  53.         GameRegistry.registerBlock(wulfenite_ore, wulfenite_ore.getUnlocalizedName().substring(5));
  54.         GameRegistry.registerBlock(ruby_ore,  ruby_ore.getUnlocalizedName().substring(5));
  55.         GameRegistry.registerBlock(molybdenum_ore,  molybdenum_ore.getUnlocalizedName().substring(5));
  56.         GameRegistry.registerBlock(pyrite_ore, pyrite_ore.getUnlocalizedName().substring(5));
  57.         GameRegistry.registerBlock(wulfenite_block, wulfenite_block.getUnlocalizedName().substring(5));
  58.         GameRegistry.registerBlock(mathewmite,  mathewmite.getUnlocalizedName().substring(5));
  59.         GameRegistry.registerBlock(ruby_block,  ruby_block.getUnlocalizedName().substring(5));
  60.         GameRegistry.registerBlock(molybdenum_block, molybdenum_block.getUnlocalizedName().substring(5));
  61.         GameRegistry.registerBlock(foolsgold_block, foolsgold_block.getUnlocalizedName().substring(5));
  62.         GameRegistry.registerBlock(grinder, grinder.getUnlocalizedName().substring(5));
  63.     }
  64.    
  65.     public static void registerRenders(){
  66.        
  67.         registerRender(wulfenite_ore);
  68.         registerRender(ruby_ore);
  69.         registerRender(molybdenum_ore);
  70.         registerRender(pyrite_ore);
  71.         registerRender(wulfenite_block);
  72.         registerRender(mathewmite);
  73.         registerRender(ruby_block);
  74.         registerRender(molybdenum_block);
  75.         registerRender(foolsgold_block);
  76.        
  77.     }
  78.    
  79.     public static void registerRender(Block block){
  80.        
  81.         Item item = Item.getItemFromBlock(block);
  82.         Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Wulfenite.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
  83.        
  84.     }
  85.  
  86. }
Advertisement
Add Comment
Please, Sign In to add comment