Advertisement
Guest User

Base

a guest
Jul 19th, 2014
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 36.35 KB | None | 0 0
  1. package sometimesHardcoreSometimes;
  2.  
  3. import org.lwjgl.input.Keyboard;
  4.  
  5. import net.minecraft.block.Block;
  6. import net.minecraft.client.settings.KeyBinding;
  7. import net.minecraft.creativetab.CreativeTabs;
  8. import net.minecraft.entity.EnumCreatureType;
  9. import net.minecraft.item.EnumToolMaterial;
  10. import net.minecraft.item.Item;
  11. import net.minecraft.item.ItemFood;
  12. import net.minecraft.item.ItemStack;
  13. import net.minecraft.potion.Potion;
  14. import net.minecraft.world.biome.BiomeGenBase;
  15. import net.minecraftforge.common.Configuration;
  16. import net.minecraftforge.common.MinecraftForge;
  17. import cpw.mods.fml.common.Mod;
  18. import cpw.mods.fml.common.Mod.EventHandler;
  19. import cpw.mods.fml.common.Mod.Instance;
  20. import cpw.mods.fml.common.SidedProxy;
  21. import cpw.mods.fml.common.event.FMLInitializationEvent;
  22. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  23. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  24. import cpw.mods.fml.common.network.NetworkMod;
  25. import cpw.mods.fml.common.registry.EntityRegistry;
  26. import cpw.mods.fml.common.registry.GameRegistry;
  27. import cpw.mods.fml.common.registry.LanguageRegistry;
  28.  
  29. /* _=-*CURRENT MOD NAME*-=_
  30.  *
  31.  * "The" Botany Mod
  32.  *
  33.  */
  34.  
  35. /** -- CHANGELOG -- **\
  36.  * -implementation of Base, CommonProxy, and ClientProxy classes
  37.  * -ground work done
  38.  * -added changelog :D
  39.  * -added custom creative tab "Sometimes Tab"
  40.  * -began documentation
  41.  * -created default config. file skeleton
  42.  * -added methods:
  43.  *      PreInit - for config files and such in the future
  44.  *      Load - where all blocks, items, etc are loaded into game
  45.  *      PostInit - not sure why...internet told me to!
  46.  *      LangReg - used for language registry
  47.  *      GameReg - used for game registry
  48.  *      CreativeTabs - for creative tab icon
  49.  *
  50.  * Date:    14 March 2014
  51.  * Version: 0.0.0
  52.  * ---------------------------------------------------------------
  53.  * -added @NetWorkMod for more integration
  54.  * -added modid String for easier texture calling
  55.  *      -registry's changed to handle modid implementation
  56.  * -folders added for Block and Item textures
  57.  * -block init's moved to PreInit for optimization
  58.  * -GamReg added for ore generation
  59.  * -EventManager object class implemented for ore generation
  60.  * -Blocks Added:
  61.  *      Lava Infused Stone - 1000
  62.  * -Items Added:
  63.  *      Obsidian Fleck - 5000
  64.  *
  65.  * Date:    15 March 2014
  66.  * Version: 0.0.1
  67.  * ---------------------------------------------------------------
  68.  * -Lava Infused Obsidian:
  69.  *      added smoke particle effects
  70.  *      added bounding box for damage on collision
  71.  *          sets fire and deals damage to !EntityItem
  72.  *
  73.  * Date:    16 March 2014
  74.  * Version: 0.0.2
  75.  * ---------------------------------------------------------------
  76.  * -Blocks Added:
  77.  *      Solid Matter - 1001
  78.  *          Going to be used for portal block
  79.  *
  80.  * Date:    17 March 2014
  81.  * Version: 0.0.3
  82.  * ---------------------------------------------------------------
  83.  * -Handlers for vanilla mob drop changes added *See 'DropHandlersInit' class
  84.  * -Items Added:
  85.  *      zombie arm - 5001
  86.  *      cow utter - 5002
  87.  *      creeper mouth - 5003
  88.  *      pig snout - 5004
  89.  *      sheep leg - 5005
  90.  *      skeleton ribcage - 5006
  91.  *
  92.  * Date:    19 March 2014
  93.  * Version: 0.0.4
  94.  * ---------------------------------------------------------------
  95.  * -6 classes added
  96.  * -Entities Added:
  97.  *      -grean baen!
  98.  *      -Fungle Crab!
  99.  *
  100.  * Date:    20 March 2014
  101.  * Version: 0.0.5
  102.  * ---------------------------------------------------------------
  103.  *- ~30 items added:
  104.  *      BASE ITEMS --
  105.  *          Tool Binding, Rune , Rune Part
  106.  *          3 sub       , 9 sub, 24 sub
  107.  * **NOTE**
  108.  *    No textures added as of yet, code finished for simple
  109.  * items, tool ideas + recipes in development.
  110.  *
  111.  * Date:    24 March 2014
  112.  * Version: 0.0.6
  113.  * ---------------------------------------------------------------
  114.  * Classes created:
  115.  *  BlockPhotosynthesizer --NOT IN USE--
  116.  *  ContainerPhotosynthesizer --NOT IN USE--
  117.  *  HandlerGuiPhotosynthesizer --NOT IN USE--
  118.  *  PhotosynthesizerRecipes --NOT IN USE--
  119.  *  SlotPhotosynthesizer --NOT IN USE--
  120.  *  TileEntityPhotosynthesizer --NOT IN USE--
  121.  *
  122.  * Textures added for:
  123.  *  Rune Handle
  124.  *  Rune Pick
  125.  *  Rune Axe
  126.  *  Rune Shovel
  127.  *  Rune Sword
  128.  *  Rune Hoe
  129.  *  Rune Quickaxe
  130.  *
  131.  * Date:    26 March 2014
  132.  * Version: 0.0.7
  133.  * ---------------------------------------------------------------
  134.  * Texutres added for:
  135.  *  All runic tool parts
  136.  *  Rune Skinning Knife
  137.  *  Rune Notched Blade
  138.  *  Runic Ore
  139.  *  Bindings
  140.  *
  141.  * Entity added:
  142.  *  Barbed Spike
  143.  *      Entity class,
  144.  *      Model class,
  145.  *      Render class.
  146.  *  Arrow Fish
  147.  *      Entity class,
  148.  *      Model class,
  149.  *      Render class.
  150.  *
  151.  * --Major updates on items. All mob drops changed to same id with meta data.
  152.  * Items Added:
  153.  *  itemMatter - Decomposing, Gelatinous, and Protein Ball metas
  154.  *  itemIncediarySlimeball
  155.  *
  156.  * Crafting Recipes
  157.  * Crafting Handler class added for damage to axes during crafting handles.
  158.  *
  159.  * Date:    27 March 2014
  160.  * Version: 0.0.8
  161.  * ---------------------------------------------------------------
  162.  * Blocks added:
  163.  *  vile mushroom
  164.  *  gem root parts
  165.  *
  166.  * Date:    28 March 2014
  167.  * Version: 0.0.9
  168.  * ---------------------------------------------------------------
  169.  *
  170.  *  -=-WORK-IN-PROGRESS CODE REMOVED-=-
  171.  *
  172.  * Items added:
  173.  * Plant Greens
  174.  *  -Part of mob parts, used in crafting of compost, missing texture
  175.  *  -Dropped from plant mobs
  176.  * Compost
  177.  *  -Works like a 5 use bonemeal, missing texure
  178.  *
  179.  * Date:    16 June 2014
  180.  * Version: 0.0.10
  181.  * ---------------------------------------------------------------
  182.  * Altered Barbed Spike mob
  183.  *  -Given no movement speed
  184.  *  -Now extends EntityMob rather than EntityAnimal
  185.  *  -Burns in daylight (does NOT drop greens if death occurs from burning)
  186.  *  -Given knockback
  187.  * ObsidianFleck
  188.  *  -Given a rendered "thrown" texture
  189.  *  -On impact, spawns "explode" particles
  190.  * ItemMobSpawnEgg
  191.  *  -Added, not implemented
  192.  *  -Missing Texture
  193.  *  -Incomplete
  194.  *
  195.  * Date:    17 June 2014
  196.  * Version: 0.0.11
  197.  * ---------------------------------------------------------------
  198.  * Items Added:
  199.  * Sapphire Berry
  200.  *  -Throw-able berry dropped from Sapphire Lawncher and sheared from Sapphire Crops
  201.  *  -Oh gosh...it knocks monsters up in the air and deals damage (no damage to enderman so they don't tele),
  202.  *      heals players hit, knocks ghasts down and deals damage, and else spawns a barbed spike riding a pig (lols)
  203.  * Blocks Added:
  204.  * Sapphire Crop
  205.  *  -Given bounding box, Tile Entity file; still missing textures + model
  206.  *  -Not implemented yet, needs model
  207.  *  -Will be shearable for Sapphire Berries (seven times, then must re-grow)
  208.  *      =NOTE= Will act like melon stem; once sheared, will slowly re-grow (change texture) over time
  209.  *  -NEEDS -- Model, Textures, Funtionality with shears, and finally Implementation.
  210.  *
  211.  * Date:    18 June 2014
  212.  * Version: 0.1.0
  213.  * ---------------------------------------------------------------
  214.  * BlockSapphireCrop - Given partial functionality, shearing drop a sapphire berry.
  215.  *      -Given a directional placement
  216.  *      -=-NOTE-=-
  217.  *          -Shears do NOT take durability damage
  218.  *          -Texture and amount of block and berries given no funcitonality
  219.  *              -Texture always has 7 berries
  220.  *              -Allowed to shear as much as you want
  221.  *
  222.  * Date:    20 June 2014
  223.  * Version: 0.1.1
  224.  * ---------------------------------------------------------------
  225.  * Added a TileEntityReg(); function to support tile entity texture mapping
  226.  *
  227.  * Date:    21 June 2014
  228.  * Version: 0.1.2
  229.  * ---------------------------------------------------------------
  230.  */
  231.  
  232. @Mod(modid = Base.modid, name = "sometimes", version = "0.1.2")
  233. @NetworkMod(clientSideRequired = true, serverSideRequired = false,
  234.             channels={"sometimes"}, packetHandler = PacketHandler.class)
  235. public class Base
  236. {
  237.     @Instance(value = "sometimes_hardcore")
  238.     public static Base instance;
  239.     public static final String modid = "sometimes_hardcore";
  240.    
  241.     @SidedProxy(clientSide = "sometimesHardcoreSometimes.ClientProxy",
  242.                 serverSide = "sometimesHardcoreSometimes.CommonProxy")
  243.     public static CommonProxy proxy;
  244.    
  245.     //Used for ore generation
  246.     EventManager eventManager = new EventManager();
  247.    
  248.     //Biomes
  249.     public static BiomeGenBase blight;
  250.    
  251.     /** Block & Block ID Declarations **/
  252.     public static Block blockLavaInfusedStone;
  253.     public static int blockLavaInfusedStoneID;
  254.    
  255.     public static Block blockMatter;
  256.     public static int blockMatterID;
  257.    
  258.     public static Block blockRunicOre;
  259.     public static int blockRunicOreID;
  260.    
  261.     public static Block blockFungleDirt;
  262.     public static int blockFungleDirtID;
  263.    
  264.     public static Block blockFungleGrass;
  265.     public static int blockFungleGrassID;
  266.    
  267.     public static Block blockInfectedLeaf;
  268.     public static int blockInfectedLeafID;
  269.    
  270.     public static Block blockInfectedLog;
  271.     public static int blockInfectedLogID;
  272.    
  273.     public static Block blockInfectedSapling;
  274.     public static int blockInfectedSaplingID;
  275.    
  276.     public static Block blockVileMushroom;
  277.     public static int blockVileMushroomID;
  278.    
  279.     public static Block blockBlueMushroom;
  280.     public static int blockBlueMushroomID;
  281.    
  282.     public static Block blockBlueMushroomStem;
  283.     public static int blockBlueMushroomStemID;
  284.    
  285.     public static Block blockRottenPlanks;
  286.     public static int blockRottenPlanksID;
  287.    
  288.     public static Block blockMushroomGiant;
  289.     public static int blockMushroomGiantID;
  290.    
  291.     public static Block blockPhotoStick;
  292.     public static int blockPhotoStickID;
  293.    
  294.     public static Block blockSapphireCrop;
  295.     public static int blockSapphireCropID;
  296.    
  297.     public static Block blockPowerBulb;
  298.     public static int blockPowerBulbID;
  299.    
  300.     public static Block blockCropStaff;
  301.     public static int blockCropStaffID;
  302.    
  303.     public static Block blockPedestal;
  304.     public static int blockPedestalID;
  305.    
  306.     public static Block blockGemRoot;
  307.     public static int blockGemRootID;
  308.    
  309.     public static Block blockShroomWood;
  310.     public static int blockShroomWoodID;
  311.    
  312.     public static Block blockSalvagedPlanks;
  313.     public static int blockSalvagedPlanksID;
  314.    
  315.     public static Block blockGemGlass;
  316.     public static int blockGemGlassID;
  317.    
  318.     /** Item & Item ID Declarations **/
  319.     public static Item itemObsidianFleck;
  320.     public static int itemObsidianFleckID;
  321.    
  322.     public static Item itemMobPart;
  323.     public static int itemMobPartID;
  324.    
  325.     public static Item itemToolBinding;
  326.     public static int itemToolBindingID;
  327.    
  328.     public static Item itemRune;
  329.     public static int itemRuneID;
  330.    
  331.     public static Item itemRunePart;
  332.     public static int itemRunePartID;
  333.    
  334.     public static Item itemMatter;
  335.     public static int itemMatterID;
  336.    
  337.     public static Item itemIncendiarySlimeball;
  338.     public static int itemIncendiarySlimeballID;
  339.    
  340.     public static Item itemCarbonFiberBow;
  341.     public static int itemCarbonFiberBowID;
  342.    
  343.     public static Item itemArrow;
  344.     public static int itemArrowID;
  345.    
  346.     public static Item itemDiamondQuickPick;
  347.     public static Item itemGoldQuickPick;
  348.     public static Item itemIronQuickPick;
  349.     public static int itemDiamondQuickPickID;
  350.     public static int itemGoldQuickPickID;
  351.     public static int itemIronQuickPickID;
  352.    
  353.     public static Item itemBioBottle;
  354.     public static int itemBioBottleID;
  355.    
  356.     public static Item itemBioBottleCooked;
  357.     public static int itemBioBottleCookedID;
  358.    
  359.     public static Item itemCompost;
  360.     public static int itemCompostID;
  361.    
  362.     public static Item itemMobSpawnEgg;
  363.     public static int itemMobSpawnEggID;
  364.    
  365.     public static Item itemSapphireBerry;
  366.     public static int itemSapphireBerryID;
  367.    
  368.     public static Item itemThornedBranch;
  369.     public static int itemThornedBranchID;
  370.    
  371.     public static Item itemStoneCrown;
  372.     public static int itemStoneCrownID;
  373.  
  374.     public static Item itemCrabMorsel;
  375.     public static int itemCrabMorselID;
  376.    
  377.     public static Item itemCookedCrabMorsel;
  378.     public static int itemCookedCrabMorselID;
  379.    
  380.     public static Item itemVileFlesh;
  381.     public static int itemVileFleshID;
  382.    
  383.     public static Item itemCleansingPowder;
  384.     public static int itemCleansingPowderID;
  385.    
  386.     @EventHandler
  387.     public void PreInit(FMLPreInitializationEvent event)
  388.     {
  389.         //Creation and loading of default config file
  390.         Configuration config = new Configuration(event.getSuggestedConfigurationFile());
  391.         config.load();
  392.        
  393.         /* example config file
  394.          * ------------------------------
  395.          * Block - someBlockID = config.getBlock("someBlockID", ###).getInt();
  396.          * Item  - someItemID = config.getItem("someItemID", ###).getInt();
  397.          *
  398.          * Such that:
  399.          *  some[]ID : Block/Items declaration name
  400.          *  "some[]ID" : Name that shows up in generated config file
  401.          *  ### : The default value of said declaration
  402.          * ------------------------------
  403.          * Note: May also inclue other values users may with to change i.e.:
  404.          *      -Drop rates
  405.          *      -Booleans
  406.          */
  407.        
  408.         //Block IDs
  409.         blockFungleDirtID = config.getBlock("blockFungleDirt", 250).getInt();
  410.         blockFungleGrassID = config.getBlock("blockFungleGrass", 251).getInt();
  411.         blockLavaInfusedStoneID = config.getBlock("blockLavaInfusedStone", 1000).getInt();
  412.         blockMatterID = config.getBlock("blockMatter", 1001).getInt();
  413.         blockRunicOreID = config.getBlock("blockRunicOre", 1002).getInt();
  414.         blockInfectedLeafID = config.getBlock("blockInfectedLeaf", 1005).getInt();
  415.         blockInfectedLogID = config.getBlock("blockInfectedLog", 1006).getInt();
  416.         blockInfectedSaplingID = config.getBlock("blockInfectedSapling", 1007).getInt();
  417.         blockVileMushroomID = config.getBlock("blockVileMushroom", 1009).getInt();
  418.         blockBlueMushroomID = config.getBlock("blockBlueMushroom", 1010).getInt();
  419.         blockBlueMushroomStemID = config.getBlock("blockBlueMushroomStem", 1011).getInt();
  420.         blockRottenPlanksID = config.getBlock("blockRottenPlanks", 1012).getInt();
  421.         blockMushroomGiantID = config.getBlock("blockMushroomGiant", 1013).getInt();
  422.         blockPhotoStickID = config.getBlock("blockPhotoStick", 1014).getInt();
  423.         blockSapphireCropID = config.getBlock("blockSapphireCrop", 1015).getInt();
  424.         blockPowerBulbID = config.getBlock("blockPowerBulb", 1016).getInt();
  425.         blockCropStaffID = config.getBlock("blockCropStaff", 1017).getInt();
  426.         blockPedestalID = config.getBlock("blockPedestal", 1018).getInt();
  427.         blockGemRootID = config.getBlock("blockGemRoot", 1019).getInt();
  428.         blockShroomWoodID = config.getBlock("blockShroomWood", 1020).getInt();
  429.         blockSalvagedPlanksID = config.getBlock("blockSalvagedPlanks", 1021).getInt();
  430.         blockGemGlassID = config.getBlock("blockGemGlass", 1022).getInt();
  431.        
  432.         //Item IDs
  433.         itemObsidianFleckID = config.getItem("itemObisidianFleck", 5000).getInt();
  434.         itemMobPartID = config.getItem("itemMobPart", 5001).getInt();
  435.         itemToolBindingID = config.getItem("itemToolBinding", 5002).getInt();
  436.         itemRuneID = config.getItem("itemRune", 5003).getInt();
  437.         itemRunePartID = config.getItem("itemRunePart", 5004).getInt();
  438.         itemMatterID = config.getItem("itemMatter", 5005).getInt();
  439.         itemIncendiarySlimeballID = config.getItem("itemIncendiarySlimeball", 5006).getInt();
  440.         itemCarbonFiberBowID = config.getItem("itemCarbonFiberBow", 5007).getInt();
  441.         itemArrowID = config.getItem("itemArrow", 5008).getInt();
  442.         itemDiamondQuickPickID = config.getItem("itemDiamondQuickPick", 5009).getInt();
  443.         itemGoldQuickPickID = config.getItem("itemGoldQuickPick", 5010).getInt();
  444.         itemIronQuickPickID = config.getItem("itemIronQuickPick", 5011).getInt();
  445.         itemBioBottleID = config.getItem("itemBioBottle", 5012).getInt();
  446.         itemBioBottleCookedID = config.getItem("itemBioBottleCooked", 5013).getInt();
  447.         itemCompostID = config.getItem("itemCompost", 5014).getInt();
  448.         itemMobSpawnEggID = config.getItem("itemMobSpawnEgg", 5015).getInt();
  449.         itemSapphireBerryID = config.getItem("itemSapphireBerry", 5016).getInt();
  450.         itemThornedBranchID = config.getItem("itemThornedBranch", 5017).getInt();
  451.         itemStoneCrownID = config.getItem("itemStoneCrown", 5018).getInt();
  452.         itemCrabMorselID = config.getItem("itemCrabMorsel", 5019).getInt();
  453.         itemCookedCrabMorselID = config.getItem("itemCookedCrabMorsel", 5020).getInt();
  454.         itemVileFleshID = config.getItem("itemVileFlesh", 5021).getInt();
  455.         itemCleansingPowderID = config.getItem("itemCleansingPowder", 5022).getInt();
  456.        
  457.         //Drop Handlers -- Has boolean drops AND chances -- CHANGED FROM 'DropHandlersInit' CLASS! (given defaults)
  458.         DropHandlersInit.zombieArmDrop = config.get(Configuration.CATEGORY_GENERAL, "zombieArmDrop", DropHandlersInit.zombieArmDrop).getBoolean(DropHandlersInit.zombieArmDrop);
  459.         DropHandlersInit.zombieArm_CHANCE = config.get(Configuration.CATEGORY_GENERAL, "zombieArmChance", DropHandlersInit.zombieArm_CHANCE).getDouble(DropHandlersInit.zombieArm_CHANCE);
  460.        
  461.         DropHandlersInit.cowUtterDrop = config.get(Configuration.CATEGORY_GENERAL, "cowUtterDrop", DropHandlersInit.cowUtterDrop).getBoolean(DropHandlersInit.cowUtterDrop);
  462.         DropHandlersInit.cowUtter_CHANCE = config.get(Configuration.CATEGORY_GENERAL, "cowUtterChance", DropHandlersInit.cowUtter_CHANCE).getDouble(DropHandlersInit.cowUtter_CHANCE);
  463.        
  464.         DropHandlersInit.creeperMouthDrop = config.get(Configuration.CATEGORY_GENERAL, "creeperMouthDrop", DropHandlersInit.creeperMouthDrop).getBoolean(DropHandlersInit.creeperMouthDrop);
  465.         DropHandlersInit.creeperMouth_CHANCE = config.get(Configuration.CATEGORY_GENERAL, "creeperMouthChance", DropHandlersInit.creeperMouth_CHANCE).getDouble(DropHandlersInit.creeperMouth_CHANCE);
  466.        
  467.         DropHandlersInit.pigSnoutDrop = config.get(Configuration.CATEGORY_GENERAL, "pigSnoutDrop", DropHandlersInit.pigSnoutDrop).getBoolean(DropHandlersInit.pigSnoutDrop);
  468.         DropHandlersInit.pigSnout_CHANCE = config.get(Configuration.CATEGORY_GENERAL, "pigSnoutChance", DropHandlersInit.pigSnout_CHANCE).getDouble(DropHandlersInit.pigSnout_CHANCE);
  469.        
  470.         DropHandlersInit.sheepLegDrop = config.get(Configuration.CATEGORY_GENERAL, "sheepLegDrop", DropHandlersInit.sheepLegDrop).getBoolean(DropHandlersInit.sheepLegDrop);
  471.         DropHandlersInit.sheepLeg_CHANCE = config.get(Configuration.CATEGORY_GENERAL, "sheepLegChance", DropHandlersInit.sheepLeg_CHANCE).getDouble(DropHandlersInit.sheepLeg_CHANCE);
  472.        
  473.         DropHandlersInit.skeletonRibcageDrop = config.get(Configuration.CATEGORY_GENERAL, "skeletonRibcageDrop", DropHandlersInit.skeletonRibcageDrop).getBoolean(DropHandlersInit.skeletonRibcageDrop);
  474.         DropHandlersInit.skeletonRibcage_CHANCE = config.get(Configuration.CATEGORY_GENERAL, "skeletonRibcageChance", DropHandlersInit.skeletonRibcage_CHANCE).getDouble(DropHandlersInit.skeletonRibcage_CHANCE);
  475.        
  476. //      DropHandlersInit.runicItemsDrop = config.get(Configuration.CATEGORY_GENERAL, "itemRuneDrop", DropHandlersInit.runicItemsDrop).getBoolean(DropHandlersInit.runicItemsDrop);
  477. //      DropHandlersInit.runicItem_CHANCE = config.get(Configuration.CATEGORY_GENERAL, "itemRuneChance", DropHandlersInit.runicItem_CHANCE).getDouble(DropHandlersInit.runicItem_CHANCE);
  478.        
  479.         //Saves config.
  480.         config.save();
  481.        
  482.         //---------------------- END OF CONFIGURATION FILE ----------------------//
  483.        
  484.         /** Block Init. **/
  485.         blockLavaInfusedStone = new BlockLavaInfusedStone(blockLavaInfusedStoneID);
  486.         blockMatter = new BlockMatter(blockMatterID);
  487.         blockRunicOre = new BlockRunicOre(blockRunicOreID);
  488.         blockFungleDirt = new BlockFungleDirt(blockFungleDirtID);
  489.         blockFungleGrass = new BlockFungleGrass(blockFungleGrassID);
  490.         blockInfectedLeaf = new BlockInfectedLeaf(blockInfectedLeafID);
  491.         blockInfectedLog = new BlockInfectedLog(blockInfectedLogID);
  492.         blockInfectedSapling = new BlockInfectedSapling(blockInfectedSaplingID);
  493.         blockVileMushroom = new BlockVileMushroom(blockVileMushroomID);
  494.         blockBlueMushroom = new BlockBlueMushroom(blockBlueMushroomID);
  495.         blockBlueMushroomStem = new BlockBlueMushroomStem(blockBlueMushroomStemID);
  496.         blockRottenPlanks = new BlockRottenPlanks(blockRottenPlanksID);
  497.         blockMushroomGiant = new BlockMushroomGiant(blockMushroomGiantID);
  498.         blockPhotoStick = new BlockPhotoStick(blockPhotoStickID);
  499.         blockSapphireCrop = new BlockSapphireCrop(blockSapphireCropID);
  500.         blockPowerBulb = new BlockPowerBulb(blockPowerBulbID);
  501.         blockCropStaff = new BlockCropStaff(blockCropStaffID);
  502.         blockPedestal = new BlockPedestal(blockPedestalID);
  503.         blockGemRoot = new BlockGemRoot(blockGemRootID);
  504.         blockShroomWood = new BlockShroomWood(blockShroomWoodID);
  505.         blockSalvagedPlanks = new BlockSalvagedPlanks(blockSalvagedPlanksID);
  506.         blockGemGlass = new BlockGemGlass(blockGemGlassID);
  507.        
  508.         /** Item Init. **/
  509.         itemObsidianFleck = new ItemObsidianFleck(itemObsidianFleckID);
  510.         itemMobPart = new ItemMobPart(itemMobPartID);
  511.         itemToolBinding = new ItemToolBinding(itemToolBindingID);
  512.         itemRune = new ItemRune(itemRuneID);
  513.         itemRunePart = new ItemRunePart(itemRunePartID);
  514.         itemMatter = new ItemMatter(itemMatterID);
  515.         itemIncendiarySlimeball = new ItemIncendiarySlimeball(itemIncendiarySlimeballID);
  516.         itemCarbonFiberBow = new ItemCarbonFiberBow(itemCarbonFiberBowID);
  517.         itemArrow = new ItemArrow(itemArrowID);
  518. //      itemDiamondQuickPick = new ItemQuickPick(itemDiamondQuickPickID, EnumRune.DIAMOND_QUICK, 0, "diamond");
  519. //      itemGoldQuickPick = new ItemQuickPick(itemGoldQuickPickID, EnumRune.GOLD_QUICK, 0, "gold");
  520. //      itemIronQuickPick = new ItemQuickPick(itemIronQuickPickID, EnumRune.IRON_QUICK, 0, "iron");
  521.         itemBioBottle = new ItemBioBottle(itemBioBottleID);
  522.         itemBioBottleCooked = new ItemBioBottleCooked(itemBioBottleCookedID);
  523.         itemCompost = new ItemCompost(itemCompostID);
  524.         itemMobSpawnEgg = new ItemMobSpawnEgg(itemMobSpawnEggID);
  525.         itemSapphireBerry = new ItemSapphireBerry(itemSapphireBerryID);
  526.         itemThornedBranch = new ItemThornedBranch(itemThornedBranchID);
  527.         itemStoneCrown = new ItemStoneCrown(itemStoneCrownID);
  528.         itemCrabMorsel = new ItemCrabMorsel(itemCrabMorselID, 2, 0.3F, false);
  529.         itemCookedCrabMorsel = new ItemCookedCrabMorsel(itemCookedCrabMorselID, 6, 0.7F, false);
  530.         itemVileFlesh = new ItemVileFlesh(itemVileFleshID);
  531.         itemCleansingPowder = new ItemCleansingPowder(itemCleansingPowderID);
  532.        
  533.         //Biomes
  534.         blight = new BiomeGenBlight(50);
  535.     }
  536.    
  537.     @EventHandler
  538.     public void Load(FMLInitializationEvent load)
  539.     {  
  540.         //Proxy Calls to Renderers and Sounds
  541.         proxy.registerRenderers();
  542.         proxy.registerSound();
  543.        
  544.         //Event Handlers
  545.         DropHandlersInit.init(); //Vanilla Mob Drops
  546.         MobDrops(); //Our Mob Drops
  547.         MinecraftForge.EVENT_BUS.register(new EventBonemealClass());
  548.        
  549.         //Call to crafting and smelting recipes
  550.         Crafting.addRecipes();
  551.        
  552.         //Call to registry's
  553.         LangReg();//Language
  554.         GameReg();//Game
  555.         EntityReg();//Entity
  556.         TileEntityReg();//Tile Entities
  557.     }
  558.    
  559.     @EventHandler
  560.     public void PostInit(FMLPostInitializationEvent event) {}
  561.    
  562.      // -- Language Registry -- \\
  563.     // -For naming items, blocks, etc.
  564.     public void LangReg()
  565.     {
  566.         //Creative Tabs
  567.         LanguageRegistry.instance().addStringLocalization("itemGroup.tabSometimes", "en_US", "Sometimes Hardcore");
  568.        
  569.         //Blocks\\ LanguageRegistry.addName(block, ""); <-- SKELETON
  570.         LanguageRegistry.addName(blockLavaInfusedStone, "Lava Infused Stone");
  571.         LanguageRegistry.addName(blockMatter, "Solid Matter");
  572.         LanguageRegistry.addName(blockRunicOre, "Runic Ore");
  573.         LanguageRegistry.addName(blockFungleDirt, "Fungle Soil");
  574.         LanguageRegistry.addName(blockFungleGrass, "Fungle Grass");
  575.         LanguageRegistry.addName(blockInfectedLeaf, "Infected Leaf");
  576.         LanguageRegistry.addName(blockInfectedLog, "Infected Log");
  577.         LanguageRegistry.addName(blockInfectedSapling, "Infected Sapling");
  578.         LanguageRegistry.addName(blockVileMushroom, "Vile Mushroom");
  579.         LanguageRegistry.addName(blockBlueMushroom, "Blue Mushroom Cap");
  580.         LanguageRegistry.addName(blockBlueMushroomStem, "Blue Mushroom Stem");
  581.         LanguageRegistry.addName(blockRottenPlanks, "Rotten Planks");
  582.         LanguageRegistry.addName(blockMushroomGiant, "Giant Mushroom");
  583.         LanguageRegistry.addName(blockPhotoStick, "Stick o' Might");
  584.         LanguageRegistry.addName(blockSapphireCrop, "Sapphire Crop");
  585.         LanguageRegistry.addName(blockPowerBulb, "Bulb Of Power");
  586.         LanguageRegistry.addName(blockCropStaff, "Cropular Staff");
  587.         LanguageRegistry.addName(blockPedestal, "Growth Pedestal");
  588.         LanguageRegistry.addName(blockGemRoot, "Gem Root");
  589.         LanguageRegistry.addName(blockShroomWood, "Shroom Wood");
  590.         LanguageRegistry.addName(blockSalvagedPlanks, "Salvaged Planks");
  591.         LanguageRegistry.addName(blockGemGlass, "Gem Glass");
  592.        
  593.         //Items\\ LanguageRegistry.addName(item, ""); <-- SKELETON
  594.         LanguageRegistry.addName(itemObsidianFleck, "Obsidian Fleck");
  595.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 0), "Cow Utter");
  596.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 1), "Mouth Of Creeper");
  597.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 2), "Pig Snout");
  598.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 3), "Sheep Leg");
  599.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 4), "Skeleton Ribcage");
  600.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 5), "Zombie Arm");
  601.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 6), "Plant Greens");
  602.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 7), "Basilisk Fang");
  603.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 8), "Basilisk Hide");
  604.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 9), "Basilisk Scale");
  605.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 10), "Strange Barb");
  606.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 11), "Large Green Scale");
  607.         LanguageRegistry.addName(new ItemStack(itemMobPart, 1, 12), "Gem Root Shard");
  608.         LanguageRegistry.addName(new ItemStack(itemMatter, 1, 0), "Decomposing Matter");
  609.         LanguageRegistry.addName(new ItemStack(itemMatter, 1, 1), "Gelatinous Matter");
  610.         LanguageRegistry.addName(new ItemStack(itemMatter, 1, 2), "Protein Ball");
  611.         LanguageRegistry.addName(new ItemStack(itemMatter, 1, 3), "Vile Matter");
  612.         LanguageRegistry.addName(itemIncendiarySlimeball, "Incediary Slimeball");
  613.         LanguageRegistry.addName(new ItemStack(itemToolBinding, 1, 0), "String Binding");
  614.         LanguageRegistry.addName(new ItemStack(itemToolBinding, 1, 1), "Redstone Binding");
  615.         LanguageRegistry.addName(new ItemStack(itemToolBinding, 1, 2), "Lapis Lazuli Binding");
  616.         LanguageRegistry.addName(new ItemStack(itemToolBinding, 1, 3), "Glowstone Binding");
  617.         LanguageRegistry.addName(new ItemStack(itemRune, 1, 0), "Handle Rune");
  618.         LanguageRegistry.addName(new ItemStack(itemRune, 1, 1), "Pick Rune");
  619.         LanguageRegistry.addName(new ItemStack(itemRune, 1, 2), "Axe Rune");
  620.         LanguageRegistry.addName(new ItemStack(itemRune, 1, 3), "Shovel Rune");
  621.         LanguageRegistry.addName(new ItemStack(itemRune, 1, 4), "Sword Rune");
  622.         LanguageRegistry.addName(new ItemStack(itemRune, 1, 5), "Hoe Rune");
  623.         LanguageRegistry.addName(new ItemStack(itemRune, 1, 6), "Quick-Axe Rune");
  624.         LanguageRegistry.addName(new ItemStack(itemRune, 1, 7), "Skinning Rune");
  625.         LanguageRegistry.addName(new ItemStack(itemRune, 1, 8), "Notched Rune");
  626.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 0), "Diamond Pick Head");
  627.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 1), "Gold Pick Head");
  628.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 2), "Iron Pick Head");
  629.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 3), "Diamond Axe Head");
  630.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 4), "Gold Axe Head");
  631.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 5), "Iron Axe Head");
  632.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 6), "Diamond Shovel Head");
  633.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 7), "Gold Shovel Head");
  634.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 8), "Iron Shovel Head");
  635.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 9), "Diamond Sword Blade");
  636.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 10), "Gold Sword Blade");
  637.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 11), "Iron Sword Blade");
  638.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 12), "Diamond Hoe Head");
  639.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 13), "Gold Hoe Head");
  640.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 14), "Iron Hoe Head");
  641.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 15), "Diamond Quick-Axe Head");
  642.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 16), "Gold Quick-Axe Head");
  643.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 17), "Iron Quick-Axe Head");
  644.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 18), "Diamond Skinning Knife Blade");
  645.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 19), "Gold Skinning Knife Blade");
  646.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 20), "Iron Skinning Knife Blade");
  647.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 21), "Diamond Notched Blade");
  648.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 22), "Gold Notched Blade");
  649.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 23), "Iron Notched Blade");
  650.         LanguageRegistry.addName(new ItemStack(itemRunePart, 1, 24), "Runic Tool Handle");
  651.         LanguageRegistry.addName(itemCarbonFiberBow, "Carbon Fiber Bow");
  652.         LanguageRegistry.addName(new ItemStack(itemArrow, 1, 0), "Explosive Arrow");
  653. //      LanguageRegistry.addName(itemDiamondQuickPick, "Diamond Quick-Pick");
  654. //      LanguageRegistry.addName(itemGoldQuickPick, "Gold Quick-Pick");
  655. //      LanguageRegistry.addName(itemIronQuickPick, "Iron Quick-Pick");
  656.         LanguageRegistry.addName(new ItemStack(itemBioBottle, 1, 0), "Empty Bottle");
  657.         LanguageRegistry.addName(new ItemStack(itemBioBottle, 1, 1), "Bottle of Matter");
  658.         LanguageRegistry.addName(itemBioBottleCooked, "Bottle of Biology");
  659.         LanguageRegistry.addName(itemCompost, "Compost");
  660.         LanguageRegistry.addName(itemSapphireBerry, "Sapphire Berry");
  661.         LanguageRegistry.addName(itemThornedBranch, "Thorned Branch");
  662.         LanguageRegistry.addName(itemStoneCrown, "Stone Crown");
  663.         LanguageRegistry.addName(itemCrabMorsel, "Crab Morsel");
  664.         LanguageRegistry.addName(itemCookedCrabMorsel, "Cooked Crab Morsel");
  665.         LanguageRegistry.addName(itemVileFlesh, "Vile Flesh");
  666.         LanguageRegistry.addName(itemCleansingPowder, "Cleansing Powder");
  667.        
  668.         //Entities\\ LanguageRegistry.instance().addStringLocalization("entity..name", "en_US", ""); <-- SKELETON
  669.         LanguageRegistry.instance().addStringLocalization("entity.GreanBaen.name", "en_US", "Grean Baen");
  670.         LanguageRegistry.instance().addStringLocalization("entity.FungleCrab.name", "en_US", "Fungle Crab");
  671.         LanguageRegistry.instance().addStringLocalization("entity.PrizeRunner.name", "en_US", "Prize Runner");
  672.         LanguageRegistry.instance().addStringLocalization("entity.BarbedSpike.name", "en_US", "Barbed Spike");
  673.         LanguageRegistry.instance().addStringLocalization("entity.ArrowFish.name", "en_US", "Arrow Fish");
  674.         LanguageRegistry.instance().addStringLocalization("entity.Mongrel.name", "en_US", "Mongrel");
  675.         LanguageRegistry.instance().addStringLocalization("entity.SapphireLawncher.name", "en_US", "Sapphire Lawncher");
  676.         LanguageRegistry.instance().addStringLocalization("entity.WanderingShoot.name", "en_US", "Wandering Shoot");
  677.         LanguageRegistry.instance().addStringLocalization("entity.SporeRay.name", "en_US", "Spore Ray");
  678.         LanguageRegistry.instance().addStringLocalization("entity.Basilisk.name", "en_US", "Basilisk");
  679.     }
  680.    
  681.      // -- Game Registry -- \\
  682.     // -For registering blocks to forge
  683.     public void GameReg()
  684.     {
  685.         //Crafting Handler <-- For tools taking damage on crafting
  686.         GameRegistry.registerCraftingHandler(new CraftingHandler());
  687.        
  688.         //World Generation Generation
  689.         GameRegistry.registerWorldGenerator(eventManager);
  690.         GameRegistry.registerWorldGenerator(new WorldGenInfectedTree(false));
  691.         GameRegistry.registerWorldGenerator(new WorldGenMushroomGiant());
  692.        
  693.         //Blocks --GameRegistry.registerBlock(block, modid + block.getUnlocalizedName().substring(5)); <-- SKELETON
  694.         GameRegistry.registerBlock(blockLavaInfusedStone, modid + blockLavaInfusedStone.getUnlocalizedName().substring(5));
  695.         GameRegistry.registerBlock(blockMatter, modid + blockMatter.getUnlocalizedName().substring(5));
  696.         GameRegistry.registerBlock(blockRunicOre, modid + blockRunicOre.getUnlocalizedName().substring(5));
  697.         GameRegistry.registerBlock(blockFungleDirt, modid + blockFungleDirt.getUnlocalizedName().substring(5));
  698.         GameRegistry.registerBlock(blockFungleGrass, modid + blockFungleGrass.getUnlocalizedName().substring(5));
  699.         GameRegistry.registerBlock(blockInfectedLeaf, modid + blockInfectedLeaf.getUnlocalizedName().substring(5));
  700.         GameRegistry.registerBlock(blockInfectedLog, modid + blockInfectedLog.getUnlocalizedName().substring(5));
  701.         GameRegistry.registerBlock(blockInfectedSapling, modid + blockInfectedSapling.getUnlocalizedName().substring(5));
  702.         GameRegistry.registerBlock(blockVileMushroom, modid + blockVileMushroom.getUnlocalizedName().substring(5));
  703.         GameRegistry.registerBlock(blockBlueMushroom, modid + blockBlueMushroom.getUnlocalizedName().substring(5));
  704.         GameRegistry.registerBlock(blockBlueMushroomStem, modid + blockBlueMushroomStem.getUnlocalizedName().substring(5));
  705.         GameRegistry.registerBlock(blockRottenPlanks, modid + blockRottenPlanks.getUnlocalizedName().substring(5));
  706.         GameRegistry.registerBlock(blockMushroomGiant, modid + blockMushroomGiant.getUnlocalizedName().substring(5));
  707.         GameRegistry.registerBlock(blockPhotoStick, modid + blockPhotoStick.getUnlocalizedName().substring(5));
  708.         GameRegistry.registerBlock(blockCropStaff, modid + blockCropStaff.getUnlocalizedName().substring(5));
  709.         GameRegistry.registerBlock(blockSapphireCrop, modid + blockSapphireCrop.getUnlocalizedName().substring(5));
  710.         GameRegistry.registerBlock(blockPowerBulb, modid + blockPowerBulb.getUnlocalizedName().substring(5));
  711.         GameRegistry.registerBlock(blockPedestal, modid + blockPedestal.getUnlocalizedName().substring(5));
  712.         GameRegistry.registerBlock(blockGemRoot, modid + blockGemRoot.getUnlocalizedName().substring(5));
  713.         GameRegistry.registerBlock(blockShroomWood, modid + blockShroomWood.getUnlocalizedName().substring(5));
  714.         GameRegistry.registerBlock(blockSalvagedPlanks, modid + blockSalvagedPlanks.getUnlocalizedName().substring(5));
  715.         GameRegistry.registerBlock(blockGemGlass, modid + blockGemGlass.getUnlocalizedName().substring(5));
  716.        
  717.         //Biome Registry (Done AFTER blocks so that top/filler blocks are registered before biome is registered)
  718.         GameRegistry.addBiome(blight);
  719.     }
  720.    
  721.      // -- Entity Registry -- \\
  722.     //-For registering entites (mobs) -- EntityRegistry.registerModEntity(Entity.class, "", id, this, 80, 1, true);
  723.     public void EntityReg()
  724.     {
  725.         int id = 0;
  726.        
  727.         EntityRegistry.registerModEntity(EntityGreanBaen.class, "Grean Baen", id, this, 80, 1, true);
  728.         id++;
  729.        
  730.         EntityRegistry.registerModEntity(EntityFungleCrab.class, "Fungle Crab", id, this, 80, 1, true);
  731.         id++;
  732.        
  733.         EntityRegistry.registerModEntity(EntityPrizeRunner.class, "Prize Runner", id, this, 80, 1, true);
  734.         id++;
  735.        
  736.         EntityRegistry.registerModEntity(EntityObsidianFleck.class, "Obsidian Fleck", id, this, 64, 10, true);
  737.         id++;
  738.        
  739.         EntityRegistry.registerModEntity(EntityBarbedSpike.class, "Barbed Spike", id, this, 80, 1, true);
  740.         id++;
  741.        
  742.         EntityRegistry.registerModEntity(EntityArrowFish.class, "Arrow Fish", id, this, 80, 1, true);
  743.         id++;
  744.         EntityRegistry.addSpawn(EntityArrowFish.class, 5, 15, 40, EnumCreatureType.waterCreature, BiomeGenBase.ocean);
  745.        
  746.         EntityRegistry.registerModEntity(EntityMongrel.class, "Mongrel", id, this, 80, 1, true);
  747.         id++;
  748.        
  749.         EntityRegistry.registerModEntity(EntitySapphireLawncher.class, "Sapphire Lawncher", id, this, 80, 1, true);
  750.         id++;
  751.        
  752.         EntityRegistry.registerModEntity(EntityWanderingShoot.class, "Wandering Shoot", id, this, 80, 1, true);
  753.         id++;
  754.        
  755.         EntityRegistry.registerModEntity(EntitySapphireBerry.class, "Sapphire Berry", id, this, 64, 10, true);
  756.         id++;
  757.        
  758.         EntityRegistry.registerModEntity(EntitySporeRay.class, "Spore Ray", id, this, 80, 1, true);
  759.         id++;
  760.        
  761.         EntityRegistry.registerModEntity(EntityBasilisk.class, "Basilisk", id, this, 80, 1, true);
  762.     }
  763.    
  764.      // -- Tile Entity Registry -- \\
  765.     //-For registering custom rendered blocks -- GameRegistry.registerTileEntity(TileEntity.class, "");
  766.     public void TileEntityReg()
  767.     {
  768.         GameRegistry.registerTileEntity(TileEntityPhotoStick.class, "Photo Stick");
  769.         GameRegistry.registerTileEntity(TileEntitySapphireCrop.class, "Sapphire Crop");
  770.         GameRegistry.registerTileEntity(TileEntityPowerBulb.class, "Power Bulb");
  771.         GameRegistry.registerTileEntity(TileEntityCropStaff.class, "Staff Crop");
  772.         GameRegistry.registerTileEntity(TileEntityPedestal.class, "Growth Pedestal");
  773.     }
  774.    
  775.     public void MobDrops()
  776.     {
  777.         MinecraftForge.EVENT_BUS.register(new HandlerPlantGreens());
  778.     }
  779.    
  780.      // -- Creative Tab -- \\
  781.     // -Default custom tab for modded items + blocks
  782.     public static CreativeTabs tabSometimes = new CreativeTabs("tabSometimes")
  783.     {
  784.         public ItemStack getIconItemStack()
  785.         {
  786.             return new ItemStack(Base.itemCompost, 1, 0);
  787.         }
  788.     };
  789. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement