Advertisement
Guest User

Untitled

a guest
Jun 29th, 2015
236
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Pour traduire des choses etc
  2. ​package com.thetorine.thirstmod.core.main;
  3.  
  4. import java.io.File;
  5. import java.lang.reflect.Field;
  6.  
  7. import com.thetorine.thirstmod.core.content.BlockLoader;
  8. import com.thetorine.thirstmod.core.content.ItemLoader;
  9. import com.thetorine.thirstmod.core.content.packs.ContentLoader;
  10. import com.thetorine.thirstmod.core.content.packs.DrinkRegistry;
  11. import com.thetorine.thirstmod.core.network.*;
  12. import com.thetorine.thirstmod.core.player.PlayerContainer;
  13. import com.thetorine.thirstmod.core.utils.Config;
  14. import com.thetorine.thirstmod.core.utils.Constants;
  15.  
  16. import cpw.mods.fml.common.Mod;
  17. import cpw.mods.fml.common.Mod.EventHandler;
  18. import cpw.mods.fml.common.Mod.Instance;
  19. import cpw.mods.fml.common.event.*;
  20. import cpw.mods.fml.common.network.*;
  21. import cpw.mods.fml.common.*;
  22. import cpw.mods.fml.relauncher.Side;
  23. import net.minecraft.creativetab.CreativeTabs;
  24. import net.minecraft.item.Item;
  25. import net.minecraftforge.common.*;
  26.  
  27. @Mod(modid = Constants.MODID, version = Constants.VERSION, name = Constants.NAME)
  28. public class ThirstMod {
  29. @Instance(Constants.MODID)
  30. public static ThirstMod instance;
  31. public static EventSystem eventHook = new EventSystem();
  32. public static Config config = new Config();
  33.  
  34. @SidedProxy(clientSide = Constants.PACKAGE + ".core.client.ClientProxy", serverSide = Constants.PACKAGE + ".core.main.CommonProxy")
  35. public static CommonProxy commonProxy;
  36.  
  37. @EventHandler
  38. public void preInit(FMLPreInitializationEvent event) {
  39. FMLCommonHandler.instance().bus().register(eventHook);
  40. MinecraftForge.EVENT_BUS.register(eventHook);
  41. NetworkRegistry.INSTANCE.registerGuiHandler(this, eventHook);
  42. loadMain();
  43. }
  44.  
  45. @EventHandler
  46. public void postInit(FMLPostInitializationEvent event) {
  47. new DrinkRegistry();
  48. }
  49.  
  50. @EventHandler
  51. public void serverClosed(FMLServerStoppedEvent event) {
  52. if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
  53. PlayerContainer.ALL_PLAYERS.clear();
  54. }
  55. }
  56.  
  57. public void loadMain() {
  58. new NetworkHandler();
  59. new BlockLoader();
  60. new ItemLoader();
  61. new ContentLoader();
  62. }
  63.  
  64. public static String getMinecraftDir() {
  65. try {
  66. Field mcDataDir = Loader.class.getDeclaredField("minecraftDir");
  67. if(mcDataDir != null) {
  68. mcDataDir.setAccessible(true);
  69. return ((File)mcDataDir.get(null)).getAbsolutePath();
  70. }
  71. throw new Exception();
  72. } catch(Exception e) {
  73. print("Unable to retrieve Minecraft Directory.");
  74. return null;
  75. }
  76. }
  77.  
  78. public static void print(String s) {
  79. System.out.println("[Thirst mod] " + s);
  80. }
  81.  
  82. public static CreativeTabs thirstCreativeTab = new CreativeTabs("drinks") {
  83. @Override
  84. public Item getTabIconItem() {
  85. return ItemLoader.chocolateMilk;
  86. }
  87. };
  88. }
  89.  
  90. ​package com.flansmod.common;
  91.  
  92. import java.io.BufferedReader;
  93. import java.io.File;
  94. import java.io.FileInputStream;
  95. import java.io.FileNotFoundException;
  96. import java.io.FileReader;
  97. import java.io.IOException;
  98. import java.io.InputStreamReader;
  99. import java.lang.reflect.Method;
  100. import java.util.ArrayList;
  101. import java.util.List;
  102. import java.util.zip.ZipEntry;
  103. import java.util.zip.ZipFile;
  104. import java.util.zip.ZipInputStream;
  105.  
  106. import net.minecraft.block.material.Material;
  107. import net.minecraft.command.CommandHandler;
  108. import net.minecraft.entity.item.EntityItem;
  109. import net.minecraft.entity.monster.EntitySkeleton;
  110. import net.minecraft.entity.monster.EntityZombie;
  111. import net.minecraft.init.Items;
  112. import net.minecraft.item.ItemStack;
  113. import net.minecraftforge.common.ForgeChunkManager;
  114. import net.minecraftforge.common.config.Configuration;
  115. import net.minecraftforge.event.entity.item.ItemTossEvent;
  116. import net.minecraftforge.event.entity.living.LivingSpawnEvent;
  117. import net.minecraftforge.event.entity.player.PlayerDropsEvent;
  118. import cpw.mods.fml.client.event.ConfigChangedEvent;
  119. import cpw.mods.fml.common.FMLCommonHandler;
  120. import cpw.mods.fml.common.Mod;
  121. import cpw.mods.fml.common.Mod.EventHandler;
  122. import cpw.mods.fml.common.Mod.Instance;
  123. import cpw.mods.fml.common.SidedProxy;
  124. import cpw.mods.fml.common.event.FMLInitializationEvent;
  125. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  126. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  127. import cpw.mods.fml.common.event.FMLServerStartedEvent;
  128. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  129. import cpw.mods.fml.common.network.NetworkRegistry;
  130. import cpw.mods.fml.common.registry.EntityRegistry;
  131. import cpw.mods.fml.common.registry.GameRegistry;
  132. import cpw.mods.fml.relauncher.Side;
  133.  
  134. import com.flansmod.common.driveables.EntityPlane;
  135. import com.flansmod.common.driveables.EntitySeat;
  136. import com.flansmod.common.driveables.EntityVehicle;
  137. import com.flansmod.common.driveables.EntityWheel;
  138. import com.flansmod.common.driveables.ItemPlane;
  139. import com.flansmod.common.driveables.ItemVehicle;
  140. import com.flansmod.common.driveables.PlaneType;
  141. import com.flansmod.common.driveables.VehicleType;
  142. import com.flansmod.common.driveables.mechas.EntityMecha;
  143. import com.flansmod.common.driveables.mechas.ItemMecha;
  144. import com.flansmod.common.driveables.mechas.ItemMechaAddon;
  145. import com.flansmod.common.driveables.mechas.MechaItemType;
  146. import com.flansmod.common.driveables.mechas.MechaType;
  147. import com.flansmod.common.guns.AAGunType;
  148. import com.flansmod.common.guns.AttachmentType;
  149. import com.flansmod.common.guns.BulletType;
  150. import com.flansmod.common.guns.EntityAAGun;
  151. import com.flansmod.common.guns.EntityBullet;
  152. import com.flansmod.common.guns.EntityGrenade;
  153. import com.flansmod.common.guns.EntityMG;
  154. import com.flansmod.common.guns.GrenadeType;
  155. import com.flansmod.common.guns.GunType;
  156. import com.flansmod.common.guns.ItemAAGun;
  157. import com.flansmod.common.guns.ItemAttachment;
  158. import com.flansmod.common.guns.ItemBullet;
  159. import com.flansmod.common.guns.ItemGrenade;
  160. import com.flansmod.common.guns.ItemGun;
  161. import com.flansmod.common.guns.boxes.BlockGunBox;
  162. import com.flansmod.common.guns.boxes.GunBoxType;
  163. import com.flansmod.common.network.PacketHandler;
  164. import com.flansmod.common.parts.ItemPart;
  165. import com.flansmod.common.parts.PartType;
  166. import com.flansmod.common.teams.ArmourBoxType;
  167. import com.flansmod.common.teams.ArmourType;
  168. import com.flansmod.common.teams.BlockArmourBox;
  169. import com.flansmod.common.teams.BlockSpawner;
  170. import com.flansmod.common.teams.ChunkLoadingHandler;
  171. import com.flansmod.common.teams.CommandTeams;
  172. import com.flansmod.common.teams.EntityFlag;
  173. import com.flansmod.common.teams.EntityFlagpole;
  174. import com.flansmod.common.teams.EntityGunItem;
  175. import com.flansmod.common.teams.EntityTeamItem;
  176. import com.flansmod.common.teams.ItemFlagpole;
  177. import com.flansmod.common.teams.ItemOpStick;
  178. import com.flansmod.common.teams.ItemTeamArmour;
  179. import com.flansmod.common.teams.Team;
  180. import com.flansmod.common.teams.TeamsManager;
  181. import com.flansmod.common.teams.TileEntitySpawner;
  182. import com.flansmod.common.tools.EntityParachute;
  183. import com.flansmod.common.tools.ItemTool;
  184. import com.flansmod.common.tools.ToolType;
  185. import com.flansmod.common.types.EnumType;
  186. import com.flansmod.common.types.InfoType;
  187. import com.flansmod.common.types.TypeFile;
  188. import com.flansmod.common.eventhandlers.PlayerDeathEventListener;
  189.  
  190. @Mod(modid = FlansMod.MODID, name = "Flan's Mod", version = FlansMod.VERSION, acceptableRemoteVersions = "@ALLOWEDVERSIONS@", guiFactory = "com.flansmod.client.gui.config.ModGuiFactory")
  191. public class FlansMod
  192. {
  193. //Core mod stuff
  194. public static boolean DEBUG = false;
  195. public static Configuration configFile;
  196. public static final String MODID = "flansmod";
  197. public static final String VERSION = "@VERSION@";
  198. @Instance(MODID)
  199. public static FlansMod INSTANCE;
  200. public static int generalConfigInteger = 32;
  201. public static String generalConfigString = "Hello!";
  202. public static boolean addGunpowderRecipe = true;
  203. public static int teamsConfigInteger = 32;
  204. public static String teamsConfigString = "Hello!";
  205. public static boolean teamsConfigBoolean = false;
  206. @SidedProxy(clientSide = "com.flansmod.client.ClientProxy", serverSide = "com.flansmod.common.CommonProxy")
  207. public static CommonProxy proxy;
  208. //A standardised ticker for all bits of the mod to call upon if they need one
  209. public static int ticker = 0;
  210. public static long lastTime;
  211. public static File flanDir;
  212. public static final float soundRange = 50F;
  213. public static final float driveableUpdateRange = 200F;
  214. public static final int numPlayerSnapshots = 20;
  215.  
  216. public static float armourSpawnRate = 0.25F;
  217.  
  218. /** The spectator team. Moved here to avoid a concurrent modification error */
  219. public static Team spectators = new Team("spectators", "Spectators", 0x404040, '7');
  220.  
  221. //Handlers
  222. public static final PacketHandler packetHandler = new PacketHandler();
  223. public static final PlayerHandler playerHandler = new PlayerHandler();
  224. public static final TeamsManager teamsManager = new TeamsManager();
  225. public static final CommonTickHandler tickHandler = new CommonTickHandler();
  226. public static FlansHooks hooks = new FlansHooks();
  227.  
  228. //Items and creative tabs
  229. public static BlockFlansWorkbench workbench;
  230. public static BlockSpawner spawner;
  231. public static ItemOpStick opStick;
  232. public static ItemFlagpole flag;
  233. public static ArrayList<BlockGunBox> gunBoxBlocks = new ArrayList<BlockGunBox>();
  234. public static ArrayList<ItemBullet> bulletItems = new ArrayList<ItemBullet>();
  235. public static ArrayList<ItemGun> gunItems = new ArrayList<ItemGun>();
  236. public static ArrayList<ItemAttachment> attachmentItems = new ArrayList<ItemAttachment>();
  237. public static ArrayList<ItemPart> partItems = new ArrayList<ItemPart>();
  238. public static ArrayList<ItemPlane> planeItems = new ArrayList<ItemPlane>();
  239. public static ArrayList<ItemVehicle> vehicleItems = new ArrayList<ItemVehicle>();
  240. public static ArrayList<ItemMechaAddon> mechaToolItems = new ArrayList<ItemMechaAddon>();
  241. public static ArrayList<ItemMecha> mechaItems = new ArrayList<ItemMecha>();
  242. public static ArrayList<ItemAAGun> aaGunItems = new ArrayList<ItemAAGun>();
  243. public static ArrayList<ItemGrenade> grenadeItems = new ArrayList<ItemGrenade>();
  244. public static ArrayList<ItemTool> toolItems = new ArrayList<ItemTool>();
  245. public static ArrayList<ItemTeamArmour> armourItems = new ArrayList<ItemTeamArmour>();
  246. public static ArrayList<BlockArmourBox> armourBoxBlocks = new ArrayList<BlockArmourBox>();
  247. public static CreativeTabFlan tabFlanGuns = new CreativeTabFlan(0), tabFlanDriveables = new CreativeTabFlan(1),
  248. tabFlanParts = new CreativeTabFlan(2), tabFlanTeams = new CreativeTabFlan(3), tabFlanMechas = new CreativeTabFlan(4);
  249.  
  250.  
  251. /** The mod pre-initialiser method */
  252. @EventHandler
  253. public void preInit(FMLPreInitializationEvent event)
  254. {
  255. log("Preinitialising Flan's mod.");
  256. configFile = new Configuration(event.getSuggestedConfigurationFile());
  257. syncConfig();
  258.  
  259. //TODO : Load properties
  260. //configuration = new Configuration(event.getSuggestedConfigurationFile());
  261. //loadProperties();
  262.  
  263. flanDir = new File(event.getModConfigurationDirectory().getParentFile(), "/Flan/");
  264.  
  265. if (!flanDir.exists())
  266. {
  267. log("Flan folder not found. Creating empty folder.");
  268. log("You should get some content packs and put them in the Flan folder.");
  269. flanDir.mkdirs();
  270. flanDir.mkdir();
  271. }
  272.  
  273. //Set up mod blocks and items
  274. workbench = (BlockFlansWorkbench)(new BlockFlansWorkbench(1, 0).setBlockName("flansWorkbench").setBlockTextureName("flansWorkbench"));
  275. GameRegistry.registerBlock(workbench, ItemBlockManyNames.class, "flansWorkbench");
  276. GameRegistry.addRecipe(new ItemStack(workbench, 1, 0), "BBB", "III", "III", 'B', Items.bowl, 'I', Items.iron_ingot );
  277. GameRegistry.addRecipe(new ItemStack(workbench, 1, 1), "ICI", "III", 'C', Items.cauldron, 'I', Items.iron_ingot );
  278. opStick = new ItemOpStick();
  279. GameRegistry.registerItem(opStick, "opStick", MODID);
  280. flag = (ItemFlagpole)(new ItemFlagpole().setUnlocalizedName("flagpole"));
  281. GameRegistry.registerItem(flag, "flagpole", MODID);
  282. spawner = (BlockSpawner)(new BlockSpawner(Material.iron).setBlockName("teamsSpawner").setBlockUnbreakable().setResistance(1000000F));
  283. GameRegistry.registerBlock(spawner, ItemBlockManyNames.class, "teamsSpawner");
  284. GameRegistry.registerTileEntity(TileEntitySpawner.class, "teamsSpawner");
  285.  
  286. proxy.registerRenderers();
  287.  
  288. //Read content packs
  289. readContentPacks(event);
  290.  
  291. //Do proxy loading
  292. proxy.load();
  293. //Force Minecraft to reload all resources in order to load content pack resources.
  294. proxy.forceReload();
  295.  
  296. log("Preinitializing complete.");
  297. }
  298.  
  299. /** The mod initialiser method */
  300. @EventHandler
  301. public void init(FMLInitializationEvent event)
  302. {
  303. log("Initialising Flan's Mod.");
  304.  
  305. //Initialising handlers
  306. packetHandler.initialise();
  307. NetworkRegistry.INSTANCE.registerGuiHandler(this, new CommonGuiHandler());
  308.  
  309. // Recipes
  310. for (InfoType type : InfoType.infoTypes)
  311. {
  312. type.addRecipe();
  313. }
  314. if(addGunpowderRecipe)
  315. {
  316. ItemStack charcoal = new ItemStack(Items.coal, 1, 1);
  317. GameRegistry.addShapelessRecipe(new ItemStack(Items.gunpowder), charcoal, charcoal, charcoal, new ItemStack(Items.glowstone_dust));
  318. }
  319. log("Loaded recipes.");
  320.  
  321. //Register teams mod entities
  322. EntityRegistry.registerGlobalEntityID(EntityFlagpole.class, "Flagpole", EntityRegistry.findGlobalUniqueEntityId());
  323. EntityRegistry.registerModEntity(EntityFlagpole.class, "Flagpole", 93, this, 40, 5, true);
  324. EntityRegistry.registerGlobalEntityID(EntityFlag.class, "Flag", EntityRegistry.findGlobalUniqueEntityId());
  325. EntityRegistry.registerModEntity(EntityFlag.class, "Flag", 94, this, 40, 5, true);
  326. EntityRegistry.registerGlobalEntityID(EntityTeamItem.class, "TeamsItem", EntityRegistry.findGlobalUniqueEntityId());
  327. EntityRegistry.registerModEntity(EntityTeamItem.class, "TeamsItem", 97, this, 100, 10000, true);
  328. EntityRegistry.registerGlobalEntityID(EntityGunItem.class, "GunItem", EntityRegistry.findGlobalUniqueEntityId());
  329. EntityRegistry.registerModEntity(EntityGunItem.class, "GunItem", 98, this, 100, 20, true);
  330.  
  331. //Register driveables
  332. EntityRegistry.registerGlobalEntityID(EntityPlane.class, "Plane", EntityRegistry.findGlobalUniqueEntityId());
  333. EntityRegistry.registerModEntity(EntityPlane.class, "Plane", 90, this, 250, 3, false);
  334. EntityRegistry.registerGlobalEntityID(EntityVehicle.class, "Vehicle", EntityRegistry.findGlobalUniqueEntityId());
  335. EntityRegistry.registerModEntity(EntityVehicle.class, "Vehicle", 95, this, 250, 10, false);
  336. EntityRegistry.registerGlobalEntityID(EntitySeat.class, "Seat", EntityRegistry.findGlobalUniqueEntityId());
  337. EntityRegistry.registerModEntity(EntitySeat.class, "Seat", 99, this, 250, 20, false);
  338. EntityRegistry.registerGlobalEntityID(EntityWheel.class, "Wheel", EntityRegistry.findGlobalUniqueEntityId());
  339. EntityRegistry.registerModEntity(EntityWheel.class, "Wheel", 103, this, 250, 20, false);
  340. EntityRegistry.registerGlobalEntityID(EntityParachute.class, "Parachute", EntityRegistry.findGlobalUniqueEntityId());
  341. EntityRegistry.registerModEntity(EntityParachute.class, "Parachute", 101, this, 40, 20, false);
  342. EntityRegistry.registerGlobalEntityID(EntityMecha.class, "Mecha", EntityRegistry.findGlobalUniqueEntityId());
  343. EntityRegistry.registerModEntity(EntityMecha.class, "Mecha", 102, this, 250, 20, false);
  344.  
  345. //Register bullets and grenades
  346. //EntityRegistry.registerGlobalEntityID(EntityBullet.class, "Bullet", EntityRegistry.findGlobalUniqueEntityId());
  347. EntityRegistry.registerModEntity(EntityBullet.class, "Bullet", 96, this, 40, 100, false);
  348. EntityRegistry.registerGlobalEntityID(EntityGrenade.class, "Grenade", EntityRegistry.findGlobalUniqueEntityId());
  349. EntityRegistry.registerModEntity(EntityGrenade.class, "Grenade", 100, this, 40, 100, true);
  350.  
  351. //Register MGs and AA guns
  352. EntityRegistry.registerGlobalEntityID(EntityMG.class, "MG", EntityRegistry.findGlobalUniqueEntityId());
  353. EntityRegistry.registerModEntity(EntityMG.class, "MG", 91, this, 40, 5, true);
  354. EntityRegistry.registerGlobalEntityID(EntityAAGun.class, "AAGun", EntityRegistry.findGlobalUniqueEntityId());
  355. EntityRegistry.registerModEntity(EntityAAGun.class, "AAGun", 92, this, 40, 500, false);
  356.  
  357. //Register the chunk loader
  358. //TODO : Re-do chunk loading
  359. ForgeChunkManager.setForcedChunkLoadingCallback(this, new ChunkLoadingHandler());
  360.  
  361. //Config
  362. FMLCommonHandler.instance().bus().register(INSTANCE);
  363. //Starting the EventListener
  364. new PlayerDeathEventListener();
  365. log("Loading complete.");
  366. }
  367.  
  368. /** The mod post-initialisation method */
  369. @EventHandler
  370. public void postInit(FMLPostInitializationEvent event)
  371. {
  372. packetHandler.postInitialise();
  373.  
  374. hooks.hook();
  375.  
  376. /* TODO : ICBM
  377. isICBMSentryLoaded = Loader.instance().isModLoaded("ICBM|Sentry");
  378.  
  379. log("ICBM hooking complete.");
  380. */
  381. }
  382.  
  383. @SubscribeEvent
  384. public void playerDrops(PlayerDropsEvent event)
  385. {
  386. for(int i = event.drops.size() - 1; i >= 0; i--)
  387. {
  388. EntityItem ent = event.drops.get(i);
  389. InfoType type = InfoType.getType(ent.getEntityItem());
  390. if(type != null && !type.canDrop)
  391. event.drops.remove(i);
  392. }
  393. }
  394.  
  395. @SubscribeEvent
  396. public void playerDrops(ItemTossEvent event)
  397. {
  398. InfoType type = InfoType.getType(event.entityItem.getEntityItem());
  399. if(type != null && !type.canDrop)
  400. event.setCanceled(true);
  401. }
  402.  
  403. /** Teams command register method */
  404. @EventHandler
  405. public void registerCommand(FMLServerStartedEvent e)
  406. {
  407. CommandHandler handler = ((CommandHandler)FMLCommonHandler.instance().getSidedDelegate().getServer().getCommandManager());
  408. handler.registerCommand(new CommandTeams());
  409. }
  410.  
  411. @SubscribeEvent
  412. public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
  413. if(eventArgs.modID.equals(MODID))
  414. syncConfig();
  415. }
  416.  
  417. @SubscribeEvent
  418. public void onLivingSpecialSpawn(LivingSpawnEvent.CheckSpawn event)
  419. {
  420. double chance = event.world.rand.nextDouble();
  421.  
  422. if(chance < armourSpawnRate && event.entityLiving instanceof EntityZombie || event.entityLiving instanceof EntitySkeleton)
  423. {
  424. if(event.world.rand.nextBoolean() && ArmourType.armours.size() > 0)
  425. {
  426. //Give a completely random piece of armour
  427. ArmourType armour = ArmourType.armours.get(event.world.rand.nextInt(ArmourType.armours.size()));
  428. if(armour != null && armour.type != 2)
  429. event.entityLiving.setCurrentItemOrArmor(armour.type + 1, new ItemStack(armour.item));
  430. }
  431. else if(Team.teams.size() > 0)
  432. {
  433. //Give a random set of armour
  434. Team team = Team.teams.get(event.world.rand.nextInt(Team.teams.size()));
  435. if(team.hat != null)
  436. event.entityLiving.setCurrentItemOrArmor(1, team.hat.copy());
  437. if(team.chest != null)
  438. event.entityLiving.setCurrentItemOrArmor(2, team.chest.copy());
  439. //if(team.legs != null)
  440. // event.entityLiving.setCurrentItemOrArmor(3, team.legs.copy());
  441. if(team.shoes != null)
  442. event.entityLiving.setCurrentItemOrArmor(4, team.shoes.copy());
  443. }
  444. }
  445. }
  446.  
  447. /** Reads type files from all content packs */
  448. private void getTypeFiles(List<File> contentPacks)
  449. {
  450. for (File contentPack : contentPacks)
  451. {
  452. if(contentPack.isDirectory())
  453. {
  454. for(EnumType typeToCheckFor : EnumType.values())
  455. {
  456. File typesDir = new File(contentPack, "/" + typeToCheckFor.folderName + "/");
  457. if(!typesDir.exists())
  458. continue;
  459. for(File file : typesDir.listFiles())
  460. {
  461. try
  462. {
  463. BufferedReader reader = new BufferedReader(new FileReader(file));
  464. String[] splitName = file.getName().split("/");
  465. TypeFile typeFile = new TypeFile(typeToCheckFor, splitName[splitName.length - 1].split("\\.")[0]);
  466. for(;;)
  467. {
  468. String line = null;
  469. try
  470. {
  471. line = reader.readLine();
  472. }
  473. catch (Exception e)
  474. {
  475. break;
  476. }
  477. if (line == null)
  478. break;
  479. typeFile.lines.add(line);
  480. }
  481. reader.close();
  482. }
  483. catch(FileNotFoundException e)
  484. {
  485. e.printStackTrace();
  486. }
  487. catch(IOException e)
  488. {
  489. e.printStackTrace();
  490. }
  491. }
  492. }
  493. }
  494. else
  495. {
  496. try
  497. {
  498. ZipFile zip = new ZipFile(contentPack);
  499. ZipInputStream zipStream = new ZipInputStream(new FileInputStream(contentPack));
  500. BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream));
  501. ZipEntry zipEntry = zipStream.getNextEntry();
  502. do
  503. {
  504. zipEntry = zipStream.getNextEntry();
  505. if(zipEntry == null)
  506. continue;
  507. TypeFile typeFile = null;
  508. for(EnumType type : EnumType.values())
  509. {
  510. if(zipEntry.getName().startsWith(type.folderName + "/") && zipEntry.getName().split(type.folderName + "/").length > 1 && zipEntry.getName().split(type.folderName + "/")[1].length() > 0)
  511. {
  512. String[] splitName = zipEntry.getName().split("/");
  513. typeFile = new TypeFile(type, splitName[splitName.length - 1].split("\\.")[0]);
  514. }
  515. }
  516. if(typeFile == null)
  517. {
  518. continue;
  519. }
  520. for(;;)
  521. {
  522. String line = null;
  523. try
  524. {
  525. line = reader.readLine();
  526. }
  527. catch (Exception e)
  528. {
  529. break;
  530. }
  531. if (line == null)
  532. break;
  533. typeFile.lines.add(line);
  534. }
  535. }
  536. while(zipEntry != null);
  537. reader.close();
  538. zip.close();
  539. zipStream.close();
  540. }
  541. catch(IOException e)
  542. {
  543. e.printStackTrace();
  544. }
  545. }
  546. }
  547. }
  548.  
  549. /** Content pack reader method */
  550. private void readContentPacks(FMLPreInitializationEvent event)
  551. {
  552. // Icons, Skins, Models
  553. // Get the classloader in order to load the images
  554. ClassLoader classloader = (net.minecraft.server.MinecraftServer.class).getClassLoader();
  555. Method method = null;
  556. try
  557. {
  558. method = (java.net.URLClassLoader.class).getDeclaredMethod("addURL", java.net.URL.class);
  559. method.setAccessible(true);
  560. } catch (Exception e)
  561. {
  562. log("Failed to get class loader. All content loading will now fail.");
  563. e.printStackTrace();
  564. }
  565.  
  566. List<File> contentPacks = proxy.getContentList(method, classloader);
  567.  
  568. if (!event.getSide().equals(Side.CLIENT))
  569. {
  570. //Gametypes (Server only)
  571. // TODO: gametype loader
  572. }
  573.  
  574. getTypeFiles(contentPacks);
  575.  
  576. for(EnumType type : EnumType.values())
  577. {
  578. Class<? extends InfoType> typeClass = type.getTypeClass();
  579. for(TypeFile typeFile : TypeFile.files.get(type))
  580. {
  581. try
  582. {
  583. InfoType infoType = (typeClass.getConstructor(TypeFile.class).newInstance(typeFile));
  584. infoType.read(typeFile);
  585. switch(type)
  586. {
  587. case bullet : bulletItems.add((ItemBullet)new ItemBullet((BulletType)infoType).setUnlocalizedName(infoType.shortName)); break;
  588. case attachment : attachmentItems.add((ItemAttachment)new ItemAttachment((AttachmentType)infoType).setUnlocalizedName(infoType.shortName)); break;
  589. case gun : gunItems.add((ItemGun)new ItemGun((GunType)infoType).setUnlocalizedName(infoType.shortName)); break;
  590. case grenade : grenadeItems.add((ItemGrenade)new ItemGrenade((GrenadeType)infoType).setUnlocalizedName(infoType.shortName)); break;
  591. case part : partItems.add((ItemPart)new ItemPart((PartType)infoType).setUnlocalizedName(infoType.shortName)); break;
  592. case plane : planeItems.add((ItemPlane)new ItemPlane((PlaneType)infoType).setUnlocalizedName(infoType.shortName)); break;
  593. case vehicle : vehicleItems.add((ItemVehicle)new ItemVehicle((VehicleType)infoType).setUnlocalizedName(infoType.shortName)); break;
  594. case aa : aaGunItems.add((ItemAAGun)new ItemAAGun((AAGunType)infoType).setUnlocalizedName(infoType.shortName)); break;
  595. case mechaItem : mechaToolItems.add((ItemMechaAddon)new ItemMechaAddon((MechaItemType)infoType).setUnlocalizedName(infoType.shortName)); break;
  596. case mecha : mechaItems.add((ItemMecha)new ItemMecha((MechaType)infoType).setUnlocalizedName(infoType.shortName)); break;
  597. case tool : toolItems.add((ItemTool)new ItemTool((ToolType)infoType).setUnlocalizedName(infoType.shortName)); break;
  598. case box : gunBoxBlocks.add((BlockGunBox)new BlockGunBox((GunBoxType)infoType).setBlockName(infoType.shortName)); break;
  599. case armour : armourItems.add((ItemTeamArmour)new ItemTeamArmour((ArmourType)infoType).setUnlocalizedName(infoType.shortName)); break;
  600. case armourBox : armourBoxBlocks.add((BlockArmourBox)new BlockArmourBox((ArmourBoxType)infoType).setBlockName(infoType.shortName)); break;
  601. case playerClass : break;
  602. case team : break;
  603. default : log("Unrecognised type for " + infoType.shortName); break;
  604. }
  605. }
  606. catch(Exception e)
  607. {
  608. log("Failed to add " + type.name() + " : " + typeFile.name);
  609. e.printStackTrace();
  610. }
  611. }
  612. log("Loaded " + type.name() + ".");
  613. }
  614. Team.spectators = spectators;
  615. }
  616.  
  617. public static PacketHandler getPacketHandler()
  618. {
  619. return INSTANCE.packetHandler;
  620. }
  621.  
  622. public static void syncConfig() {
  623. //generalConfigInteger = configFile.getInt("Config Integer", Configuration.CATEGORY_GENERAL, generalConfigInteger, 0, Integer.MAX_VALUE, "An Integer!");
  624. //generalConfigString = configFile.getString("Config String", Configuration.CATEGORY_GENERAL, generalConfigString, "A String!");
  625. addGunpowderRecipe = configFile.getBoolean("Gunpowder Recipe", Configuration.CATEGORY_GENERAL, addGunpowderRecipe, "Whether or not to add the extra gunpowder recipe (3 charcoal + 1 lightstone)");
  626.  
  627. //teamsConfigInteger = configFile.getInt("Config Integer", Configuration.CATEGORY_GENERAL, teamsConfigInteger, 0, Integer.MAX_VALUE, "An Integer!");
  628. //teamsConfigString = configFile.getString("Config String", Configuration.CATEGORY_GENERAL, teamsConfigString, "A String!");
  629. //teamsConfigBoolean = configFile.getBoolean("Config Boolean", Configuration.CATEGORY_GENERAL, teamsConfigBoolean, "A Boolean!");
  630.  
  631. if(configFile.hasChanged())
  632. configFile.save();
  633. }
  634.  
  635. //TODO : Proper logger
  636. public static void log(String string)
  637. {
  638. System.out.println("[Flan's Mod] " + string);
  639. }
  640. }
  641.  
  642. ​package com.carpentersblocks;
  643.  
  644. import net.minecraft.creativetab.CreativeTabs;
  645. import net.minecraftforge.common.config.Configuration;
  646.  
  647. import com.carpentersblocks.proxy.CommonProxy;
  648. import com.carpentersblocks.util.CarpentersBlocksTab;
  649.  
  650. import cpw.mods.fml.common.Mod;
  651. import cpw.mods.fml.common.Mod.EventHandler;
  652. import cpw.mods.fml.common.Mod.Instance;
  653. import cpw.mods.fml.common.SidedProxy;
  654. import cpw.mods.fml.common.event.FMLInitializationEvent;
  655. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  656. import cpw.mods.fml.common.network.FMLEventChannel;
  657. import cpw.mods.fml.common.network.NetworkRegistry;
  658.  
  659. @Mod(
  660. modid = CarpentersBlocks.MODID,
  661. name = "Carpenter's Blocks",
  662. version = CarpentersBlocks.VERSION,
  663. dependencies = "required-after:Forge@[10.13.0.1180,)"
  664. )
  665. public class CarpentersBlocks {
  666.  
  667. public static final String MODID = "CarpentersBlocks";
  668. public static final String VERSION = "3.3.7";
  669. public static FMLEventChannel channel;
  670. public static CreativeTabs creativeTab = new CarpentersBlocksTab(MODID);
  671.  
  672. @Instance(MODID)
  673. public static CarpentersBlocks instance;
  674.  
  675. @SidedProxy(clientSide = "com.carpentersblocks.proxy.ClientProxy", serverSide = "com.carpentersblocks.proxy.CommonProxy")
  676. public static CommonProxy proxy;
  677.  
  678. @EventHandler
  679. public void preInit(FMLPreInitializationEvent event)
  680. {
  681. channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(MODID);
  682. Configuration config = new Configuration(event.getSuggestedConfigurationFile());
  683. config.load();
  684.  
  685. proxy.preInit(event, config);
  686.  
  687. if (config.hasChanged()) {
  688. config.save();
  689. }
  690. }
  691.  
  692. @EventHandler
  693. public void init(FMLInitializationEvent event)
  694. {
  695. proxy.init(event);
  696. }
  697.  
  698. }
  699.  
  700. et mon mod :
  701. ​package fr.altiscraft.altiscraft.common;
  702.  
  703. import net.minecraft.block.Block;
  704. import net.minecraft.block.material.Material;
  705. import net.minecraft.creativetab.CreativeTabs;
  706. import net.minecraft.item.Item;
  707. import net.minecraft.item.Item.ToolMaterial;
  708. import net.minecraft.item.ItemArmor.ArmorMaterial;
  709. import net.minecraft.item.ItemStack;
  710. import net.minecraft.potion.Potion;
  711. import net.minecraft.potion.PotionEffect;
  712. import net.minecraft.util.ResourceLocation;
  713. import net.minecraftforge.common.util.EnumHelper;
  714. import cpw.mods.fml.common.Mod;
  715. import cpw.mods.fml.common.Mod.EventHandler;
  716. import cpw.mods.fml.common.Mod.Instance;
  717. import cpw.mods.fml.common.SidedProxy;
  718. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  719. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  720. import cpw.mods.fml.common.registry.EntityRegistry;
  721. import cpw.mods.fml.common.registry.GameRegistry;
  722. import fr.altiscraft.altiscraft.client.ModelBlockATM;
  723. import fr.altiscraft.altiscraft.client.ModelBlockCoco;
  724. import fr.altiscraft.altiscraft.client.ModelBlockLampadaire;
  725. import fr.altiscraft.altiscraft.client.ModelBlockVLampadaire;
  726. import fr.altiscraft.altiscraft.proxy.CommonProxy;
  727.  
  728. @Mod(modid = "altiscraft.MODID", name = "AltisCraft.fr", version ="1.0.0")
  729.  
  730. public class ModAltisCraft
  731. {
  732.  
  733. public static final Block.SoundType soundTypeWood = new Block.SoundType("wood", 1.0F, 1.0F);
  734.  
  735. public static final String MODID = "altiscraft";
  736. @Instance("altiscraft.MODID")
  737. public static ModAltisCraft instance;
  738.  
  739. @SidedProxy(clientSide = "fr.altiscraft.altiscraft.proxy.ClientProxy", serverSide = "fr.altiscraft.altiscraft.proxy.CommonProxy")
  740. public static CommonProxy proxy;
  741.  
  742. public static Item PorteHopital, itemDSable, Tortue, itemAltisCraft, itemAncienAltisCraft, itemRestaurant, secrets, Marteau, Coco, pioche, pelle, itemCuivre, itemCiseaux, itemFil, itemLSD, itemFLSD, itemLMeth, itemMeth, itemCannabis, itemCokaine0, itemCokaine1, itemCokaine2, itemMcDoV, itemMcDoR, Icentime, IIcentimes, Vcentimes, Xcentimes, XXcentimes, Lcentimes, Ieuro, IIeuros, Veuros, Xeuros, XXeuros, Leuros, Ceuros, Meuros, XMeuros, itemPeche, itemFCocaine, itemFCannabis, lunettesCivil, lunettesSoleilCivil, helmetRebelle, chestPlateRebelle, leggingsRebelle, bootsRebelle, helmetAdjoint, helmetBrigadier, chestPlateBrigadier, leggingsBrigadier, bootsBrigadier, helmetSergent, chestPlateSergent, leggingsSergent, bootsSergent, helmetAdjudant, chestPlateAdjudant, leggingsAdjudant, bootsAdjudant, helmetMajor, chestPlateMajor, leggingsMajor, bootsMajor, helmetAspirant, chestPlateAspirant, leggingsAspirant, bootsAspirant, helmetLieutenant, chestPlateLieutenant, leggingsLieutenant, bootsLieutenant, helmetCapitaine, chestPlateCapitaine, leggingsCapitaine, bootsCapitaine, helmetCommandant, chestPlateCommandant, leggingsCommandant, bootsCommandant, helmetColonel, chestPlateColonel, leggingsColonel, bootsColonel, helmetGeneral, chestPlateGeneral, leggingsGeneral, bootsGeneral, helmetCivil, chestPlateCivil, leggingsCivil, bootsCivil, CocaCola, CocaColaLight, CocaColaZero, CocaColaLife;
  743. public static Block BlocVLampadaire, SemiBrique, BlocLampadaire, PlastiqueRouge, PlastiqueBlanc, PlastiqueBleu, Cyan, Aluminium, PierreBlanc, PierreBlanche, BlanchePierre, PlancheMarron, Flesh, PlastiqueVert, PlastiqueFlashVert, FerGris, FerPeuGris, Rouge, Blanc, BlocCoco, BlocMetaData, Barriere, blockPeche, blockPomme, blockBrique, blocSemiBrique, blocGrisBrique, blockMcDoV, blockMcDoR, MineraisCuivre, MineraisMeth, CannabisPlante, CocainePlante, BlocATM, BlocRoute1, BlocRoute2, BlocATMTexture, BlocFerMarron, BlocPierreVert;
  744.  
  745. public static ToolMaterial outils = EnumHelper.addToolMaterial("outils", 3, 1000, 1.0F, 1.0F, 30);
  746.  
  747. public static CreativeTabs AltisCraft = new CreativeTabs("AltisCraft")
  748. {
  749. public Item getTabIconItem()
  750. {
  751. return ModAltisCraft.itemAltisCraft;
  752. }
  753. };
  754.  
  755. public static ArmorMaterial lunettesSoleil = EnumHelper.addArmorMaterial("lunettesSoleilCivil", 1, new int []{3}, 1);
  756. public static ArmorMaterial lunettes = EnumHelper.addArmorMaterial("lunettesCivil", 1, new int []{2}, 1);
  757. public static ArmorMaterial armorAdjoint = EnumHelper.addArmorMaterial("armorAdjoint", 1, new int []{1}, 1);
  758. public static ArmorMaterial armorBrigadier = EnumHelper.addArmorMaterial("armorBrigadier", 1, new int []{1, 1, 1, 1}, 1);
  759. public static ArmorMaterial armorSergent = EnumHelper.addArmorMaterial("armorSergent", 1, new int []{1, 2, 2, 1}, 1);
  760. public static ArmorMaterial armorAdjudant = EnumHelper.addArmorMaterial("armorAdjudant", 1, new int []{2, 2, 2, 2}, 1);
  761. public static ArmorMaterial armorMajor = EnumHelper.addArmorMaterial("armorMajor", 1, new int []{2, 3, 3, 2}, 1);
  762. public static ArmorMaterial armorAspirant = EnumHelper.addArmorMaterial("armorAspirant", 1, new int []{3, 3, 3, 3}, 1);
  763. public static ArmorMaterial armorLieutenant = EnumHelper.addArmorMaterial("armorLieutenant", 1, new int []{3, 4, 4, 3}, 1);
  764. public static ArmorMaterial armorCapitaine = EnumHelper.addArmorMaterial("armorCapitaine", 1, new int []{4, 4, 4, 4}, 1);
  765. public static ArmorMaterial armorCommandant = EnumHelper.addArmorMaterial("armorCommandant", 1, new int []{4, 5, 5, 4}, 1);
  766. public static ArmorMaterial armorColonel = EnumHelper.addArmorMaterial("armorColonel", 1, new int []{5, 5, 5, 5}, 1);
  767. public static ArmorMaterial armorGeneral = EnumHelper.addArmorMaterial("armorGeneral", 1, new int []{5, 5, 5, 5}, 1);
  768. public static ArmorMaterial armorCivil = EnumHelper.addArmorMaterial("armorCivil", 1, new int []{1, 2, 2, 1}, 1);
  769. public static ArmorMaterial armorRebelle = EnumHelper.addArmorMaterial("armorRebelle", 1, new int []{2, 3, 3, 2}, 1);
  770.  
  771. @EventHandler
  772. public void preInit(FMLPreInitializationEvent event)
  773. {
  774.  
  775. // if(event.getSide().isClient()){if(!Minecraft.getMinecraft().mcDataDir.getAbsolutePath().contains("AltisCraft") && !Minecraft.getMinecraft().mcDataDir.equals(new File("."))){Throwables.propagate(new Exception("Launcher non autorisé"));}}
  776.  
  777. System.out.println("Pré-initialisation !");
  778.  
  779. ModelBlockATM model = new ModelBlockATM();
  780. ResourceLocation texture = new ResourceLocation(ModAltisCraft.MODID, "textures/models/blocks/ModelBlockATM.png");
  781. ModelBlockCoco models = new ModelBlockCoco();
  782. ResourceLocation textures = new ResourceLocation(ModAltisCraft.MODID, "textures/models/blocks/ModelBlockCoco.png");
  783. ModelBlockLampadaire modelsb = new ModelBlockLampadaire();
  784. ResourceLocation texturesb = new ResourceLocation(ModAltisCraft.MODID, "textures/models/blocks/ModelBlockLampadaire.png");
  785. ModelBlockVLampadaire modelv = new ModelBlockVLampadaire();
  786. ResourceLocation texturev = new ResourceLocation(ModAltisCraft.MODID, "textures/models/blocks/ModelBlockVLampadaire.png");
  787.  
  788. itemDSable = new ItemDSable().setUnlocalizedName("itemDSable").setTextureName(MODID + ":itemDSable").setCreativeTab(AltisCraft).setMaxStackSize(1);
  789. itemAltisCraft = new Logo().setUnlocalizedName("AltisCraft").setTextureName(MODID + ":Logo").setCreativeTab(AltisCraft).setMaxStackSize(4);
  790. itemAncienAltisCraft = new Logo().setUnlocalizedName("AncienAltisCraft").setTextureName(MODID + ":AncienLogo").setCreativeTab(AltisCraft).setMaxStackSize(8);
  791. itemRestaurant = new Logo().setUnlocalizedName("Restaurant").setTextureName(MODID + ":Restaurant").setCreativeTab(AltisCraft).setMaxStackSize(4);
  792. Marteau = new Marteau().setUnlocalizedName("Marteau").setTextureName(MODID + ":Marteau").setCreativeTab(AltisCraft).setMaxStackSize(1);
  793. secrets = new secrets().setUnlocalizedName("secrets").setTextureName(MODID + ":secrets").setCreativeTab(AltisCraft).setMaxStackSize(1);
  794. itemCuivre = new item().setUnlocalizedName("Cuivre").setTextureName(MODID + ":Cuivre").setCreativeTab(AltisCraft).setMaxStackSize(4);
  795. itemMcDoV = new Logo().setUnlocalizedName("McDoV").setTextureName(MODID + ":McDoV").setCreativeTab(AltisCraft).setMaxStackSize(4);
  796. itemMcDoR = new Logo().setUnlocalizedName("McDoR").setTextureName(MODID + ":McDoR").setCreativeTab(AltisCraft).setMaxStackSize(4);
  797. itemCiseaux = new item().setUnlocalizedName("Ciseaux").setTextureName(MODID + ":Ciseaux").setCreativeTab(AltisCraft).setMaxStackSize(1);
  798. itemFil = new item().setUnlocalizedName("Fil").setTextureName(MODID + ":Fil").setCreativeTab(AltisCraft).setMaxStackSize(1);
  799. Icentime = new Icent().setUnlocalizedName("1cent").setTextureName(MODID + ":1centime").setCreativeTab(AltisCraft).setMaxStackSize(50);
  800. IIcentimes = new IIcents().setUnlocalizedName("2cents").setTextureName(MODID + ":2centimes").setCreativeTab(AltisCraft).setMaxStackSize(50);
  801. Vcentimes = new Vcents().setUnlocalizedName("5cents").setTextureName(MODID + ":5centimes").setCreativeTab(AltisCraft).setMaxStackSize(50);
  802. Xcentimes = new Xcents().setUnlocalizedName("10cents").setTextureName(MODID + ":10centimes").setCreativeTab(AltisCraft).setMaxStackSize(50);
  803. XXcentimes = new XXcents().setUnlocalizedName("20cents").setTextureName(MODID + ":20centimes").setCreativeTab(AltisCraft).setMaxStackSize(50);
  804. Lcentimes = new Lcents().setUnlocalizedName("50cents").setTextureName(MODID + ":50centimes").setCreativeTab(AltisCraft).setMaxStackSize(50);
  805. Ieuro = new Ieuro().setUnlocalizedName("1euro").setTextureName(MODID + ":1euro").setCreativeTab(AltisCraft).setMaxStackSize(50);
  806. IIeuros = new IIeuros().setUnlocalizedName("2euros").setTextureName(MODID + ":2euros").setCreativeTab(AltisCraft).setMaxStackSize(50);
  807. Veuros = new Veuros().setUnlocalizedName("5euros").setTextureName(MODID + ":5euros").setCreativeTab(AltisCraft).setMaxStackSize(50);
  808. Xeuros = new Xeuros().setUnlocalizedName("10euros").setTextureName(MODID + ":10euros").setCreativeTab(AltisCraft).setMaxStackSize(50);
  809. XXeuros = new XXeuros().setUnlocalizedName("20euros").setTextureName(MODID + ":20euros").setCreativeTab(AltisCraft).setMaxStackSize(50);
  810. Leuros = new Leuros().setUnlocalizedName("50euros").setTextureName(MODID + ":50euros").setCreativeTab(AltisCraft).setMaxStackSize(50);
  811. Ceuros = new Ceuros().setUnlocalizedName("100euros").setTextureName(MODID + ":100euros").setCreativeTab(AltisCraft).setMaxStackSize(50);
  812. Meuros = new Meuros().setUnlocalizedName("1000euros").setTextureName(MODID + ":1000euros").setCreativeTab(AltisCraft).setMaxStackSize(50);
  813. XMeuros = new XMeuros().setUnlocalizedName("10000euros").setTextureName(MODID + ":10000euros").setCreativeTab(AltisCraft).setMaxStackSize(50);
  814. itemCannabis = new Drogue().setUnlocalizedName("Cannabis").setTextureName(MODID + ":Cannabis").setCreativeTab(AltisCraft).setMaxStackSize(16);
  815. itemLMeth = new Drogue().setUnlocalizedName("LMeth").setTextureName(MODID + ":LingotMeth").setCreativeTab(AltisCraft).setMaxStackSize(1);
  816. itemCokaine0 = new Drogue().setUnlocalizedName("Cokaine0").setTextureName(MODID + ":Cokaine0").setCreativeTab(AltisCraft).setMaxStackSize(64);
  817. itemLSD = new Drogue().setUnlocalizedName("LSD").setTextureName(MODID + ":LSD").setCreativeTab(AltisCraft).setMaxStackSize(32);
  818. itemCokaine1 = new Drogue().setUnlocalizedName("Cokaine1").setTextureName(MODID + ":Cokaine1").setCreativeTab(AltisCraft).setMaxStackSize(32);
  819. itemCokaine2 = new Drogue().setUnlocalizedName("Cokaine2").setTextureName(MODID + ":Cokaine2").setCreativeTab(AltisCraft).setMaxStackSize(16);
  820. lunettesSoleilCivil = new lunettesSoleilCivil(lunettesSoleil, 0).setUnlocalizedName("lunettesSoleilCivil").setTextureName(MODID + ":lunettesSoleilCivil").setCreativeTab(AltisCraft);
  821. lunettesCivil = new lunettesCivil(lunettes, 0).setUnlocalizedName("lunettesCivil").setTextureName(MODID + ":lunettesCivil").setCreativeTab(AltisCraft);
  822. helmetAdjoint = new ItemAdjointArmor(armorAdjoint, 0).setUnlocalizedName("helmetAdjoint").setTextureName(MODID + ":Adjoint_Chapeau").setCreativeTab(AltisCraft);
  823. helmetRebelle = new ItemRebelleArmor(armorRebelle, 0).setUnlocalizedName("helmetRebelle").setTextureName(MODID + ":Rebelle_Chapeau").setCreativeTab(AltisCraft);
  824. chestPlateRebelle = new ItemRebelleArmor(armorRebelle, 1).setUnlocalizedName("chestPlateRebelle").setTextureName(MODID + ":Rebelle_Plastron").setCreativeTab(AltisCraft);
  825. leggingsRebelle = new ItemRebelleArmor(armorRebelle, 2).setUnlocalizedName("leggingsRebelle").setTextureName(MODID + ":Rebelle_Pantalon").setCreativeTab(AltisCraft);
  826. bootsRebelle = new ItemRebelleArmor(armorRebelle, 3).setUnlocalizedName("bootsRebelle").setTextureName(MODID + ":Rebelle_Chaussures").setCreativeTab(AltisCraft);
  827. helmetBrigadier = new ItemBrigadierArmor(armorBrigadier, 0).setUnlocalizedName("helmetBrigadier").setTextureName(MODID + ":Brigadier_Chapeau").setCreativeTab(AltisCraft);
  828. chestPlateBrigadier = new ItemBrigadierArmor(armorBrigadier, 1).setUnlocalizedName("chestPlateBrigadier").setTextureName(MODID + ":Brigadier_Plastron").setCreativeTab(AltisCraft);
  829. leggingsBrigadier = new ItemBrigadierArmor(armorBrigadier, 2).setUnlocalizedName("leggingsBrigadier").setTextureName(MODID + ":Brigadier_Pantalon").setCreativeTab(AltisCraft);
  830. bootsBrigadier = new ItemBrigadierArmor(armorBrigadier, 3).setUnlocalizedName("bootsBrigadier").setTextureName(MODID + ":Brigadier_Chaussures").setCreativeTab(AltisCraft);
  831. helmetSergent = new ItemSergentArmor(armorSergent, 0).setUnlocalizedName("helmetSergent").setTextureName(MODID + ":Sergent_Chapeau").setCreativeTab(AltisCraft);
  832. chestPlateSergent = new ItemSergentArmor(armorSergent, 1).setUnlocalizedName("chestPlateSergent").setTextureName(MODID + ":Sergent_Plastron").setCreativeTab(AltisCraft);
  833. leggingsSergent = new ItemSergentArmor(armorSergent, 2).setUnlocalizedName("leggingsSergent").setTextureName(MODID + ":Sergent_Pantalon").setCreativeTab(AltisCraft);
  834. bootsSergent = new ItemSergentArmor(armorSergent, 3).setUnlocalizedName("bootsSergent").setTextureName(MODID + ":Sergent_Chaussures").setCreativeTab(AltisCraft);
  835. helmetAdjudant = new ItemAdjudantArmor(armorAdjudant, 0).setUnlocalizedName("helmetAdjudant").setTextureName(MODID + ":Adjudant_Chapeau").setCreativeTab(AltisCraft);
  836. chestPlateAdjudant = new ItemAdjudantArmor(armorAdjudant, 1).setUnlocalizedName("chestPlateAdjudant").setTextureName(MODID + ":Adjudant_Plastron").setCreativeTab(AltisCraft);
  837. leggingsAdjudant = new ItemAdjudantArmor(armorAdjudant, 2).setUnlocalizedName("leggingsAdjudant").setTextureName(MODID + ":Adjudant_Pantalon").setCreativeTab(AltisCraft);
  838. bootsAdjudant = new ItemAdjudantArmor(armorAdjudant, 3).setUnlocalizedName("bootsAdjudant").setTextureName(MODID + ":Adjudant_Chaussures").setCreativeTab(AltisCraft);
  839. helmetMajor = new ItemMajorArmor(armorMajor, 0).setUnlocalizedName("helmetMajor").setTextureName(MODID + ":Major_Chapeau").setCreativeTab(AltisCraft);
  840. chestPlateMajor = new ItemMajorArmor(armorMajor, 1).setUnlocalizedName("chestPlateMajor").setTextureName(MODID + ":Major_Plastron").setCreativeTab(AltisCraft);
  841. leggingsMajor = new ItemMajorArmor(armorMajor, 2).setUnlocalizedName("leggingsMajor").setTextureName(MODID + ":Major_Pantalon").setCreativeTab(AltisCraft);
  842. bootsMajor = new ItemMajorArmor(armorMajor, 3).setUnlocalizedName("bootsMajor").setTextureName(MODID + ":Major_Chaussures").setCreativeTab(AltisCraft);
  843. helmetAspirant = new ItemAspirantArmor(armorAspirant, 0).setUnlocalizedName("helmetAspirant").setTextureName(MODID + ":Aspirant_Chapeau").setCreativeTab(AltisCraft);
  844. chestPlateAspirant = new ItemAspirantArmor(armorAspirant, 1).setUnlocalizedName("chestPlateAspirant").setTextureName(MODID + ":Aspirant_Plastron").setCreativeTab(AltisCraft);
  845. leggingsAspirant = new ItemAspirantArmor(armorAspirant, 2).setUnlocalizedName("leggingsAspirant").setTextureName(MODID + ":Aspirant_Pantalon").setCreativeTab(AltisCraft);
  846. bootsAspirant = new ItemAspirantArmor(armorAspirant, 3).setUnlocalizedName("bootsAspirant").setTextureName(MODID + ":Aspirant_Chaussures").setCreativeTab(AltisCraft);
  847. helmetLieutenant = new ItemLieutenantArmor(armorLieutenant, 0).setUnlocalizedName("helmetLieutenant").setTextureName(MODID + ":Lieutenant_Chapeau").setCreativeTab(AltisCraft);
  848. chestPlateLieutenant = new ItemLieutenantArmor(armorLieutenant, 1).setUnlocalizedName("chestPlateLieutenant").setTextureName(MODID + ":Lieutenant_Plastron").setCreativeTab(AltisCraft);
  849. leggingsLieutenant = new ItemLieutenantArmor(armorLieutenant, 2).setUnlocalizedName("leggingsLieutenant").setTextureName(MODID + ":Lieutenant_Pantalon").setCreativeTab(AltisCraft);
  850. bootsLieutenant = new ItemLieutenantArmor(armorLieutenant, 3).setUnlocalizedName("bootsLieutenant").setTextureName(MODID + ":Lieutenant_Chaussures").setCreativeTab(AltisCraft);
  851. helmetCapitaine = new ItemCapitaineArmor(armorCapitaine, 0).setUnlocalizedName("helmetCapitaine").setTextureName(MODID + ":Capitaine_Chapeau").setCreativeTab(AltisCraft);
  852. chestPlateCapitaine = new ItemCapitaineArmor(armorCapitaine, 1).setUnlocalizedName("chestPlateCapitaine").setTextureName(MODID + ":Capitaine_Plastron").setCreativeTab(AltisCraft);
  853. leggingsCapitaine = new ItemCapitaineArmor(armorCapitaine, 2).setUnlocalizedName("leggingsCapitaine").setTextureName(MODID + ":Capitaine_Pantalon").setCreativeTab(AltisCraft);
  854. bootsCapitaine = new ItemCapitaineArmor(armorCapitaine, 3).setUnlocalizedName("bootsCapitaine").setTextureName(MODID + ":Capitaine_Chaussures").setCreativeTab(AltisCraft);
  855. helmetCommandant = new ItemCommandantArmor(armorCommandant, 0).setUnlocalizedName("helmetCommandant").setTextureName(MODID + ":Commandant_Chapeau").setCreativeTab(AltisCraft);
  856. chestPlateCommandant = new ItemCommandantArmor(armorCommandant, 1).setUnlocalizedName("chestPlateCommandant").setTextureName(MODID + ":Commandant_Plastron").setCreativeTab(AltisCraft);
  857. leggingsCommandant = new ItemCommandantArmor(armorCommandant, 2).setUnlocalizedName("leggingsCommandant").setTextureName(MODID + ":Commandant_Pantalon").setCreativeTab(AltisCraft);
  858. bootsCommandant = new ItemCommandantArmor(armorCommandant, 3).setUnlocalizedName("bootsCommandant").setTextureName(MODID + ":Commandant_Chaussures").setCreativeTab(AltisCraft);
  859. helmetColonel = new ItemColonelArmor(armorColonel, 0).setUnlocalizedName("helmetColonel").setTextureName(MODID + ":Colonel_Chapeau").setCreativeTab(AltisCraft);
  860. chestPlateColonel = new ItemColonelArmor(armorColonel, 1).setUnlocalizedName("chestPlateColonel").setTextureName(MODID + ":Colonel_Plastron").setCreativeTab(AltisCraft);
  861. leggingsColonel = new ItemColonelArmor(armorColonel, 2).setUnlocalizedName("leggingsColonel").setTextureName(MODID + ":Colonel_Pantalon").setCreativeTab(AltisCraft);
  862. bootsColonel = new ItemColonelArmor(armorColonel, 3).setUnlocalizedName("bootsColonel").setTextureName(MODID + ":Colonel_Chaussures").setCreativeTab(AltisCraft);
  863. helmetGeneral = new ItemGeneralArmor(armorGeneral, 0).setUnlocalizedName("helmetGeneral").setTextureName(MODID + ":General_Chapeau").setCreativeTab(AltisCraft);
  864. chestPlateGeneral = new ItemGeneralArmor(armorGeneral, 1).setUnlocalizedName("chestPlateGeneral").setTextureName(MODID + ":General_Plastron").setCreativeTab(AltisCraft);
  865. leggingsGeneral = new ItemGeneralArmor(armorGeneral, 2).setUnlocalizedName("leggingsGeneral").setTextureName(MODID + ":General_Pantalon").setCreativeTab(AltisCraft);
  866. bootsGeneral = new ItemGeneralArmor(armorGeneral, 3).setUnlocalizedName("bootsGeneral").setTextureName(MODID + ":General_Chaussures").setCreativeTab(AltisCraft);
  867. helmetCivil = new ItemCivilArmor(armorCivil, 0).setUnlocalizedName("helmetCivil").setTextureName(MODID + ":Civil_Chapeau").setCreativeTab(AltisCraft);
  868. chestPlateCivil = new ItemCivilArmor(armorCivil, 1).setUnlocalizedName("chestPlateCivil").setTextureName(MODID + ":Civil_Plastron").setCreativeTab(AltisCraft);
  869. leggingsCivil = new ItemCivilArmor(armorCivil, 2).setUnlocalizedName("leggingsCivil").setTextureName(MODID + ":Civil_Pantalon").setCreativeTab(AltisCraft);
  870. bootsCivil = new ItemCivilArmor(armorCivil, 3).setUnlocalizedName("bootsCivil").setTextureName(MODID + ":Civil_Chaussures").setCreativeTab(AltisCraft);
  871.  
  872.  
  873. GameRegistry.registerItem(pioche = new ItemPioche("pioche", outils).setCreativeTab(AltisCraft), "pioche");
  874. GameRegistry.registerItem(pelle = new ItemPelle("pelle", outils).setCreativeTab(AltisCraft), "pelle");
  875.  
  876. GameRegistry.registerItem(Tortue = new NourritureDrogue("Tortue", 5, 1.0f, false).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(12), "Tortue");
  877. GameRegistry.registerItem(itemAltisCraft, "item_altiscraft");
  878. GameRegistry.registerItem(itemAncienAltisCraft, "item_ancienaltiscraft");
  879. GameRegistry.registerItem(itemRestaurant, "item_restaurant");
  880. GameRegistry.registerItem(Marteau, "marteau");
  881. GameRegistry.registerItem(itemDSable, "itemdsable");
  882. GameRegistry.registerItem(secrets, "secrets");
  883. GameRegistry.registerItem(itemCuivre, "item_cuivre");
  884. GameRegistry.registerItem(itemMcDoV, "item_mcdov");
  885. GameRegistry.registerItem(itemMcDoR, "item_mcdor");
  886. GameRegistry.registerItem(itemFil, "item_fil");
  887. GameRegistry.registerItem(itemCiseaux, "item_ciseaux");
  888. GameRegistry.registerItem(itemLMeth, "item_lmeth");
  889. GameRegistry.registerItem(itemLSD, "item_lsd");
  890. GameRegistry.registerItem(itemFLSD = new BoissonDrogue("itemFLSD", 12, 0.5f, false).addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 1), 0.5).addPotionEffect(new PotionEffect(Potion.jump.id, 100, 1), 0.5).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 250, 1), 0.5).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(16), "itemFLSD");
  891. GameRegistry.registerItem(itemMeth = new NourritureDrogue("itemMeth", 8, 0.5f, false).addPotionEffect(new PotionEffect(Potion.jump.id, 400, 3), 0.5).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 450, 2), 0.5).addPotionEffect(new PotionEffect(Potion.regeneration.id, 150, 3), 0.5).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(2), "itemMeth");
  892. GameRegistry.registerItem(itemFCannabis = new NourritureDrogue("itemFCannabis", 12, 0.5f, false).addPotionEffect(new PotionEffect(Potion.confusion.id, 600, 3), 0.5).addPotionEffect(new PotionEffect(Potion.jump.id, 200, 1), 0.5).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 450, 1), 0.5).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(8), "itemFCannabis");
  893. GameRegistry.registerItem(itemFCocaine = new NourritureDrogue("itemFCocaine", 18, 1.0f, false).addPotionEffect(new PotionEffect(Potion.confusion.id, 1200, 3), 0.5).addPotionEffect(new PotionEffect(Potion.jump.id, 600, 3), 0.5).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 1800, 2), 0.5).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(8), "itemFCocaine");
  894. GameRegistry.registerItem(itemPeche = new Nourriture("peche", 1, 0.2f, false).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(16), "peche");
  895. GameRegistry.registerItem(Coco = new Nourriture("Coco", 3, 0.2f, false).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(8), "Coco");
  896. GameRegistry.registerItem(CocaCola = new Boisson("coca_cola", 0, 0.2f, false).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(4), "coca_cola");
  897. GameRegistry.registerItem(CocaColaLife = new Boisson("coca_cola_life", 0, 0.2f, false).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(4), "coca_cola_life");
  898. GameRegistry.registerItem(CocaColaZero = new Boisson("coca_cola_zero", 0, 0.2f, false).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(4), "coca_cola_zero");
  899. GameRegistry.registerItem(CocaColaLight = new Boisson("coca_cola_light", 0, 0.2f, false).setAlwaysEdible().setCreativeTab(AltisCraft).setMaxStackSize(4), "coca_cola_light");
  900. GameRegistry.registerItem(Icentime, "item_1centime");
  901. GameRegistry.registerItem(IIcentimes, "item_2centimes");
  902. GameRegistry.registerItem(Vcentimes, "item_5centimes");
  903. GameRegistry.registerItem(Xcentimes, "item_10centimes");
  904. GameRegistry.registerItem(XXcentimes, "item_20centimes");
  905. GameRegistry.registerItem(Lcentimes, "item_50centimes");
  906. GameRegistry.registerItem(Ieuro, "item_1euro");
  907. GameRegistry.registerItem(IIeuros, "item_2euros");
  908. GameRegistry.registerItem(Veuros, "item_5euros");
  909. GameRegistry.registerItem(Xeuros, "item_10euros");
  910. GameRegistry.registerItem(XXeuros, "item_20euros");
  911. GameRegistry.registerItem(Leuros, "item_50euros");
  912. GameRegistry.registerItem(Ceuros, "item_100euros");
  913. GameRegistry.registerItem(Meuros, "item_1000euros");
  914. GameRegistry.registerItem(XMeuros, "item_10000euros");
  915. GameRegistry.registerItem(itemCannabis, "item_cannabis");
  916. GameRegistry.registerItem(itemCokaine0, "item_cokaine0");
  917. GameRegistry.registerItem(itemCokaine1, "item_cokaine1");
  918. GameRegistry.registerItem(itemCokaine2, "item_cokaine2");
  919. GameRegistry.registerItem(lunettesSoleilCivil, "lunettessoleilcivil");
  920. GameRegistry.registerItem(lunettesCivil, "lunettescivil");
  921. GameRegistry.registerItem(helmetAdjoint, "item_adjoint_helmet");
  922. GameRegistry.registerItem(helmetRebelle, "item_rebelle_helmet");
  923. GameRegistry.registerItem(chestPlateRebelle, "item_rebelle_chestplate");
  924. GameRegistry.registerItem(leggingsRebelle, "item_rebelle_leggings");
  925. GameRegistry.registerItem(bootsRebelle, "item_rebelle_boots");
  926. GameRegistry.registerItem(helmetBrigadier, "item_brigadier_helmet");
  927. GameRegistry.registerItem(chestPlateBrigadier, "item_brigadier_chestplate");
  928. GameRegistry.registerItem(leggingsBrigadier, "item_brigadier_leggings");
  929. GameRegistry.registerItem(bootsBrigadier, "item_brigadier_boots");
  930. GameRegistry.registerItem(helmetSergent, "item_sergent_helmet");
  931. GameRegistry.registerItem(chestPlateSergent, "item_sergent_chestplate");
  932. GameRegistry.registerItem(leggingsSergent, "item_sergent_leggings");
  933. GameRegistry.registerItem(bootsSergent, "item_sergent_boots");
  934. GameRegistry.registerItem(helmetAdjudant, "item_adjudant_helmet");
  935. GameRegistry.registerItem(chestPlateAdjudant, "item_adjudant_chestplate");
  936. GameRegistry.registerItem(leggingsAdjudant, "item_adjudant_leggings");
  937. GameRegistry.registerItem(bootsAdjudant, "item_adjudant_boots");
  938. GameRegistry.registerItem(helmetMajor, "item_major_helmet");
  939. GameRegistry.registerItem(chestPlateMajor, "item_major_chestplate");
  940. GameRegistry.registerItem(leggingsMajor, "item_major_leggings");
  941. GameRegistry.registerItem(bootsMajor, "item_major_boots");
  942. GameRegistry.registerItem(helmetAspirant, "item_aspirant_helmet");
  943. GameRegistry.registerItem(chestPlateAspirant, "item_aspirant_chestplate");
  944. GameRegistry.registerItem(leggingsAspirant, "item_aspirant_leggings");
  945. GameRegistry.registerItem(bootsAspirant, "item_aspirant_boots");
  946. GameRegistry.registerItem(helmetLieutenant, "item_lieutenant_helmet");
  947. GameRegistry.registerItem(chestPlateLieutenant, "item_lieutenant_chestplate");
  948. GameRegistry.registerItem(leggingsLieutenant, "item_lieutenant_leggings");
  949. GameRegistry.registerItem(bootsLieutenant, "item_lieutenant_boots");
  950. GameRegistry.registerItem(helmetCapitaine, "item_capitaine_helmet");
  951. GameRegistry.registerItem(chestPlateCapitaine, "item_capitaine_chestplate");
  952. GameRegistry.registerItem(leggingsCapitaine, "item_capitaine_leggings");
  953. GameRegistry.registerItem(bootsCapitaine, "item_capitaine_boots");
  954. GameRegistry.registerItem(helmetCommandant, "item_commandant_helmet");
  955. GameRegistry.registerItem(chestPlateCommandant, "item_commandant_chestplate");
  956. GameRegistry.registerItem(leggingsCommandant, "item_commandant_leggings");
  957. GameRegistry.registerItem(bootsCommandant, "item_commandant_boots");
  958. GameRegistry.registerItem(helmetColonel, "item_colonel_helmet");
  959. GameRegistry.registerItem(chestPlateColonel, "item_colonel_chestplate");
  960. GameRegistry.registerItem(leggingsColonel, "item_colonel_leggings");
  961. GameRegistry.registerItem(bootsColonel, "item_colonel_boots");
  962. GameRegistry.registerItem(helmetGeneral, "item_general_helmet");
  963. GameRegistry.registerItem(chestPlateGeneral, "item_general_chestplate");
  964. GameRegistry.registerItem(leggingsGeneral, "item_general_leggings");
  965. GameRegistry.registerItem(bootsGeneral, "item_general_boots");
  966. GameRegistry.registerItem(helmetCivil, "item_civil_helmet");
  967. GameRegistry.registerItem(chestPlateCivil, "item_civil_chestplate");
  968. GameRegistry.registerItem(leggingsCivil, "item_civil_leggings");
  969. GameRegistry.registerItem(bootsCivil, "item_civil_boots");
  970.  
  971. SemiBrique = new BlocS(Material.ground).setBlockName("blocsb").setCreativeTab(AltisCraft);
  972. blockPeche = new BlockPeche().setBlockName("blocpeche").setBlockTextureName(MODID + ":BlocPeche").setCreativeTab(AltisCraft).setHardness(7.5F);
  973. blockPomme = new BlockPomme().setBlockName("blocpomme").setBlockTextureName(MODID + ":BlocPomme").setCreativeTab(AltisCraft).setHardness(7.5F);
  974. MineraisCuivre = new MineraisCuivre().setBlockName("bloccuivre").setBlockTextureName(MODID + ":BlocCuivre").setCreativeTab(AltisCraft).setHardness(7.5F);
  975. MineraisMeth = new MineraisMeth().setBlockName("blocmeth").setBlockTextureName(MODID + ":BlocMeth").setCreativeTab(AltisCraft).setHardness(25.5F);
  976. blockBrique = new Bloc().setBlockName("blocbrique").setBlockTextureName(MODID + ":BlocBrique").setCreativeTab(AltisCraft);
  977. Blanc = new Bloc().setBlockName("blanc").setBlockTextureName(MODID + ":Blanc").setCreativeTab(AltisCraft);
  978. blocSemiBrique = new Bloc().setBlockName("blocsemibrique").setCreativeTab(AltisCraft);
  979. blocGrisBrique = new Bloc().setBlockName("blocgrisbrique").setBlockTextureName(MODID + ":BlocGrisBrique").setCreativeTab(AltisCraft);
  980. CocainePlante = new CocainePlante().setBlockName("plantecocaine").setBlockTextureName(MODID + ":Cocaine").setCreativeTab(AltisCraft).setHardness(1.5F);
  981. CannabisPlante = new CannabisPlante().setBlockName("plantecannabis").setBlockTextureName(MODID + ":Cannabis").setCreativeTab(AltisCraft).setHardness(1.0F);
  982. blockMcDoV = new Bloc().setBlockName("blocmcdov").setBlockTextureName(MODID + ":McDoV").setCreativeTab(AltisCraft);
  983. blockMcDoR = new Bloc().setBlockName("blocmcdor").setBlockTextureName(MODID + ":McDoR").setCreativeTab(AltisCraft);
  984. BlocATM = new BlocATM().setBlockName("blocatm").setCreativeTab(AltisCraft);
  985. BlocCoco = new BlocCoco().setBlockName("bloccoco").setCreativeTab(AltisCraft).setHardness(7.5F);
  986. BlocRoute1 = new Bloc().setBlockName("blocroute1").setBlockTextureName(MODID + ":BlocRoute1").setCreativeTab(AltisCraft);
  987. BlocRoute2 = new Bloc().setBlockName("blocroute2").setBlockTextureName(MODID + ":BlocRoute2").setCreativeTab(AltisCraft);
  988. BlocATMTexture = new Bloc().setBlockName("blocatmtexture").setBlockTextureName(MODID + ":BlocATMTexture").setCreativeTab(AltisCraft);
  989. BlocPierreVert = new Bloc().setBlockName("blocpierrevert").setBlockTextureName(MODID + ":BlocPierreVert").setCreativeTab(AltisCraft);
  990. BlocFerMarron = new Bloc().setBlockName("blocfermarron").setBlockTextureName(MODID + ":BlocFerMarron").setCreativeTab(AltisCraft);
  991. BlocMetaData = new BlocMetaData().setBlockName("blocmetadata").setCreativeTab(AltisCraft);
  992. Blanc = new Bloc().setBlockName("blanc").setBlockTextureName(MODID + ":Blanc").setCreativeTab(AltisCraft);
  993. FerPeuGris = new Bloc().setBlockName("ferpeugris").setBlockTextureName(MODID + ":FerPeuGris").setCreativeTab(AltisCraft);
  994. PierreBlanc = new Bloc().setBlockName("pierreblanc").setBlockTextureName(MODID + ":PierreBlanc").setCreativeTab(AltisCraft);
  995. FerGris = new Bloc().setBlockName("fergris").setBlockTextureName(MODID + ":FerGris").setCreativeTab(AltisCraft);
  996. PlastiqueFlashVert = new Bloc().setBlockName("plastiqueflashvert").setBlockTextureName(MODID + ":PlastiqueFlashVert").setCreativeTab(AltisCraft);
  997. Cyan = new Bloc().setBlockName("cyan").setBlockTextureName(MODID + ":Cyan").setCreativeTab(AltisCraft);
  998. Aluminium = new Bloc().setBlockName("aluminium").setBlockTextureName(MODID + ":Aluminium").setCreativeTab(AltisCraft);
  999. BlanchePierre = new Bloc().setBlockName("blanchepierre").setBlockTextureName(MODID + ":BlanchePierre").setCreativeTab(AltisCraft);
  1000. PierreBlanche = new Bloc().setBlockName("pierreblanche").setBlockTextureName(MODID + ":PierreBlanche").setCreativeTab(AltisCraft);
  1001. PlastiqueVert = new Bloc().setBlockName("plastiquevert").setBlockTextureName(MODID + ":PlastiqueVert").setCreativeTab(AltisCraft);
  1002. Flesh = new Bloc().setBlockName("flesh").setBlockTextureName(MODID + ":Flesh").setCreativeTab(AltisCraft);
  1003. PlancheMarron = new Bloc().setBlockName("planchemarron").setBlockTextureName(MODID + ":PlancheMarron").setCreativeTab(AltisCraft);
  1004. Rouge = new Bloc().setBlockName("rouge").setBlockTextureName(MODID + ":Rouge").setCreativeTab(AltisCraft);
  1005. PlastiqueRouge = new Bloc().setBlockName("plastiquerouge").setBlockTextureName(MODID + ":PlastiqueRouge").setCreativeTab(AltisCraft);
  1006. PlastiqueBlanc = new Bloc().setBlockName("plastiqueblanc").setBlockTextureName(MODID + ":PlastiqueBlanc").setCreativeTab(AltisCraft);
  1007. PlastiqueBleu = new Bloc().setBlockName("plastiquebleu").setBlockTextureName(MODID + ":PlastiqueBleu").setCreativeTab(AltisCraft);
  1008. BlocLampadaire = new BlocLampadaire().setBlockName("bloclampadaire").setCreativeTab(AltisCraft);
  1009. BlocVLampadaire = new BlocVLampadaire().setBlockName("blocvlampadaire").setCreativeTab(AltisCraft);
  1010. PorteHopital = new PorteHopital(Material.ground).setUnlocalizedName("portehopital").setTextureName(ModAltisCraft.MODID + ":PorteHopital");
  1011.  
  1012. GameRegistry.registerItem(PorteHopital, "portehopital");
  1013. GameRegistry.registerBlock(SemiBrique, "blocsb");
  1014. GameRegistry.registerBlock(PlastiqueRouge, "plastiquerouge");
  1015. GameRegistry.registerBlock(PlastiqueBlanc, "plastiqueblanc");
  1016. GameRegistry.registerBlock(PlastiqueBleu, "plastiquebleu");
  1017. GameRegistry.registerBlock(Blanc, "blanc");
  1018. GameRegistry.registerBlock(FerPeuGris, "ferpeugris");
  1019. GameRegistry.registerBlock(PierreBlanc, "pierreblanc");
  1020. GameRegistry.registerBlock(FerGris, "fergris");
  1021. GameRegistry.registerBlock(PlastiqueFlashVert, "plastiqueflashvert");
  1022. GameRegistry.registerBlock(Cyan, "cyan");
  1023. GameRegistry.registerBlock(Aluminium, "aluminium");
  1024. GameRegistry.registerBlock(BlanchePierre, "blanchepierre");
  1025. GameRegistry.registerBlock(PierreBlanche, "pierreblanche");
  1026. GameRegistry.registerBlock(PlastiqueVert, "plastiquevert");
  1027. GameRegistry.registerBlock(Flesh, "flesh");
  1028. GameRegistry.registerBlock(PlancheMarron, "planchemarron");
  1029. GameRegistry.registerBlock(Rouge, "rouge");
  1030. GameRegistry.registerBlock(blockPeche, "block_peche");
  1031. GameRegistry.registerBlock(blockPomme, "block_pomme");
  1032. GameRegistry.registerBlock(blockBrique, "block_brick");
  1033. GameRegistry.registerBlock(blocSemiBrique, "block_semibrick");
  1034. GameRegistry.registerBlock(blocGrisBrique, "block_grisbrick");
  1035. GameRegistry.registerBlock(MineraisCuivre, "bloc_cuivre");
  1036. GameRegistry.registerBlock(CannabisPlante, "plante_cannabis");
  1037. GameRegistry.registerBlock(CocainePlante, "plante_cocaine");
  1038. GameRegistry.registerBlock(blockMcDoV, "block_mcdov");
  1039. GameRegistry.registerBlock(blockMcDoR, "block_mcdor");
  1040. GameRegistry.registerBlock(BlocRoute1, "bloc_route1");
  1041. GameRegistry.registerBlock(BlocRoute2, "bloc_route2");
  1042. GameRegistry.registerBlock(BlocATMTexture, "bloc_atmtexture");
  1043. GameRegistry.registerBlock(BlocATM, "blocatm");
  1044. GameRegistry.registerBlock(BlocLampadaire, "bloclampadaire");
  1045. GameRegistry.registerBlock(BlocVLampadaire, "blocvlampadaire");
  1046. GameRegistry.registerBlock(BlocCoco, "bloccoco");
  1047. GameRegistry.registerBlock(MineraisMeth, "mineraismeth");
  1048. GameRegistry.registerBlock(BlocPierreVert, "blocpierrevert");
  1049. GameRegistry.registerBlock(BlocFerMarron, "blocfermarron");
  1050. GameRegistry.registerBlock(BlocMetaData, ItemBlocMetaData.class, "bloc_metadata");
  1051.  
  1052. GameRegistry.registerTileEntity(TileEntityATM.class, "modid:atm");
  1053. GameRegistry.registerTileEntity(TileEntityVLampadaire.class, "modid:vlampadaire");
  1054.  
  1055. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.IIcentimes, 1), new Object[] {"##", '#', ModAltisCraft.Icentime});
  1056. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.IIcentimes, 1), new Object[] {"#", "#", '#', ModAltisCraft.Icentime});
  1057. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Vcentimes, 1), new Object[] {"#", "I", "#", '#', ModAltisCraft.IIcentimes, 'I', ModAltisCraft.Icentime});
  1058. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Vcentimes, 1), new Object[] {"#I#", '#', ModAltisCraft.IIcentimes, 'I', ModAltisCraft.Icentime});
  1059. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Xcentimes, 1), new Object[] {"##", '#', ModAltisCraft.Vcentimes});
  1060. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Xcentimes, 1), new Object[] {"#", "#", '#', ModAltisCraft.Vcentimes});
  1061. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.XXcentimes, 1), new Object[] {"##", '#', ModAltisCraft.Xcentimes});
  1062. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.XXcentimes, 1), new Object[] {"#", "#", '#', ModAltisCraft.Xcentimes});
  1063. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Lcentimes, 1), new Object[] {"#", "I", "#", '#', ModAltisCraft.XXcentimes, 'I', ModAltisCraft.Xcentimes});
  1064. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Lcentimes, 1), new Object[] {"#I#", '#', ModAltisCraft.XXcentimes, 'I', ModAltisCraft.Xcentimes});
  1065. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Ieuro, 1), new Object[] {"##", '#', ModAltisCraft.Lcentimes});
  1066. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Ieuro, 1), new Object[] {"#", "#", '#', ModAltisCraft.Lcentimes});
  1067. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.IIeuros, 1), new Object[] {"##", '#', ModAltisCraft.Ieuro});
  1068. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.IIeuros, 1), new Object[] {"#", "#", '#', ModAltisCraft.Ieuro});
  1069. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Veuros, 1), new Object[] {"#", "I", "#", '#', ModAltisCraft.IIeuros, 'I', ModAltisCraft.Ieuro});
  1070. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Veuros, 1), new Object[] {"#I#", '#', ModAltisCraft.IIeuros, 'I', ModAltisCraft.Ieuro});
  1071. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Xeuros, 1), new Object[] {"##", '#', ModAltisCraft.Veuros});
  1072. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Xeuros, 1), new Object[] {"#", "#", '#', ModAltisCraft.Veuros});
  1073. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.XXeuros, 1), new Object[] {"##", '#', ModAltisCraft.Xeuros});
  1074. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.XXeuros, 1), new Object[] {"#", "#", '#', ModAltisCraft.Xeuros});
  1075. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Leuros, 1), new Object[] {"#", "I", "#", '#', ModAltisCraft.XXeuros, 'I', ModAltisCraft.Xeuros});
  1076. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Leuros, 1), new Object[] {"#I#", '#', ModAltisCraft.XXeuros, 'I', ModAltisCraft.Xeuros});
  1077. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Ceuros, 1), new Object[] {"##", '#', ModAltisCraft.Leuros});
  1078. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Ceuros, 1), new Object[] {"#", "#", '#', ModAltisCraft.Leuros});
  1079.  
  1080. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Icentime, 2), new Object[] {"#", '#', ModAltisCraft.IIcentimes});
  1081. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Icentime, 5), new Object[] {"#", '#', ModAltisCraft.Vcentimes});
  1082. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Vcentimes, 2), new Object[] {"#", '#', ModAltisCraft.Xcentimes});
  1083. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Xcentimes, 2), new Object[] {"#", '#', ModAltisCraft.XXcentimes});
  1084. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Xcentimes, 5), new Object[] {"#", '#', ModAltisCraft.Lcentimes});
  1085. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Lcentimes, 2), new Object[] {"#", '#', ModAltisCraft.Ieuro});
  1086. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Ieuro, 2), new Object[] {"#", '#', ModAltisCraft.IIeuros});
  1087. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Ieuro, 5), new Object[] {"#", '#', ModAltisCraft.Veuros});
  1088. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Veuros, 2), new Object[] {"#", '#', ModAltisCraft.Xeuros});
  1089. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Xeuros, 2), new Object[] {"#", '#', ModAltisCraft.XXeuros});
  1090. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Xeuros, 5), new Object[] {"#", '#', ModAltisCraft.Leuros});
  1091. GameRegistry.addRecipe(new ItemStack(ModAltisCraft.Leuros, 2), new Object[] {"#", '#', ModAltisCraft.Ceuros});
  1092.  
  1093. GameRegistry.addSmelting(ModAltisCraft.MineraisCuivre, new ItemStack(ModAltisCraft.itemCuivre), 1.0F);
  1094. }
  1095.  
  1096. @EventHandler
  1097. public void Init(FMLPreInitializationEvent event)
  1098. {
  1099. proxy.registerRender();
  1100. System.out.println("Initialisation !");
  1101. }
  1102. @EventHandler
  1103. public void postInit(FMLPostInitializationEvent event)
  1104. {
  1105. System.out.println("Post-initialisation !");
  1106. addEntity(EntityMobBenjaminLoison.class, "BenjaminLoison", 420, 0, 0);
  1107. proxy.registerRender();
  1108. }
  1109.  
  1110. public void addEntity(Class<? extends net.minecraft.entity.Entity> entityClass, String name, int id, int backgroundColor, int foregroundColor)
  1111. {
  1112. EntityRegistry.registerGlobalEntityID(entityClass, name, EntityRegistry.findGlobalUniqueEntityId(), backgroundColor, foregroundColor);
  1113. EntityRegistry.registerModEntity(entityClass, name, id, this, 40, 1, true);
  1114. }
  1115.  
  1116. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement