daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Mar 17th, 2018 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.lycoon.lemnoslife;
  2.  
  3. import java.awt.Color;
  4. import java.io.File;
  5. import java.sql.Connection;
  6. import java.sql.DriverManager;
  7. import java.sql.SQLException;
  8. import java.text.DecimalFormat;
  9. import java.text.DecimalFormatSymbols;
  10. import java.text.NumberFormat;
  11.  
  12. import org.lwjgl.opengl.Display;
  13.  
  14. import com.lycoon.lemnoslife.assets.Bloc;
  15. import com.lycoon.lemnoslife.assets.BlockCannabis;
  16. import com.lycoon.lemnoslife.assets.BlockCoca;
  17. import com.lycoon.lemnoslife.assets.BlockCuivre;
  18. import com.lycoon.lemnoslife.assets.BlockDiamant;
  19. import com.lycoon.lemnoslife.assets.BlockFer;
  20. import com.lycoon.lemnoslife.assets.BlockPeche;
  21. import com.lycoon.lemnoslife.assets.BlockPomme;
  22. import com.lycoon.lemnoslife.assets.ItemBacon;
  23. import com.lycoon.lemnoslife.assets.ItemCannabis;
  24. import com.lycoon.lemnoslife.assets.ItemChoco;
  25. import com.lycoon.lemnoslife.assets.ItemCoca;
  26. import com.lycoon.lemnoslife.assets.ItemCuivre;
  27. import com.lycoon.lemnoslife.assets.ItemDAE;
  28. import com.lycoon.lemnoslife.assets.ItemDiamant;
  29. import com.lycoon.lemnoslife.assets.ItemDiamantTraite;
  30. import com.lycoon.lemnoslife.assets.ItemEssence;
  31. import com.lycoon.lemnoslife.assets.ItemFer;
  32. import com.lycoon.lemnoslife.assets.ItemFeuilleDeCoca;
  33. import com.lycoon.lemnoslife.assets.ItemGPS;
  34. import com.lycoon.lemnoslife.assets.ItemHash;
  35. import com.lycoon.lemnoslife.assets.ItemLingotCuivre;
  36. import com.lycoon.lemnoslife.assets.ItemLingotFer;
  37. import com.lycoon.lemnoslife.assets.ItemNPC;
  38. import com.lycoon.lemnoslife.assets.ItemPeche;
  39. import com.lycoon.lemnoslife.assets.ItemPetrole;
  40. import com.lycoon.lemnoslife.assets.ItemPhone;
  41. import com.lycoon.lemnoslife.assets.ItemPomme;
  42. import com.lycoon.lemnoslife.assets.ItemPoulet;
  43. import com.lycoon.lemnoslife.assets.ItemSabot;
  44. import com.lycoon.lemnoslife.assets.TileEntityATM;
  45. import com.lycoon.lemnoslife.commands.CommandeGrade;
  46. import com.lycoon.lemnoslife.commands.CommandeMoney;
  47. import com.lycoon.lemnoslife.commands.CommandeNPC;
  48. import com.lycoon.lemnoslife.gui.ModGuiHandler;
  49. import com.lycoon.lemnoslife.network.Packet;
  50. import com.lycoon.lemnoslife.network.Packet.HandlerClient;
  51. import com.lycoon.lemnoslife.network.Packet.HandlerCommon;
  52. import com.lycoon.lemnoslife.network.PacketAmende;
  53. import com.lycoon.lemnoslife.network.PacketAmende.HandlerCommonAmende;
  54. import com.lycoon.lemnoslife.network.PacketArmurier;
  55. import com.lycoon.lemnoslife.network.PacketArmurier.HandlerServerArmurier;
  56. import com.lycoon.lemnoslife.network.PacketCloseGUI;
  57. import com.lycoon.lemnoslife.network.PacketCloseGUI.HandlerClientCloseGUI;
  58. import com.lycoon.lemnoslife.network.PacketComa;
  59. import com.lycoon.lemnoslife.network.PacketComa.HandlerClientComa;
  60. import com.lycoon.lemnoslife.network.PacketComaMedecin;
  61. import com.lycoon.lemnoslife.network.PacketComaMedecin.HandlerServerComaMedecin;
  62. import com.lycoon.lemnoslife.network.PacketComaRespawn;
  63. import com.lycoon.lemnoslife.network.PacketComaRespawn.HandlerServerComaRespawn;
  64. import com.lycoon.lemnoslife.network.PacketConcessionnaire;
  65. import com.lycoon.lemnoslife.network.PacketConcessionnaire.HandlerServerConcessionnaire;
  66. import com.lycoon.lemnoslife.network.PacketCreationGang;
  67. import com.lycoon.lemnoslife.network.PacketCreationGang.HandlerServerCreationGang;
  68. import com.lycoon.lemnoslife.network.PacketDepot;
  69. import com.lycoon.lemnoslife.network.PacketDepot.HandlerCommonDepot;
  70. import com.lycoon.lemnoslife.network.PacketGarage;
  71. import com.lycoon.lemnoslife.network.PacketGarage.HandlerClientGarage;
  72. import com.lycoon.lemnoslife.network.PacketGarage.HandlerServerGarage;
  73. import com.lycoon.lemnoslife.network.PacketGarageEntree;
  74. import com.lycoon.lemnoslife.network.PacketGarageEntree.HandlerServerGarageEntree;
  75. import com.lycoon.lemnoslife.network.PacketGarageSortie;
  76. import com.lycoon.lemnoslife.network.PacketGarageSortie.HandlerServerGarageSortie;
  77. import com.lycoon.lemnoslife.network.PacketGuiGangs;
  78. import com.lycoon.lemnoslife.network.PacketGuiGangs.HandlerClientGuiGangs;
  79. import com.lycoon.lemnoslife.network.PacketGuiGangs.HandlerServerGuiGangs;
  80. import com.lycoon.lemnoslife.network.PacketGuiGarage;
  81. import com.lycoon.lemnoslife.network.PacketGuiGarage.HandlerClientGuiGarage;
  82. import com.lycoon.lemnoslife.network.PacketGuiGarage.HandlerServerGuiGarage;
  83. import com.lycoon.lemnoslife.network.PacketInventaire;
  84. import com.lycoon.lemnoslife.network.PacketInventaire.HandlerClientInventaire;
  85. import com.lycoon.lemnoslife.network.PacketInventaire.HandlerServerInventaire;
  86. import com.lycoon.lemnoslife.network.PacketJoinGang;
  87. import com.lycoon.lemnoslife.network.PacketJoinGang.HandlerServerJoinGang;
  88. import com.lycoon.lemnoslife.network.PacketKlaxon;
  89. import com.lycoon.lemnoslife.network.PacketKlaxon.HandlerServerKlaxon;
  90. import com.lycoon.lemnoslife.network.PacketLicenses;
  91. import com.lycoon.lemnoslife.network.PacketLicenses.HandlerClientLicenses;
  92. import com.lycoon.lemnoslife.network.PacketLicenses.HandlerServerLicenses;
  93. import com.lycoon.lemnoslife.network.PacketMenotte;
  94. import com.lycoon.lemnoslife.network.PacketMenotte.HandlerClientMenotte;
  95. import com.lycoon.lemnoslife.network.PacketMenotte.HandlerServerMenotte;
  96. import com.lycoon.lemnoslife.network.PacketMenotteChat;
  97. import com.lycoon.lemnoslife.network.PacketMenotteChat.HandlerServerMenotteChat;
  98. import com.lycoon.lemnoslife.network.PacketNPC;
  99. import com.lycoon.lemnoslife.network.PacketNPC.HandlerCommonNPC;
  100. import com.lycoon.lemnoslife.network.PacketOpenGUI;
  101. import com.lycoon.lemnoslife.network.PacketOpenGUI.HandlerClientOpenGUI;
  102. import com.lycoon.lemnoslife.network.PacketPhone;
  103. import com.lycoon.lemnoslife.network.PacketPhone.HandlerCommonPhone;
  104. import com.lycoon.lemnoslife.network.PacketPlayerTarget;
  105. import com.lycoon.lemnoslife.network.PacketPlayerTarget.HandlerClientPlayerTarget;
  106. import com.lycoon.lemnoslife.network.PacketPrefecture;
  107. import com.lycoon.lemnoslife.network.PacketPrefecture.HandlerServerPrefecture;
  108. import com.lycoon.lemnoslife.network.PacketPub;
  109. import com.lycoon.lemnoslife.network.PacketPub.HandlerClientPub;
  110. import com.lycoon.lemnoslife.network.PacketPub.HandlerServerPub;
  111. import com.lycoon.lemnoslife.network.PacketQuitGang;
  112. import com.lycoon.lemnoslife.network.PacketQuitGang.HandlerServerQuitGang;
  113. import com.lycoon.lemnoslife.network.PacketReanimation;
  114. import com.lycoon.lemnoslife.network.PacketReanimation.HandlerClientReanimation;
  115. import com.lycoon.lemnoslife.network.PacketReanimation.HandlerServerReanimation;
  116. import com.lycoon.lemnoslife.network.PacketReset;
  117. import com.lycoon.lemnoslife.network.PacketReset.HandlerClientReset;
  118. import com.lycoon.lemnoslife.network.PacketRetrait;
  119. import com.lycoon.lemnoslife.network.PacketRetrait.HandlerCommonRetrait;
  120. import com.lycoon.lemnoslife.network.PacketShop;
  121. import com.lycoon.lemnoslife.network.PacketShop.HandlerServerShop;
  122. import com.lycoon.lemnoslife.network.PacketSpawn;
  123. import com.lycoon.lemnoslife.network.PacketSpawn.HandlerClientSpawn;
  124. import com.lycoon.lemnoslife.network.PacketTraitement;
  125. import com.lycoon.lemnoslife.network.PacketTraitement.HandlerClientTraitement;
  126. import com.lycoon.lemnoslife.network.PacketTraitement.HandlerServerTraitement;
  127. import com.lycoon.lemnoslife.network.PacketTraitementComplete;
  128. import com.lycoon.lemnoslife.network.PacketTraitementComplete.HandlerServerTraitementComplete;
  129. import com.lycoon.lemnoslife.network.PacketTransfert;
  130. import com.lycoon.lemnoslife.network.PacketTransfert.HandlerCommonTransfert;
  131. import com.lycoon.lemnoslife.network.PacketUpdateGangRole;
  132. import com.lycoon.lemnoslife.network.PacketUpdateGangRole.HandlerServerUpdateGangRole;
  133. import com.lycoon.lemnoslife.network.PacketVerrouillageVehicule;
  134. import com.lycoon.lemnoslife.network.PacketVerrouillageVehicule.HandlerServerVerrouillageVehicule;
  135. import com.lycoon.lemnoslife.npc.EntityNPCArmurier;
  136. import com.lycoon.lemnoslife.npc.EntityNPCArmurierPolice;
  137. import com.lycoon.lemnoslife.npc.EntityNPCBanquier;
  138. import com.lycoon.lemnoslife.npc.EntityNPCConcessionnaire;
  139. import com.lycoon.lemnoslife.npc.EntityNPCConcessionnaireMedic;
  140. import com.lycoon.lemnoslife.npc.EntityNPCDealer;
  141. import com.lycoon.lemnoslife.npc.EntityNPCGarage;
  142. import com.lycoon.lemnoslife.npc.EntityNPCMagasin;
  143. import com.lycoon.lemnoslife.npc.EntityNPCMarche;
  144. import com.lycoon.lemnoslife.npc.EntityNPCPrefecture;
  145. import com.lycoon.lemnoslife.npc.EntityNPCTraitementCannabis;
  146. import com.lycoon.lemnoslife.npc.EntityNPCTraitementCoca;
  147. import com.lycoon.lemnoslife.npc.EntityNPCTraitementCuivre;
  148. import com.lycoon.lemnoslife.npc.EntityNPCTraitementDiamant;
  149. import com.lycoon.lemnoslife.npc.EntityNPCTraitementFer;
  150.  
  151. import cpw.mods.fml.common.FMLCommonHandler;
  152. import cpw.mods.fml.common.Mod;
  153. import cpw.mods.fml.common.Mod.EventHandler;
  154. import cpw.mods.fml.common.Mod.Instance;
  155. import cpw.mods.fml.common.SidedProxy;
  156. import cpw.mods.fml.common.event.FMLInitializationEvent;
  157. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  158. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  159. import cpw.mods.fml.common.event.FMLServerStartingEvent;
  160. import cpw.mods.fml.common.network.NetworkRegistry;
  161. import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
  162. import cpw.mods.fml.common.registry.EntityRegistry;
  163. import cpw.mods.fml.common.registry.GameRegistry;
  164. import cpw.mods.fml.relauncher.Side;
  165. import net.minecraft.block.Block;
  166. import net.minecraft.block.material.Material;
  167. import net.minecraft.creativetab.CreativeTabs;
  168. import net.minecraft.item.Item;
  169. import net.minecraft.item.ItemStack;
  170. import net.minecraftforge.common.MinecraftForge;
  171. import net.minecraftforge.common.config.Configuration;
  172.  
  173. @Mod(modid = Main.MODID, name = Main.MODNAME, version = Main.VERSION)
  174.  
  175. /*
  176.  * ########################## LEMNOS LIFE MOD ##########################
  177.  *                  Authors: BOIS Hugo & ARNAUD Cédric
  178.  *                          Started: June 2017
  179.  *
  180.  *              Mod under Creative Commons BY-NC-SA 2018
  181.  * #####################################################################
  182. */
  183.  
  184. public class Main {
  185.    
  186.     @SidedProxy(clientSide="com.lycoon.lemnoslife.ClientProxy", serverSide="com.lycoon.lemnoslife.ServerProxy")
  187.     public static CommonProxy proxy;
  188.     public static SimpleNetworkWrapper network;
  189.    
  190.     //SQL
  191.     public static Connection connection;
  192.     public String host, database, username, password, table, url;
  193.     private int port;
  194.  
  195.     public static NumberFormat df = NumberFormat.getCurrencyInstance();
  196.     public static DecimalFormatSymbols dfs = new DecimalFormatSymbols();
  197.    
  198.     public static Block atm, blockCuivre, blockDiamant, blockFer, blockPomme, blockPeche, blockCannabis, blockCoca;
  199.     public static Item itemGPS, itemPhone, itemFeuilleDeCoca, itemCoca, itemCannabis, itemCuivre, itemDiamant, itemDiamantTraite,
  200.     itemFer, itemHash, itemLingotCuivre, itemLingotFer, itemPeche, itemPetrole, itemPomme, itemBacon, itemPoulet, itemChoco, itemNPC, itemDAE, itemSabot;
  201.    
  202.     public static final String MODID = "lemnos";
  203.     public static final String MODNAME = "Lemnos Life";
  204.     public static final String VERSION = "0.8.1";
  205.        
  206.     @Instance(MODID)
  207.     public static Main instance = new Main();
  208.      
  209.     @EventHandler
  210.     public void preInit(FMLPreInitializationEvent e) {
  211.         proxy.preInit(e);
  212.        
  213.         //Titre de la fenêtre
  214.         if(e.getSide().isClient())
  215.             Display.setTitle("Lemnos Life");
  216.  
  217.         //Monnaie
  218.         dfs.setCurrencySymbol("€");
  219.         dfs.setGroupingSeparator(' ');
  220.         dfs.setMonetaryDecimalSeparator(',');
  221.         df.setMaximumFractionDigits(0);
  222.         ((DecimalFormat) df).setDecimalFormatSymbols(dfs);
  223.        
  224.         //Blocs
  225.         atm = new Bloc(Material.rock).setBlockName("ATM").setBlockTextureName(Main.MODID + ":atm").setCreativeTab(lemnosTab).setResistance(100F).setHardness(100F);
  226.         GameRegistry.registerBlock(atm, "atm");
  227.         blockCuivre = new BlockCuivre(Material.rock).setBlockName("blockCuivre").setBlockTextureName(Main.MODID + ":mineraiCuivre").setCreativeTab(lemnosTab).setHardness(25F);
  228.         GameRegistry.registerBlock(blockCuivre, "blockCuivre");
  229.         blockDiamant = new BlockDiamant(Material.rock).setBlockName("blockDiamant").setBlockTextureName(Main.MODID + ":mineraiDiamant").setCreativeTab(lemnosTab).setHardness(25F);
  230.         GameRegistry.registerBlock(blockDiamant, "blockDiamant");
  231.         blockFer = new BlockFer(Material.rock).setBlockName("blockFer").setBlockTextureName(Main.MODID + ":mineraiFer").setCreativeTab(lemnosTab).setHardness(25F);
  232.         GameRegistry.registerBlock(blockFer, "blockFer");
  233.         blockPomme = new BlockPomme(Material.leaves).setBlockName("blockPomme").setBlockTextureName(Main.MODID + ":blockPomme").setCreativeTab(lemnosTab).setHardness(0.5F).setStepSound(Block.soundTypeGrass);
  234.         GameRegistry.registerBlock(blockPomme, "blockPomme");
  235.         blockPeche = new BlockPeche(Material.leaves).setBlockName("blockPeche").setBlockTextureName(Main.MODID + ":blockPeche").setCreativeTab(lemnosTab).setHardness(0.5F).setStepSound(Block.soundTypeGrass);
  236.         GameRegistry.registerBlock(blockPeche, "blockPeche");
  237.         blockCannabis = new BlockCannabis().setBlockName("blockCannabis").setBlockTextureName(Main.MODID + ":blockCannabis").setCreativeTab(lemnosTab).setHardness(2F);
  238.         GameRegistry.registerBlock(blockCannabis, "blockCannabis");
  239.         blockCoca = new BlockCoca().setBlockName("blockCoca").setBlockTextureName(Main.MODID + ":blockCoca").setCreativeTab(lemnosTab).setHardness(2F);
  240.         GameRegistry.registerBlock(blockCoca, "blockCoca");
  241.        
  242.         //Items
  243.         itemGPS = new ItemGPS().setUnlocalizedName("gps").setTextureName(Main.MODID + ":gps").setCreativeTab(lemnosTab).setMaxStackSize(1);
  244.         GameRegistry.registerItem(itemGPS, "gps");
  245.         itemPhone = new ItemPhone().setUnlocalizedName("phone").setTextureName(Main.MODID + ":phone").setCreativeTab(lemnosTab).setMaxStackSize(1);
  246.         GameRegistry.registerItem(itemPhone, "phone");
  247.         itemFeuilleDeCoca = new ItemFeuilleDeCoca().setUnlocalizedName("feuillecoca").setTextureName(Main.MODID + ":feuillecoca").setCreativeTab(lemnosTab).setMaxStackSize(4);
  248.         GameRegistry.registerItem(itemFeuilleDeCoca, "feuillecoca");
  249.         itemCoca = new ItemCoca().setUnlocalizedName("coca").setTextureName(Main.MODID + ":coca").setCreativeTab(lemnosTab);
  250.         GameRegistry.registerItem(itemCoca, "coca");
  251.         itemCannabis = new ItemCannabis().setUnlocalizedName("cannabis").setTextureName(Main.MODID + ":cannabis").setCreativeTab(lemnosTab).setMaxStackSize(4);
  252.         GameRegistry.registerItem(itemCannabis, "cannabis");
  253.         itemCuivre = new ItemCuivre().setUnlocalizedName("cuivre").setTextureName(Main.MODID + ":cuivreBrut").setCreativeTab(lemnosTab).setMaxStackSize(4);
  254.         GameRegistry.registerItem(itemCuivre, "cuivre");
  255.         itemDiamant = new ItemDiamant().setUnlocalizedName("diamant").setTextureName(Main.MODID + ":diamantBrut").setCreativeTab(lemnosTab).setMaxStackSize(4);
  256.         GameRegistry.registerItem(itemDiamant, "diamant");
  257.         itemDiamantTraite = new ItemDiamantTraite().setUnlocalizedName("diamanttraite").setTextureName(Main.MODID + ":diamantTraite").setCreativeTab(lemnosTab);
  258.         GameRegistry.registerItem(itemDiamantTraite, "diamanttraite");
  259.         itemFer = new ItemFer().setUnlocalizedName("fer").setTextureName(Main.MODID + ":ferBrut").setCreativeTab(lemnosTab).setMaxStackSize(4);
  260.         GameRegistry.registerItem(itemFer, "fer");
  261.         itemHash = new ItemHash().setUnlocalizedName("hash").setTextureName(Main.MODID + ":hash").setCreativeTab(lemnosTab);
  262.         GameRegistry.registerItem(itemHash, "hash");
  263.         itemLingotCuivre = new ItemLingotCuivre().setUnlocalizedName("lingotcuivre").setTextureName(Main.MODID + ":lingotCuivre").setCreativeTab(lemnosTab);
  264.         GameRegistry.registerItem(itemLingotCuivre, "lingotcuivre");
  265.         itemLingotFer = new ItemLingotFer().setUnlocalizedName("lingotfer").setTextureName(Main.MODID + ":lingotFer").setCreativeTab(lemnosTab);
  266.         GameRegistry.registerItem(itemLingotFer, "lingotfer");
  267.         itemPetrole = new ItemPetrole().setUnlocalizedName("petrole").setTextureName(Main.MODID + ":petroleBrut").setCreativeTab(lemnosTab);
  268.         GameRegistry.registerItem(itemPetrole, "petrole");
  269.         itemNPC = new ItemNPC().setUnlocalizedName("npc").setTextureName(Main.MODID + ":npc").setCreativeTab(lemnosTab).setMaxStackSize(1);
  270.         GameRegistry.registerItem(itemNPC, "npc");
  271.         itemDAE = new ItemDAE().setUnlocalizedName("dae").setTextureName(Main.MODID + ":dae").setCreativeTab(lemnosTab).setMaxStackSize(1);
  272.         GameRegistry.registerItem(itemDAE, "dae");
  273.         itemSabot = new ItemSabot().setUnlocalizedName("sabot").setTextureName(Main.MODID + ":sabot").setCreativeTab(lemnosTab).setMaxStackSize(1);
  274.         GameRegistry.registerItem(itemSabot, "sabot");
  275.         itemPeche = new ItemPeche(2, 0.6F, true).setUnlocalizedName("peche").setTextureName(Main.MODID + ":peche").setCreativeTab(lemnosTab);
  276.         GameRegistry.registerItem(itemPeche, "peche");
  277.         itemPomme = new ItemPomme(2, 0.6F, true).setUnlocalizedName("pomme").setTextureName(Main.MODID + ":pomme").setCreativeTab(lemnosTab);
  278.         GameRegistry.registerItem(itemPomme, "pomme");
  279.         itemBacon = new ItemBacon(5, 1.0F, true).setUnlocalizedName("bacon").setTextureName(Main.MODID + ":bacon").setCreativeTab(lemnosTab);
  280.         GameRegistry.registerItem(itemBacon, "bacon");
  281.         itemPoulet = new ItemPoulet(4, 0.9F, true).setUnlocalizedName("poulet").setTextureName(Main.MODID + ":poulet").setCreativeTab(lemnosTab);
  282.         GameRegistry.registerItem(itemPoulet, "poulet");
  283.         itemChoco = new ItemChoco(3, 0.9F, true).setUnlocalizedName("choco").setTextureName(Main.MODID + ":choco").setCreativeTab(lemnosTab);
  284.         GameRegistry.registerItem(itemChoco, "choco");
  285.        
  286.         //Packets
  287.         network = NetworkRegistry.INSTANCE.newSimpleChannel("Lemnos");
  288.         network.registerMessage(HandlerClient.class, Packet.class, 0, Side.CLIENT);
  289.         network.registerMessage(HandlerCommon.class, Packet.class, 1, Side.SERVER);
  290.         network.registerMessage(HandlerCommonAmende.class, PacketAmende.class, 2, Side.SERVER);
  291.         network.registerMessage(HandlerCommonPhone.class, PacketPhone.class, 3, Side.SERVER);
  292.         network.registerMessage(HandlerCommonNPC.class, PacketNPC.class, 4, Side.SERVER);
  293.         network.registerMessage(HandlerServerShop.class, PacketShop.class, 5, Side.SERVER);
  294.         network.registerMessage(HandlerCommonRetrait.class, PacketRetrait.class, 6, Side.SERVER);
  295.         network.registerMessage(HandlerCommonDepot.class, PacketDepot.class, 7, Side.SERVER);
  296.         network.registerMessage(HandlerCommonTransfert.class, PacketTransfert.class, 8, Side.SERVER);
  297.         network.registerMessage(HandlerClientSpawn.class, PacketSpawn.class, 9, Side.CLIENT);
  298.         network.registerMessage(HandlerClientPub.class, PacketPub.class, 10, Side.CLIENT);
  299.         network.registerMessage(HandlerServerPub.class, PacketPub.class, 11, Side.SERVER);
  300.         network.registerMessage(HandlerServerVerrouillageVehicule.class, PacketVerrouillageVehicule.class, 12, Side.SERVER);
  301.         network.registerMessage(HandlerServerConcessionnaire.class, PacketConcessionnaire.class, 13, Side.SERVER);
  302.         network.registerMessage(HandlerClientMenotte.class, PacketMenotte.class, 14, Side.CLIENT);
  303.         network.registerMessage(HandlerServerMenotte.class, PacketMenotte.class, 15, Side.SERVER);
  304.         network.registerMessage(HandlerServerMenotteChat.class, PacketMenotteChat.class, 16, Side.SERVER);
  305.         network.registerMessage(HandlerClientReset.class, PacketReset.class, 17, Side.CLIENT);
  306.         network.registerMessage(HandlerClientGarage.class, PacketGarage.class, 18, Side.CLIENT);
  307.         network.registerMessage(HandlerServerGarage.class, PacketGarage.class, 19, Side.SERVER);
  308.         network.registerMessage(HandlerServerKlaxon.class, PacketKlaxon.class, 20, Side.SERVER);
  309.         network.registerMessage(HandlerServerGarageEntree.class, PacketGarageEntree.class, 21, Side.SERVER);
  310.         network.registerMessage(HandlerServerGarageSortie.class, PacketGarageSortie.class, 22, Side.SERVER);
  311.         network.registerMessage(HandlerClientCloseGUI.class, PacketCloseGUI.class, 23, Side.CLIENT);
  312.         network.registerMessage(HandlerClientLicenses.class, PacketLicenses.class, 24, Side.CLIENT);
  313.         network.registerMessage(HandlerServerLicenses.class, PacketLicenses.class, 25, Side.SERVER);
  314.         network.registerMessage(HandlerServerPrefecture.class, PacketPrefecture.class, 26, Side.SERVER);
  315.         network.registerMessage(HandlerClientInventaire.class, PacketInventaire.class, 27, Side.CLIENT);
  316.         network.registerMessage(HandlerServerInventaire.class, PacketInventaire.class, 28, Side.SERVER);
  317.         network.registerMessage(HandlerServerArmurier.class, PacketArmurier.class, 29, Side.SERVER);
  318.         network.registerMessage(HandlerServerTraitement.class, PacketTraitement.class, 30, Side.SERVER);
  319.         network.registerMessage(HandlerClientTraitement.class, PacketTraitement.class, 31, Side.CLIENT);
  320.         network.registerMessage(HandlerServerTraitementComplete.class, PacketTraitementComplete.class, 32, Side.SERVER);
  321.         network.registerMessage(HandlerClientComa.class, PacketComa.class, 33, Side.CLIENT);
  322.         network.registerMessage(HandlerServerComaMedecin.class, PacketComaMedecin.class, 34, Side.SERVER);
  323.         network.registerMessage(HandlerServerComaRespawn.class, PacketComaRespawn.class, 35, Side.SERVER);
  324.         network.registerMessage(HandlerServerGuiGarage.class, PacketGuiGarage.class, 36, Side.SERVER);
  325.         network.registerMessage(HandlerClientGuiGarage.class, PacketGuiGarage.class, 37, Side.CLIENT);
  326.         network.registerMessage(HandlerServerGuiGangs.class, PacketGuiGangs.class, 38, Side.SERVER);
  327.         network.registerMessage(HandlerClientGuiGangs.class, PacketGuiGangs.class, 39, Side.CLIENT);
  328.         network.registerMessage(HandlerServerCreationGang.class, PacketCreationGang.class, 40, Side.SERVER);
  329.         network.registerMessage(HandlerServerJoinGang.class, PacketJoinGang.class, 41, Side.SERVER);
  330.         network.registerMessage(HandlerServerQuitGang.class, PacketQuitGang.class, 42, Side.SERVER);
  331.         network.registerMessage(HandlerServerUpdateGangRole.class, PacketUpdateGangRole.class, 43, Side.SERVER);
  332.         network.registerMessage(HandlerClientPlayerTarget.class, PacketPlayerTarget.class, 44, Side.CLIENT);
  333.         network.registerMessage(HandlerServerReanimation.class, PacketReanimation.class, 45, Side.SERVER);
  334.         network.registerMessage(HandlerClientReanimation.class, PacketReanimation.class, 46, Side.CLIENT);
  335.         network.registerMessage(HandlerClientOpenGUI.class, PacketOpenGUI.class, 47, Side.CLIENT);
  336.        
  337.         NetworkRegistry.INSTANCE.registerGuiHandler(Main.instance, new ModGuiHandler());
  338.         MinecraftForge.EVENT_BUS.register(new EventHandlerCommon());
  339.         FMLCommonHandler.instance().bus().register(new EventHandlerCommon());
  340.        
  341.         System.out.println("Pré-Initialisation Lemnos Life");
  342.     }
  343.  
  344.     @EventHandler
  345.     public void init(FMLInitializationEvent e) {
  346.         proxy.init(e);
  347.        
  348.         EntityRegistry.registerGlobalEntityID(EntityNPCMarche.class, "marche", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  349.         EntityRegistry.registerModEntity(EntityNPCMarche.class, "marche", 0, this, 20, 1, true);
  350.        
  351.         EntityRegistry.registerGlobalEntityID(EntityNPCConcessionnaire.class, "concessionnaire", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  352.         EntityRegistry.registerModEntity(EntityNPCConcessionnaire.class, "concessionnaire", 1, this, 20, 1, true);
  353.        
  354.         EntityRegistry.registerGlobalEntityID(EntityNPCMagasin.class, "magasin", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  355.         EntityRegistry.registerModEntity(EntityNPCMagasin.class, "magasin", 2, this, 20, 1, true);
  356.        
  357.         EntityRegistry.registerGlobalEntityID(EntityNPCPrefecture.class, "prefecture", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  358.         EntityRegistry.registerModEntity(EntityNPCPrefecture.class, "prefecture", 3, this, 20, 1, true);
  359.        
  360.         EntityRegistry.registerGlobalEntityID(EntityNPCDealer.class, "dealer", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  361.         EntityRegistry.registerModEntity(EntityNPCDealer.class, "dealer", 4, this, 20, 1, true);
  362.        
  363.         EntityRegistry.registerGlobalEntityID(EntityNPCGarage.class, "garage", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  364.         EntityRegistry.registerModEntity(EntityNPCGarage.class, "garage", 5, this, 20, 1, true);
  365.        
  366.         EntityRegistry.registerGlobalEntityID(EntityNPCArmurier.class, "armurier", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  367.         EntityRegistry.registerModEntity(EntityNPCArmurier.class, "armurier", 6, this, 20, 1, true);
  368.        
  369.         EntityRegistry.registerGlobalEntityID(EntityNPCArmurierPolice.class, "armurierpolice", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  370.         EntityRegistry.registerModEntity(EntityNPCArmurierPolice.class, "armurierpolice", 7, this, 20, 1, true);
  371.        
  372.         EntityRegistry.registerGlobalEntityID(EntityNPCTraitementCuivre.class, "traitementcuivre", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  373.         EntityRegistry.registerModEntity(EntityNPCTraitementCuivre.class, "traitementcuivre", 8, this, 20, 1, true);
  374.        
  375.         EntityRegistry.registerGlobalEntityID(EntityNPCTraitementFer.class, "traitementfer", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  376.         EntityRegistry.registerModEntity(EntityNPCTraitementFer.class, "traitementfer", 9, this, 20, 1, true);
  377.        
  378.         EntityRegistry.registerGlobalEntityID(EntityNPCTraitementDiamant.class, "traitementdiamant", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  379.         EntityRegistry.registerModEntity(EntityNPCTraitementDiamant.class, "traitementdiamant", 10, this, 20, 1, true);
  380.        
  381.         EntityRegistry.registerGlobalEntityID(EntityNPCTraitementCoca.class, "traitementcoca", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  382.         EntityRegistry.registerModEntity(EntityNPCTraitementCoca.class, "traitementcoca", 11, this, 20, 1, true);
  383.        
  384.         EntityRegistry.registerGlobalEntityID(EntityNPCTraitementCannabis.class, "traitementcannabis", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  385.         EntityRegistry.registerModEntity(EntityNPCTraitementCannabis.class, "traitementcannabis", 12, this, 20, 1, true);
  386.        
  387.         EntityRegistry.registerGlobalEntityID(EntityNPCBanquier.class, "banquier", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  388.         EntityRegistry.registerModEntity(EntityNPCBanquier.class, "banquier", 13, this, 20, 1, true);
  389.        
  390.         EntityRegistry.registerGlobalEntityID(EntityNPCConcessionnaireMedic.class, "concesmedic", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
  391.         EntityRegistry.registerModEntity(EntityNPCConcessionnaireMedic.class, "concesmedic", 14, this, 20, 1, true);
  392.        
  393.         proxy.registerRender();
  394.         GameRegistry.registerTileEntity(TileEntityATM.class, "lemnos:atm");
  395.        
  396.         try
  397.         {
  398.             url = "jdbc:mysql://adm.minecraft-mania.fr/a12014122813292385692366?useSSL=false";
  399.             username = "identifiant";
  400.             password = "mdp";
  401.             table = "playerData";
  402.            
  403.             Class.forName("com.mysql.jdbc.Driver");
  404.             Main.connection = DriverManager.getConnection(this.url, this.username, this.password);
  405.            
  406.             if(this.connection != null)
  407.             {
  408.                 System.out.println("######## MySQL connecté ########");
  409.                 System.out.println(this.connection);
  410.             }
  411.             else
  412.                 System.out.println("######## MySQL null ########");
  413.            
  414.         }
  415.         catch(Exception f)
  416.         {
  417.             f.printStackTrace();
  418.         }
  419.        
  420.         System.out.println("Initialisation Lemnos Life");
  421.     }
  422.        
  423.     @EventHandler
  424.     public void postInit(FMLPostInitializationEvent e) {
  425.         proxy.postInit(e);
  426.         System.out.println("Post-Initialisation Lemnos Life");
  427.     }
  428.    
  429.     @EventHandler
  430.     public void serverStarting(FMLServerStartingEvent event)
  431.     {
  432.         event.registerServerCommand(new CommandeMoney());
  433.         event.registerServerCommand(new CommandeGrade());
  434.         event.registerServerCommand(new CommandeNPC());
  435.     }
  436.    
  437.     //Catégorie du creative
  438.     public static CreativeTabs lemnosTab = new CreativeTabs("lemnosTab") {
  439.         @Override
  440.         public Item getTabIconItem() {
  441.             return new ItemStack(atm).getItem();
  442.         }
  443.     };
  444. }
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
 
Top