SHARE
TWEET

Classe principale

a guest Mar 1st, 2014 11 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package modendercraft;
  2.  
  3. // les imports :
  4. import java.awt.Color;
  5.  
  6. import net.minecraft.block.Block;
  7. import net.minecraft.creativetab.CreativeTabs;
  8. import net.minecraft.entity.EnumCreatureType;
  9. import net.minecraft.item.EnumArmorMaterial;
  10. import net.minecraft.item.EnumToolMaterial;
  11. import net.minecraft.item.Item;
  12. import net.minecraft.item.ItemStack;
  13. import net.minecraftforge.common.EnumHelper;
  14. import cpw.mods.fml.common.Mod;
  15. import cpw.mods.fml.common.Mod.EventHandler;
  16. import cpw.mods.fml.common.Mod.Instance;
  17. import cpw.mods.fml.common.SidedProxy;
  18. import cpw.mods.fml.common.event.FMLInitializationEvent;
  19. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  20. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  21. import cpw.mods.fml.common.network.NetworkMod;
  22. import cpw.mods.fml.common.registry.EntityRegistry;
  23. import cpw.mods.fml.common.registry.GameRegistry;
  24. import cpw.mods.fml.common.registry.LanguageRegistry;
  25.  
  26. //Le mod :
  27. @Mod(modid="EnderCraft", name="Mod EnderCraft", version="1.0.0")
  28. @NetworkMod(clientSideRequired=true, serverSideRequired=false) // NE PAS MODIFIER CETTE LIGNE
  29. public class modendercraftmain {
  30.  
  31.         public static Item ACEG, APEG, AJEG, ANEG;
  32.     public static Item FDE;
  33.     public static Item BDE;
  34.         public static Item HDE;
  35.     public static Item EDG;
  36.     public static Item PDE;
  37.    
  38.     static EnumToolMaterial FDG= EnumHelper.addToolMaterial("FDG", 3, 2000, 10.0F, 2, 50);
  39.     static EnumToolMaterial BDG= EnumHelper.addToolMaterial("BDG", 3, 2000, 10.0F, 2, 50);
  40.     static EnumToolMaterial HDG= EnumHelper.addToolMaterial("HDG", 3, 2000, 10.0F, 2, 50);
  41.     static EnumToolMaterial PDG= EnumHelper.addToolMaterial("PDG", 3, 2000, 10.0F, 2, 50);
  42.     static EnumToolMaterial EDE= EnumHelper.addToolMaterial("EDE", 0, 1500, 0F, 3, 50);
  43.     static EnumArmorMaterial MA1 = EnumHelper.addArmorMaterial("Gemme", 40, new int[]{4, 10, 7,  4}, 10);
  44.         //Creative tabs
  45.         public static CreativeTabs CTE = new CTEJ("EnderCraft");
  46.                              
  47.   @Instance("EnderCraft")
  48.   public static modendercraftmain instance;
  49.   public static Block BMG;
  50.   public static Block MDG;
  51.   public static Item GM2;
  52.  
  53.         @SidedProxy(clientSide="modendercraft.ClientProxy", serverSide="modendercraft.CommonProxy")
  54.         public static CommonProxy proxy;
  55.        
  56.         @EventHandler
  57.         public void preInit(FMLPreInitializationEvent event) {
  58.   }
  59.        @EventHandler
  60.         public void init(FMLInitializationEvent event)
  61.         {
  62.                 proxy.registerRender();
  63.                
  64.                   //gemme clean
  65.                 GM2 = new GEMME2(8650).setTextureName("te:gemme") .setCreativeTab(CTE);
  66.             GameRegistry.registerItem(GM2, "Gemme");
  67.             LanguageRegistry.addName(GM2, "Gemme");
  68.           //minerai et bloc
  69.             MDG = new MDG(4001).setHardness(3.0F).setResistance(7.0F).setCreativeTab(CTE).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("mineraidegemme").setTextureName("te:geore");
  70.         BMG = new BMG (4000) .setHardness(5.0F)  .setResistance(5.0F) .setCreativeTab(CTE) .setStepSound(Block.soundMetalFootstep) .setUnlocalizedName("Bloc de gemme") .setTextureName("te:rm") ;
  71.        //register.minerai de gemme
  72.         GameRegistry.registerBlock(MDG, "MDG");
  73.         LanguageRegistry.addName(MDG, "Minerai de gemme");
  74.         //register.block
  75.         GameRegistry.registerBlock(BMG, "BMG");
  76.         LanguageRegistry.addName(BMG, "Bloc de gemme");
  77.        
  78.                 //LIGNE DE CODE DU MOB
  79.                 EntityRegistry.registerGlobalEntityID(EntityChevalier.class, "Chevalier de gemme", EntityRegistry.findGlobalUniqueEntityId(), new Color(255, 0, 255).getRGB(), new Color(0, 0, 0).getRGB());
  80.             EntityRegistry.addSpawn(EntityChevalier.class, 3, 1, 3, EnumCreatureType.creature);
  81.             EntityRegistry.registerModEntity(EntityChevalier.class, "Chevalier de gemme", 9192, this, 50, 1, true);
  82.                 LanguageRegistry.instance().addStringLocalization("entity.Chevalier de gemme.name", "Chevalier de gemme");
  83.        
  84.                 //Outils et epee
  85.                 FDE = new FDGC(1004, FDG).setTextureName("te:houeg").setUnlocalizedName("C23D").setCreativeTab(CTE);
  86.                 LanguageRegistry.addName(FDE, "Houe en Gemme");
  87.                 BDE = new BDGC(1003, BDG).setTextureName("te:pelleg").setUnlocalizedName("C13D").setCreativeTab(CTE);
  88.                 LanguageRegistry.addName(BDE, "Pelle en Gemme");
  89.                 PDE = new PDGC(1001, PDG).setTextureName("te:piocheg").setUnlocalizedName("C123").setCreativeTab(CTE);
  90.                 LanguageRegistry.addName(PDE, "Pioche en Gemme");
  91.                 EDG = new EDEC(899, EDE).setTextureName("te:epeedelend").setUnlocalizedName("CQVV").setCreativeTab(CTE);
  92.                 LanguageRegistry.addName(EDG, "Epee en gemme");
  93.                 GameRegistry.registerItem(EDG,"EDG");
  94.                 HDE = new HDGC(1002, HDG).setTextureName("te:hacheg").setUnlocalizedName("C12").setCreativeTab(CTE);
  95.                 LanguageRegistry.addName(HDE, "Hache en Gemme");
  96.                 // ARMURE: ACEG, APEG, AJEG, ANEG
  97.                 ACEG = new A1C(3000, MA1, 0, 0).setUnlocalizedName("AZERTY1").setTextureName("te:IC").setCreativeTab(CTE);
  98.                 APEG = new A1C(3001, MA1, 0, 1).setUnlocalizedName("AZERTY2").setTextureName("te:IA").setCreativeTab(CTE);
  99.                 AJEG  = new A1C(3002, MA1, 0, 2).setUnlocalizedName("AZERTY3").setTextureName("te:IJ").setCreativeTab(CTE);
  100.                 ANEG  = new A1C(3003, MA1, 0, 3).setUnlocalizedName("AZERTY4").setTextureName("te:IB").setCreativeTab(CTE);
  101.                 GameRegistry.registerItem(ACEG, "AZERTY11");
  102.                 GameRegistry.registerItem(APEG, "AZERTY22");
  103.                 GameRegistry.registerItem(AJEG, "AZERTY33");
  104.                 GameRegistry.registerItem(ANEG, "AZERTY44");
  105.                 LanguageRegistry.addName(ACEG, "Casque en Gemme");
  106.                 LanguageRegistry.addName(APEG, "Plastron en Gemme");
  107.                 LanguageRegistry.addName(AJEG, "Jambiere en Gemme");
  108.                 LanguageRegistry.addName(ANEG, "Bottes en Gemme");
  109.                 // pour la generation du minerai
  110.                 GameRegistry.registerWorldGenerator(new WorldGeneratorGemmeore());
  111.                 // les crafts recettes etc...
  112.                 GameRegistry.addShapelessRecipe(new ItemStack(GM2 ,9), new Object[]{ BMG });
  113.                 GameRegistry.addRecipe(new ItemStack(APEG), new Object[]{"XYX", "XXX", "XXX", 'X', GM2});
  114.                 GameRegistry.addRecipe(new ItemStack(ACEG), new Object[]{"XXX", "XYX", 'X', GM2});
  115.                 GameRegistry.addRecipe(new ItemStack(ANEG), new Object[]{"XYX","XYX", 'X', GM2});
  116.                 GameRegistry.addRecipe(new ItemStack(AJEG), new Object[]{"XXX", "XYX", "XYX", 'X', GM2});
  117.                 GameRegistry.addRecipe(new ItemStack(PDE), new Object[]{"XXX", "ZYZ", "ZYZ", 'X', new ItemStack(GM2), 'Y', Item.stick});
  118.                 GameRegistry.addRecipe(new ItemStack(BDE), new Object[]{"ZXZ", "ZYZ", "ZYZ", 'X', new ItemStack(GM2), 'Y', Item.stick});
  119.                 GameRegistry.addRecipe(new ItemStack(FDE), new Object[]{"XXZ", "ZYZ", "ZYZ", 'X', new ItemStack(GM2), 'Y', Item.stick});
  120.                 GameRegistry.addRecipe(new ItemStack(FDE), new Object[]{"ZXX", "ZYZ", "ZYZ", 'X', new ItemStack(GM2), 'Y', Item.stick});
  121.                 GameRegistry.addRecipe(new ItemStack(HDE), new Object[]{"ZXX", "ZYX", "ZYZ", 'X', new ItemStack(GM2), 'Y', Item.stick});
  122.                 GameRegistry.addRecipe(new ItemStack(HDE), new Object[]{"XXZ", "XYZ", "ZYZ", 'X', new ItemStack(GM2), 'Y', Item.stick});
  123.                 GameRegistry.addRecipe(new ItemStack(EDG), new Object[]{"ZXZ", "ZXZ", "ZYZ", 'X', new ItemStack(GM2), 'Y', Item.stick});
  124.         }
  125.        
  126.        
  127.         @EventHandler
  128.         public void postInit(FMLPostInitializationEvent event) {                 
  129.  
  130.         }
  131.        
  132. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top