Guest User

main class

a guest
Oct 26th, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.01 KB | None | 0 0
  1. package tutorial.generic;
  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.ItemStack;
  10. import net.minecraftforge.common.config.Configuration;
  11. import cpw.mods.fml.common.Mod;
  12. import cpw.mods.fml.common.Mod.EventHandler; // used in 1.6.2
  13. import cpw.mods.fml.common.Mod.Instance;
  14. import cpw.mods.fml.common.SidedProxy;
  15. import cpw.mods.fml.common.event.FMLInitializationEvent;
  16. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  17. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  18. import cpw.mods.fml.common.registry.GameRegistry;
  19. import net.minecraftforge.common.config.*;
  20.  
  21. @Mod(modid="yesodmod", name="Yesod Mod", version="1.0.0")
  22. public class Generic {
  23.  
  24.  
  25.         // The instance of your mod that Forge uses.
  26.         @Instance(value = "yesodmod")
  27.         public static Generic instance;
  28.        
  29.         // Says where the client and server 'proxy' code is loaded.
  30.         @SidedProxy(clientSide="tutorial.generic.client.ClientProxy", serverSide="tutorial.generic.CommonProxy")
  31.         public static CommonProxy proxy;
  32.         /**
  33.          * Item
  34.          */
  35.         public static Item explosiveFlint;
  36.         public static Item explosiveArrow;
  37.         public static Item blazeBow;
  38.         public static Item heatedString;
  39.         /**
  40.          * Blocchi
  41.          */
  42.         public static Block stoneGlowstone;
  43.         public static Block explosiveFlintOre;
  44.        
  45.         @EventHandler // used in 1.6.2
  46.         public void preInit(FMLPreInitializationEvent event) { 
  47.             /**
  48.              * Parte di aggiunta nuovi item
  49.              */
  50.             explosiveFlint = new GenericItem(64, CreativeTabs.tabMaterials, 1, "explosiveFlint" ).setTextureName("yesodmod:explosiveflint");
  51.             GameRegistry.registerItem(explosiveFlint,"explosiveFlint");
  52.             explosiveArrow = new GenericItem(64, CreativeTabs.tabCombat, 2, "explosiveArrow").setTextureName("yesodmod:explosivearrow");
  53.             GameRegistry.registerItem(explosiveArrow, "ExplosiveArrow");
  54.             heatedString = new GenericItem(64, CreativeTabs.tabMaterials, 3, "heatedString").setTextureName("yesodmod:heatedstring");
  55.             GameRegistry.registerItem(heatedString, "heatedString");
  56.             Item blazeBow = new blazeBow();
  57.             GameRegistry.registerItem(blazeBow, "blazeBow");
  58.             /** Parte di aggiunta nuovi blocchi
  59.              *
  60.              */
  61.             stoneGlowstone = new GenericBlock(Material.rock).setHardness(1.5f)
  62.                     .setStepSound(Block.soundTypeStone).setBlockName("stoneGlowstone").setCreativeTab(CreativeTabs.tabBlock)
  63.                     .setLightLevel(1.0f).setBlockTextureName("yesodmod:stoneGlowstone").setBlockTextureName("yesodmod:stoneglowstone");
  64.             stoneGlowstone.setHarvestLevel("pickaxe", 1);
  65.             explosiveFlintOre = new GenericOre(Material.rock, 1.5f, "explosiveFlintOre", "pickaxe", 1).setBlockTextureName("yesodmod:explosiveflintore");
  66.         }
  67.        
  68.         @EventHandler // used in 1.6.2
  69.         public void load(FMLInitializationEvent event) {
  70.                 proxy.registerRenderers();
  71.                
  72.                 /** Parte di crafting e smelting
  73.                  *
  74.                  */
  75.                 ItemStack featherStack = new ItemStack(Items.feather);
  76.                 ItemStack stickStack = new ItemStack(Items.stick);
  77.                 ItemStack explosiveFlintStack = new ItemStack(Generic.explosiveFlint);
  78.                 ItemStack blazeRodStack = new ItemStack(Items.blaze_rod);
  79.                 ItemStack stringStack = new ItemStack(Items.string);
  80.                 ItemStack blazePowderStack = new ItemStack(Items.blaze_powder);
  81.                 ItemStack heatedStringStack = new ItemStack(Generic.heatedString);
  82.                
  83.                 GameRegistry.addRecipe(new ItemStack(Generic.explosiveArrow,4), "x  ", " y ", "  z", 'x',
  84.                         explosiveFlintStack, 'y', stickStack, 'z', featherStack );
  85.                 GameRegistry.addRecipe(new ItemStack(Generic.heatedString,3), "xxx", " y ",
  86.                         'x', stringStack, 'y', blazePowderStack );
  87.                 GameRegistry.addRecipe(new ItemStack(Generic.heatedString,3), "   ", "xxx", " y ",
  88.                         'x', heatedStringStack, 'y', blazePowderStack );
  89.                 GameRegistry.addRecipe(new ItemStack(Generic.blazeBow,1,500), "xy ", "x y", "xy ",'x',stringStack, 'y', blazeRodStack);
  90.                
  91.                  /**
  92.                  * Parte di aggiunta nuovi blocchi
  93.                  */
  94.                 GameRegistry.registerBlock(stoneGlowstone, "Pietraluce rocciosa");
  95.                 GameRegistry.registerBlock(explosiveFlintOre, "Flint esplosiva grezza");
  96.                 GameRegistry.registerWorldGenerator(new YesodWorldGenerator(), 0);
  97.         }
  98.         @EventHandler // used in 1.6.2
  99.         public void postInit(FMLPostInitializationEvent event) {
  100.                 // Stub Method
  101.         }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment