xch0w

Main

Feb 18th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 16.79 KB | None | 0 0
  1. package xchow;
  2.  
  3. import xchow.Handlers.Handler;
  4. import xchow.Proxy.Proxy;
  5. import io.netty.handler.codec.http.HttpHeaders.Values;
  6. import xchow.Handlers.*;
  7. import xchow.Item.*;
  8. import xchow.Potion.*;
  9. import xchow.Proxy.*;
  10. import xchow.Blocks.*;
  11. import xchow.Armor.*;
  12. import net.minecraft.block.Block;
  13. import net.minecraft.block.material.Material;
  14. import net.minecraft.creativetab.CreativeTabs;
  15. import net.minecraft.entity.EnumCreatureType;
  16. import net.minecraft.entity.passive.EntityVillager;
  17. import net.minecraft.init.Blocks;
  18. import net.minecraft.init.Items;
  19. import net.minecraft.item.Item;
  20. import net.minecraft.item.ItemArmor;
  21. import net.minecraft.item.ItemArmor.ArmorMaterial;
  22. import net.minecraft.item.ItemMultiTexture;
  23. import net.minecraft.item.ItemSeeds;
  24. import net.minecraft.item.ItemStack;
  25. import net.minecraft.potion.Potion;
  26. import net.minecraft.util.ResourceLocation;
  27. import net.minecraft.util.WeightedRandomChestContent;
  28. import net.minecraft.village.Village;
  29. import net.minecraftforge.client.event.sound.SoundSetupEvent;
  30. import net.minecraftforge.common.ChestGenHooks;
  31. import net.minecraftforge.common.DungeonHooks;
  32. import net.minecraftforge.common.ForgeHooks;
  33. import net.minecraftforge.common.MinecraftForge;
  34. import net.minecraftforge.common.config.Configuration;
  35. import net.minecraftforge.common.util.EnumHelper;
  36. import net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockMeta;
  37. import net.minecraftforge.oredict.OreDictionary;
  38. import net.minecraftforge.oredict.ShapedOreRecipe;
  39. import net.minecraftforge.oredict.ShapelessOreRecipe;
  40. import net.minecraft.world.biome.BiomeGenBase;
  41. import net.minecraft.world.gen.structure.StructureComponent;
  42. import cpw.mods.fml.common.FMLCommonHandler;
  43. import cpw.mods.fml.common.Mod;
  44. import cpw.mods.fml.common.Mod.EventHandler;
  45. import cpw.mods.fml.common.Mod.Instance;
  46. import cpw.mods.fml.common.SidedProxy;
  47. import cpw.mods.fml.common.event.FMLInitializationEvent;
  48. import cpw.mods.fml.common.event.FMLInterModComms;
  49. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  50. import cpw.mods.fml.common.event.FMLServerStartingEvent;
  51. import cpw.mods.fml.common.registry.EntityRegistry;
  52. import cpw.mods.fml.common.registry.GameRegistry;
  53. import cpw.mods.fml.common.registry.LanguageRegistry;
  54. import cpw.mods.fml.common.registry.VillagerRegistry;
  55. import cpw.mods.fml.relauncher.Side;
  56. import cpw.mods.fml.relauncher.SideOnly;
  57.  
  58. import com.flansmod.common.FlansMod;
  59.  
  60. @Mod(modid = "xchow", name = "Test", version = Main.VERSION)
  61. public class Main {
  62.  
  63.         //public static final String MODID = "xchow";
  64.         //public static final String MODNAME = "Infection Z";
  65.         public static final String VERSION = "1.0.0";
  66.    
  67.  
  68.    
  69.  
  70.    
  71.     @SidedProxy(clientSide = "xchow.Proxy.ClientProxy", serverSide = "xchow.Proxy.Proxy")
  72.     public static Proxy proxy;
  73.    
  74.  
  75.    
  76.     public static CreativeTabs tabInfection = new ZTab(CreativeTabs.getNextID(), "Zombie");
  77.    
  78.    
  79.     //Effects
  80.     public static Potion strongopiatePotion;
  81.     public static Potion overdosePotion;
  82.     //public static Potion nullPotion;
  83.     public static Potion antibacteriaPotion;
  84.    
  85.     //Items
  86.     public static Item painpill;
  87.     public static Item caffeine;
  88.     public static Item soda;
  89.     public static Item energydrink;
  90.     public static Item can;
  91.     public static Item penicillin;
  92.     public static Item Coin;
  93.     public static Item lighter;
  94.     public static Item creativetool;
  95.     public static Item syringe;
  96.     public static Item needle;
  97.     public static Item dirtysyringe;
  98.     public static Item milk;
  99.     public static Item morphinebottle;
  100.     public static Item morphineneedle;
  101.     public static Item ak47;
  102.    
  103.     //Armor static
  104.     public static Item bandithelmet;
  105.     public static Item banditvest;
  106.     public static Item banditpants;
  107.     public static Item banditboots;
  108.    
  109.     public static Item ghilliehelmet;
  110.     public static Item ghillievest;
  111.     public static Item ghilliepants;
  112.     public static Item ghillieboots;
  113.    
  114.     public static Item herohelmet;
  115.     public static Item herovest;
  116.     public static Item heropants;
  117.     public static Item heroboots;
  118.    
  119.     //Blocks
  120.     public static Block industrialloot;
  121.    
  122.     static ItemArmor.ArmorMaterial armorBandit = EnumHelper.addArmorMaterial("BANDIT", 20, new int[] { 1, 3, 3, 2 }, 20);
  123.    
  124.     public static int villagerDealerID = 8;
  125.    
  126.     Handler events = new Handler();
  127.  
  128.  
  129.     @EventHandler
  130.     public void preinit(FMLPreInitializationEvent event)
  131.     {
  132.     MinecraftForge.EVENT_BUS.register(new Handler());
  133.     MinecraftForge.EVENT_BUS.register(new DropHandler());
  134.        
  135.         FMLInterModComms.sendMessage("OpenBlocks", "donateUrl", "http://infinitewarfare.enjin.com/shop");
  136.    
  137.         proxy.initCapes();
  138.        
  139.         //metadata of the mod. Displays info about the mod in the mods section
  140.         event.getModMetadata().autogenerated = false;
  141.         event.getModMetadata().description = "Adds drugs into your game";
  142.         event.getModMetadata().authorList.add("XxCh0wxX");
  143.        
  144.         Configuration ZombieConfig = new Configuration(event.getSuggestedConfigurationFile());
  145.        
  146.         ZombieConfig.load();
  147.         ZombieConfig.save();
  148.    
  149.        
  150.         for (int i = 0; i < 5; ++i) {
  151.             VillagerRegistry.instance().registerVillageTradeHandler(i, new TradeHandler());}
  152.             VillagerRegistry.instance().registerVillagerId(8);
  153.             VillagerRegistry.instance().registerVillagerSkin(8, new ResourceLocation("xchow", "textures/dealer.png"));
  154.             VillagerRegistry.instance().registerVillageTradeHandler(8, new TradeHandler());
  155.             VillagerRegistry.instance().getRegisteredVillagers();
  156.            
  157.     }
  158.        
  159.        
  160.  
  161.     @EventHandler
  162.     public void init(FMLInitializationEvent event)
  163.     {
  164.  
  165.         FMLCommonHandler.instance().bus().register(new Handler());
  166.  
  167.        
  168.         antibacteriaPotion = (new EffectAntiBacteria(24));
  169.         LanguageRegistry.instance().addStringLocalization("potion.xchow.antibacteria", "Anti-Bacteria");
  170.      
  171.      /*EntityRegistry.addSpawn(EntityVillager.class, 2, 0, 0, EnumCreatureType.monster, BiomeGenBase.plains);
  172.      System.out.println("Villager Spawned"); */
  173.      
  174.      
  175.    
  176.      
  177.         //Blocks
  178.        
  179.        
  180.         //Registering Items
  181.         GameRegistry.registerItem(painpill, "DrugPainPill");
  182.         GameRegistry.registerItem(Coin, "ironCoin");
  183.         GameRegistry.registerItem(soda, "soda");
  184.         GameRegistry.registerItem(can, "Can");
  185.         GameRegistry.registerItem(energydrink, "energydrink");  
  186.         GameRegistry.registerItem(penicillin, "DrugPenicillin");
  187.         GameRegistry.registerItem(lighter, "lighter"); 
  188.         GameRegistry.registerItem(creativetool, "creativetool");
  189.         GameRegistry.registerItem(syringe, "syringe");
  190.         GameRegistry.registerItem(dirtysyringe, "dirtysyringe");
  191.         GameRegistry.registerItem(needle, "needle");
  192.         GameRegistry.registerItem(morphinebottle, "DrugMorphineBottle");
  193.         GameRegistry.registerItem(morphineneedle, "DrugMorphine");
  194.        
  195.         //Armor
  196.         GameRegistry.registerItem(herohelmet, "armorHeroHelmet");
  197.         GameRegistry.registerItem(herovest, "armorHeroVest");
  198.         GameRegistry.registerItem(heropants, "armorHeroPants");
  199.         GameRegistry.registerItem(heroboots, "armorHeroBoots");
  200.        
  201.         GameRegistry.registerItem(bandithelmet, "armorBanditHelmet");
  202.         GameRegistry.registerItem(banditvest, "armorBanditVest");
  203.         GameRegistry.registerItem(banditpants, "armorBanditPants");
  204.         GameRegistry.registerItem(banditboots, "armorBanditBoots");
  205.        
  206.         GameRegistry.registerItem(ghilliehelmet, "armorGhillieHelmet");
  207.         GameRegistry.registerItem(ghillievest, "armorGhillieVest");
  208.         GameRegistry.registerItem(ghilliepants, "armorGhilliePants");
  209.         GameRegistry.registerItem(ghillieboots, "armorGhillieBoots");
  210.        
  211.         GameRegistry.findItem(FlansMod.MODID, "ak47");
  212.         GameRegistry.registerBlock(industrialloot = new IndustrialSpawner("crate", Material.wood), "crate");
  213.        
  214.  
  215.         //ChestGen
  216.         ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH, new WeightedRandomChestContent(new ItemStack(morphinebottle), 1, 1, 1));
  217.        
  218.         //Seed Gen (Disabled
  219.         //MinecraftForge.addGrassSeed(new ItemStack(Main.Disabled), 1);
  220.          
  221.  
  222.        
  223.         //ore dictionary
  224.         addNames();
  225.         oreRegistration();
  226.         addOreRecipes();
  227. }
  228.  
  229. public static void addNames()
  230. {
  231. }
  232.  
  233. public static void oreRegistration() {
  234.     //Registering the ore dictionary names of certain items
  235.     OreDictionary.registerOre("coinIron", new ItemStack(Main.Coin));
  236.     OreDictionary.registerOre("drugPainPill", new ItemStack(Main.painpill));
  237.     OreDictionary.registerOre("drugOTC", new ItemStack(Main.painpill));
  238.     OreDictionary.registerOre("drugPenicillin", new ItemStack(Main.penicillin));
  239.     OreDictionary.registerOre("drugPrescription", new ItemStack(Main.penicillin));
  240.     OreDictionary.registerOre("drugMorphine", new ItemStack(Main.morphineneedle));
  241.     OreDictionary.registerOre("drugPrescription", new ItemStack(Main.morphineneedle));
  242.     OreDictionary.registerOre("drugPrescription", new ItemStack(Main.morphinebottle));
  243.     OreDictionary.registerOre("drugMorphineBottle", new ItemStack(Main.morphinebottle));
  244.     OreDictionary.registerOre("chest", new ItemStack(Blocks.chest));
  245.     OreDictionary.registerOre("coal", new ItemStack(Items.coal));
  246.     OreDictionary.registerOre("fuelCoal", new ItemStack(Items.coal));
  247.     OreDictionary.registerOre("syringe", new ItemStack(Main.syringe));
  248.  
  249.  
  250.  
  251.    
  252. }
  253.  
  254. public static void addOreRecipes()
  255. {
  256.     GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Main.morphineneedle, 1), new ItemStack(Main.morphinebottle.setContainerItem(Main.morphinebottle), 1, OreDictionary.WILDCARD_VALUE), "syringe"));
  257.     GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Main.soda, 1), new ItemStack(Items.sugar), new ItemStack(Items.sugar), new ItemStack(Main.can),"drugCaffeinePowder", new ItemStack(Items.water_bucket)));
  258.     GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Main.caffeine, 1), new ItemStack(Items.sugar), "dyeBrown"));
  259.     GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Main.energydrink, 1), new ItemStack(Items.sugar), new ItemStack(Items.sugar), new ItemStack(Main.can), "drugCaffeinePowder", "drugCaffeinePowder", new ItemStack(Items.water_bucket)));
  260.    
  261.    
  262.     GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Main.can, 3), new Object[]{
  263.      " A ",
  264.      "A A",
  265.      "AAA",
  266.      'A', "ingotIron"
  267.     }));
  268.    
  269.    
  270.     GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Main.Coin, 2), new Object[]{
  271.      " I ",
  272.      "I I",
  273.      " I ",
  274.      'I', "ingotIron"
  275.     }));
  276.    
  277.    
  278.     GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Main.lighter, 1), new Object[]{
  279.         " D ",
  280.         "ACA",
  281.         "ABA",
  282.         'A', "ingotIron",'B',"coal",'C',Items.flint_and_steel,'D',Items.string
  283.         }));
  284.    
  285.     GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Main.needle, 1), new Object[]{
  286.         "  A",
  287.         " A ",
  288.         "A  ",
  289.         'A',"ingotIron"
  290.         }));
  291.    
  292.     GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Main.syringe, 1), new Object[]{
  293.         "  A",
  294.         " B ",
  295.         "C  ",
  296.         'B', "paneGlass",'A',"ingotIron",'C',Main.needle
  297.         }));
  298.    
  299.    
  300.     }{
  301.        
  302.         //declaring items and blocks
  303.        
  304.        
  305.         //Items
  306.         Coin = new ItemClass(4200).setUnlocalizedName("currency").setTextureName("xchow:currency").setCreativeTab(CreativeTabs.tabMisc).setMaxStackSize(32);
  307.         caffeine = new ItemClass(4201).setUnlocalizedName("caffeine").setTextureName("xchow:caffeine").setCreativeTab(Main.tabInfection);
  308.         can = new ItemClass(4202).setUnlocalizedName("can").setTextureName("xchow:can").setCreativeTab(CreativeTabs.tabMisc);
  309.         lighter = new LighterItem(4203).setUnlocalizedName("lighter").setTextureName("xchow:lighter").setCreativeTab(CreativeTabs.tabTools);
  310.         creativetool = new ItemCreative(4204).setUnlocalizedName("creativetool").setTextureName("xchow:creativetool").setCreativeTab(Main.tabInfection);
  311.         syringe = new ItemClass(4205).setUnlocalizedName("syringe").setMaxStackSize(3).setTextureName("xchow:syringe").setCreativeTab(CreativeTabs.tabMisc);
  312.         dirtysyringe = new ItemClass(4206).setUnlocalizedName("dirtysyringe").setMaxStackSize(3).setTextureName("xchow:dirtysyringe").setCreativeTab(CreativeTabs.tabMisc);
  313.         needle = new ItemClass(4207).setUnlocalizedName("needle").setTextureName("xchow:needle").setCreativeTab(CreativeTabs.tabMisc);
  314.         soda = new SodaItem(0, 0.5F, false).setMaxStackSize(1).setUnlocalizedName("Soda").setTextureName("xchow:soda").setCreativeTab(CreativeTabs.tabFood);
  315.         energydrink = new EnergyDrinkItem(0, 0.3F, false).setMaxStackSize(1).setUnlocalizedName("EnergyDrink").setTextureName("xchow:energydrink").setCreativeTab(CreativeTabs.tabFood);
  316.         morphineneedle= new ItemMorphineNeedle(0, 0.0F, false).setUnlocalizedName("morphineneedle").setTextureName("xchow:morphineneedle").setCreativeTab(Main.tabInfection).setMaxStackSize(1);
  317.         penicillin= new PenicillinItem(0, 0.0F, false).setUnlocalizedName("penicillin").setTextureName("xchow:penicillin").setCreativeTab(Main.tabInfection);
  318.         painpill= new PainpillItem(0, 0.0F, false).setUnlocalizedName("painpill").setTextureName("xchow:painpill").setCreativeTab(Main.tabInfection);
  319.         morphinebottle= new ItemMorphineBottle(0, 0.0F, false).setUnlocalizedName("morphinebottle").setTextureName("xchow:morphinebottle").setCreativeTab(Main.tabInfection);
  320.        
  321.         //Armor    
  322.         bandithelmet = new banditarmor(4208, armorBandit, 0, 0).setUnlocalizedName("bandithelmet").setTextureName("xchow:bandithelmet").setCreativeTab(CreativeTabs.tabCombat);
  323.         banditvest = new banditarmor(4209, armorBandit, 0, 1).setUnlocalizedName("banditvest").setTextureName("xchow:banditvest").setCreativeTab(CreativeTabs.tabCombat);
  324.         banditpants = new banditarmor(4210, armorBandit, 0, 2).setUnlocalizedName("banditpants").setTextureName("xchow:banditpants").setCreativeTab(CreativeTabs.tabCombat);
  325.         banditboots = new banditarmor(4211, armorBandit, 0, 3).setUnlocalizedName("banditboots").setTextureName("xchow:banditboots").setCreativeTab(CreativeTabs.tabCombat);
  326.        
  327.         herohelmet = new heroarmor(4212, armorBandit, 0, 0).setUnlocalizedName("herohelmet").setTextureName("xchow:herohelmet").setCreativeTab(CreativeTabs.tabCombat);
  328.         herovest = new heroarmor(4213, armorBandit, 0, 1).setUnlocalizedName("herovest").setTextureName("xchow:herovest").setCreativeTab(CreativeTabs.tabCombat);
  329.         heropants = new heroarmor(4214, armorBandit, 0, 2).setUnlocalizedName("heropants").setTextureName("xchow:heropants").setCreativeTab(CreativeTabs.tabCombat);
  330.         heroboots = new heroarmor(4215, armorBandit, 0, 3).setUnlocalizedName("heroboots").setTextureName("xchow:heroboots").setCreativeTab(CreativeTabs.tabCombat);
  331.        
  332.         ghilliehelmet = new ghilliearmor(4216, armorBandit, 0, 0).setUnlocalizedName("ghilliehelmet").setTextureName("xchow:ghilliehelmet").setCreativeTab(CreativeTabs.tabCombat);
  333.         ghillievest = new ghilliearmor(4217, armorBandit, 0, 1).setUnlocalizedName("ghillievest").setTextureName("xchow:ghillievest").setCreativeTab(CreativeTabs.tabCombat);
  334.         ghilliepants = new ghilliearmor(4218, armorBandit, 0, 2).setUnlocalizedName("ghilliepants").setTextureName("xchow:ghilliepants").setCreativeTab(CreativeTabs.tabCombat);
  335.         ghillieboots = new ghilliearmor(4219, armorBandit, 0, 3).setUnlocalizedName("ghillieboots").setTextureName("xchow:ghillieboots").setCreativeTab(CreativeTabs.tabCombat);
  336.    
  337.         //Language Registry
  338.         //Note: Need to move to language files.
  339.        
  340.         //Blocks
  341.        
  342.        
  343.         //Items
  344.         LanguageRegistry.addName(painpill, "Acetaminophen Pill 250mg");
  345.         LanguageRegistry.addName(Coin, "Iron Coin");
  346.         LanguageRegistry.addName(caffeine, "Caffeine Powder");
  347.         LanguageRegistry.addName(soda, "Soda");
  348.         LanguageRegistry.addName(can, "Empty Can");
  349.         LanguageRegistry.addName(energydrink, "Energy Drink");
  350.         LanguageRegistry.addName(penicillin, "Penicillin Pill 75mg");
  351.         LanguageRegistry.addName(lighter, "Lighter");    
  352.         LanguageRegistry.addName(creativetool, "Creative Tool");
  353.         LanguageRegistry.addName(syringe, "Empty Syringe");
  354.         LanguageRegistry.addName(needle, "Needle");
  355.         LanguageRegistry.addName(dirtysyringe, "Dirty Syringe");
  356.         LanguageRegistry.addName(morphineneedle, "Morphine Bottle");
  357.        
  358.         //Armor
  359.         LanguageRegistry.addName(bandithelmet, "Bandit Helmet");
  360.         LanguageRegistry.addName(banditvest, "Bandit Vest");
  361.         LanguageRegistry.addName(banditpants, "Bandit Pants");
  362.         LanguageRegistry.addName(banditboots, "Bandit Boots");
  363.            
  364.  
  365.        
  366.         //smelting
  367.         GameRegistry.addSmelting(new ItemStack(Main.dirtysyringe), new ItemStack(Main.syringe), 0.0F);
  368.         GameRegistry.addSmelting(new ItemStack(Main.Coin), new ItemStack(Items.iron_ingot), 0.0F);
  369.        
  370.        
  371.        
  372.     }{
  373.    
  374.     }
  375.    
  376.    
  377.    
  378. }
Advertisement
Add Comment
Please, Sign In to add comment