2014-05-02 21:31:20 +02:00
/*******************************************************************************
2014-08-07 08:29:25 +02:00
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
2014-08-07 02:56:58 -07:00
* http://www.gnu.org/licenses/lgpl-3.0.txt
2015-01-26 22:26:21 -08:00
*
2014-08-07 08:29:25 +02:00
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
2014-05-02 21:31:20 +02:00
******************************************************************************/
package forestry.plugins ;
2015-06-07 01:13:34 -07:00
import com.google.common.collect.ImmutableMap ;
2015-06-20 23:57:33 -07:00
import java.io.File ;
2014-12-26 02:13:39 -08:00
import java.util.ArrayList ;
2015-06-20 23:57:33 -07:00
import java.util.HashMap ;
2015-03-01 01:04:07 -08:00
import java.util.List ;
2015-06-20 23:57:33 -07:00
import java.util.Map ;
2015-01-11 19:33:37 -08:00
import java.util.Random ;
2015-06-29 22:15:39 -07:00
import java.util.Set ;
2014-12-26 02:13:39 -08:00
import net.minecraft.block.Block ;
import net.minecraft.block.material.Material ;
import net.minecraft.init.Blocks ;
import net.minecraft.init.Items ;
import net.minecraft.item.ItemStack ;
import net.minecraft.item.crafting.IRecipe ;
import net.minecraft.nbt.NBTTagCompound ;
import net.minecraft.util.IIcon ;
import net.minecraft.util.WeightedRandomChestContent ;
2015-01-11 19:33:37 -08:00
import net.minecraft.world.World ;
import net.minecraft.world.chunk.IChunkProvider ;
2015-01-26 22:26:21 -08:00
2014-12-26 02:13:39 -08:00
import net.minecraftforge.client.event.TextureStitchEvent ;
import net.minecraftforge.common.ChestGenHooks ;
import net.minecraftforge.common.MinecraftForge ;
2015-06-20 23:57:33 -07:00
import net.minecraftforge.common.config.Property ;
2015-11-18 13:51:57 -08:00
import net.minecraftforge.fluids.FluidStack ;
2014-12-26 02:13:39 -08:00
import net.minecraftforge.oredict.OreDictionary ;
2015-01-26 22:26:21 -08:00
2014-05-02 21:31:20 +02:00
import cpw.mods.fml.common.FMLCommonHandler ;
import cpw.mods.fml.common.SidedProxy ;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage ;
import cpw.mods.fml.common.eventhandler.SubscribeEvent ;
2015-08-15 19:01:30 -07:00
import cpw.mods.fml.common.registry.GameData ;
2014-05-02 21:31:20 +02:00
import cpw.mods.fml.common.registry.GameRegistry ;
import cpw.mods.fml.common.registry.VillagerRegistry ;
import cpw.mods.fml.relauncher.Side ;
import cpw.mods.fml.relauncher.SideOnly ;
2015-01-26 22:26:21 -08:00
2015-06-20 23:57:33 -07:00
import forestry.Forestry ;
2014-05-02 21:31:20 +02:00
import forestry.api.apiculture.BeeManager ;
import forestry.api.apiculture.EnumBeeType ;
import forestry.api.apiculture.FlowerManager ;
2015-06-20 23:57:33 -07:00
import forestry.api.apiculture.IBeekeepingMode ;
2014-10-03 02:08:41 -07:00
import forestry.api.apiculture.hives.HiveManager ;
2015-11-05 04:47:04 -08:00
import forestry.api.core.ForestryAPI ;
2014-05-02 21:31:20 +02:00
import forestry.api.core.Tabs ;
import forestry.api.genetics.AlleleManager ;
import forestry.api.genetics.IClassification ;
import forestry.api.genetics.IClassification.EnumClassLevel ;
2015-06-20 23:57:33 -07:00
import forestry.api.genetics.IFlower ;
import forestry.api.genetics.IFlowerRegistry ;
2014-05-02 21:31:20 +02:00
import forestry.api.recipes.RecipeManagers ;
2014-12-26 02:13:39 -08:00
import forestry.api.storage.ICrateRegistry ;
import forestry.api.storage.StorageManager ;
2015-09-25 15:06:43 -07:00
import forestry.apiculture.ArmorApiaristHelper ;
2014-05-02 21:31:20 +02:00
import forestry.apiculture.GuiHandlerApiculture ;
import forestry.apiculture.SaveEventHandlerApiculture ;
import forestry.apiculture.VillageHandlerApiculture ;
2015-09-25 15:06:43 -07:00
import forestry.apiculture.blocks.BlockAlveary ;
import forestry.apiculture.blocks.BlockBeehives ;
import forestry.apiculture.blocks.BlockCandle ;
import forestry.apiculture.blocks.BlockStump ;
2014-12-13 23:38:36 -08:00
import forestry.apiculture.commands.CommandBee ;
2015-11-05 21:58:01 -08:00
import forestry.apiculture.entities.EntityMinecartApiary ;
2015-10-18 18:09:40 -07:00
import forestry.apiculture.entities.EntityMinecartBeehouse ;
2015-01-17 12:49:52 +01:00
import forestry.apiculture.flowers.FlowerRegistry ;
2015-05-07 22:20:34 -07:00
import forestry.apiculture.genetics.BeeBranchDefinition ;
import forestry.apiculture.genetics.BeeDefinition ;
import forestry.apiculture.genetics.BeeFactory ;
2014-05-02 21:31:20 +02:00
import forestry.apiculture.genetics.BeeHelper ;
2015-05-07 22:20:34 -07:00
import forestry.apiculture.genetics.BeeMutationFactory ;
2014-05-02 21:31:20 +02:00
import forestry.apiculture.genetics.BeekeepingMode ;
import forestry.apiculture.genetics.HiveDrop ;
2015-05-07 22:20:34 -07:00
import forestry.apiculture.genetics.JubilanceFactory ;
2015-10-23 12:21:37 -07:00
import forestry.apiculture.genetics.alleles.AlleleEffect ;
2015-11-18 13:51:57 -08:00
import forestry.apiculture.items.EnumHoneyComb ;
import forestry.apiculture.items.EnumPollenCluster ;
import forestry.apiculture.items.EnumPropolis ;
2015-09-25 15:06:43 -07:00
import forestry.apiculture.items.ItemBlockCandle ;
2015-11-18 13:51:57 -08:00
import forestry.apiculture.items.ItemRegistryApiculture ;
2015-06-29 22:15:39 -07:00
import forestry.apiculture.multiblock.TileAlveary ;
import forestry.apiculture.multiblock.TileAlvearyFan ;
import forestry.apiculture.multiblock.TileAlvearyHeater ;
import forestry.apiculture.multiblock.TileAlvearyHygroregulator ;
import forestry.apiculture.multiblock.TileAlvearyPlain ;
import forestry.apiculture.multiblock.TileAlvearySieve ;
import forestry.apiculture.multiblock.TileAlvearyStabiliser ;
import forestry.apiculture.multiblock.TileAlvearySwarmer ;
2015-11-17 19:34:11 -08:00
import forestry.apiculture.network.PacketRegistryApiculture ;
2014-05-02 21:31:20 +02:00
import forestry.apiculture.proxy.ProxyApiculture ;
2015-09-25 15:06:43 -07:00
import forestry.apiculture.tiles.TileApiaristChest ;
import forestry.apiculture.tiles.TileApiary ;
2015-09-25 15:45:23 -07:00
import forestry.apiculture.tiles.TileBeehouse ;
2015-09-25 15:06:43 -07:00
import forestry.apiculture.tiles.TileCandle ;
import forestry.apiculture.tiles.TileSwarm ;
2014-11-26 23:40:37 -08:00
import forestry.apiculture.trigger.ApicultureTriggers ;
2014-05-02 21:31:20 +02:00
import forestry.apiculture.worldgen.HiveDecorator ;
2015-01-11 01:40:54 -08:00
import forestry.apiculture.worldgen.HiveDescription ;
import forestry.apiculture.worldgen.HiveGenHelper ;
import forestry.apiculture.worldgen.HiveRegistry ;
2015-11-08 19:24:46 -08:00
import forestry.core.GuiHandlerBase ;
2015-09-25 15:06:43 -07:00
import forestry.core.ISaveEventHandler ;
import forestry.core.blocks.BlockBase ;
2014-05-02 21:31:20 +02:00
import forestry.core.config.Config ;
2015-09-25 15:06:43 -07:00
import forestry.core.config.Constants ;
2014-05-02 21:31:20 +02:00
import forestry.core.config.ForestryBlock ;
import forestry.core.config.ForestryItem ;
2015-06-21 22:34:42 -07:00
import forestry.core.config.LocalizedConfiguration ;
2015-09-25 15:06:43 -07:00
import forestry.core.entities.EntityFXSnow ;
2014-12-13 18:58:49 -08:00
import forestry.core.fluids.Fluids ;
2015-11-17 22:28:46 -08:00
import forestry.core.items.EnumElectronTube ;
2015-09-25 15:06:43 -07:00
import forestry.core.items.ItemBlockForestry ;
2015-11-17 19:34:11 -08:00
import forestry.core.network.IPacketRegistry ;
2014-05-02 21:31:20 +02:00
import forestry.core.proxy.Proxies ;
2015-10-17 12:25:13 -07:00
import forestry.core.recipes.RecipeUtil ;
2015-09-25 15:06:43 -07:00
import forestry.core.recipes.ShapedRecipeCustom ;
import forestry.core.tiles.MachineDefinition ;
import forestry.core.tiles.TileAnalyzer ;
2015-10-18 18:09:40 -07:00
import forestry.core.utils.EntityUtil ;
2015-09-25 15:06:43 -07:00
import forestry.core.utils.Log ;
import forestry.core.utils.Stack ;
2015-06-21 22:34:42 -07:00
import forestry.core.utils.StringUtil ;
2014-05-02 21:31:20 +02:00
2015-09-25 15:06:43 -07:00
@Plugin ( pluginID = "Apiculture" , name = "Apiculture" , author = "SirSengir" , url = Constants . URL , unlocalizedDescription = "for.plugin.apiculture.description" )
2014-09-20 22:43:13 -07:00
public class PluginApiculture extends ForestryPlugin {
2014-05-02 21:31:20 +02:00
2015-09-25 15:06:43 -07:00
@SidedProxy ( clientSide = "forestry.apiculture.proxy.ProxyApicultureClient" , serverSide = "forestry.apiculture.proxy.ProxyApiculture" )
2014-05-02 21:31:20 +02:00
public static ProxyApiculture proxy ;
private static final String CONFIG_CATEGORY = "apiculture" ;
public static String beekeepingMode = "NORMAL" ;
2015-06-21 22:34:42 -07:00
private static float secondPrincessChance = 0 ;
2015-06-29 22:15:39 -07:00
public static final int ticksPerBeeWorkCycle = 550 ;
2014-05-02 21:31:20 +02:00
public static boolean fancyRenderedBees = false ;
2015-11-18 13:51:57 -08:00
public static ItemRegistryApiculture items ;
2015-04-12 21:07:49 -07:00
2015-01-11 01:40:54 -08:00
public static HiveRegistry hiveRegistry ;
2015-08-02 01:15:41 -07:00
private static MachineDefinition definitionApiary ;
2015-09-23 00:24:48 -07:00
private static MachineDefinition definitionChestLegacy ;
2015-08-02 01:15:41 -07:00
private static MachineDefinition definitionChest ;
private static MachineDefinition definitionBeehouse ;
private static MachineDefinition definitionAnalyzer ;
2014-05-02 21:31:20 +02:00
2015-10-10 04:16:52 -07:00
private final Map < String , String []> defaultAcceptedFlowers = new HashMap <> ();
private final Map < String , String []> defaultPlantableFlowers = new HashMap <> ();
2015-06-20 23:57:33 -07:00
2014-05-02 21:31:20 +02:00
@Override
2015-08-26 01:17:42 +01:00
@SuppressWarnings ({ "unchecked" })
2015-04-05 14:16:41 -07:00
protected void setupAPI () {
super . setupAPI ();
2014-05-02 21:31:20 +02:00
2015-01-11 01:40:54 -08:00
HiveManager . hiveRegistry = hiveRegistry = new HiveRegistry ();
HiveManager . genHelper = new HiveGenHelper ();
2014-05-02 21:31:20 +02:00
2015-01-17 12:49:52 +01:00
FlowerManager . flowerRegistry = new FlowerRegistry ();
2015-10-10 04:16:52 -07:00
BeeManager . villageBees = new ArrayList [] { new ArrayList <> (), new ArrayList <> ()};
2015-04-05 14:16:41 -07:00
2015-05-07 22:20:34 -07:00
BeeManager . beeFactory = new BeeFactory ();
BeeManager . beeMutationFactory = new BeeMutationFactory ();
BeeManager . jubilanceFactory = new JubilanceFactory ();
2015-09-20 12:20:45 +02:00
BeeManager . armorApiaristHelper = new ArmorApiaristHelper ();
2015-05-07 22:20:34 -07:00
2015-04-05 14:16:41 -07:00
// Init bee interface
2015-05-07 22:20:34 -07:00
BeeManager . beeRoot = new BeeHelper ();
AlleleManager . alleleRegistry . registerSpeciesRoot ( BeeManager . beeRoot );
2015-04-05 14:16:41 -07:00
// Modes
2015-05-07 22:20:34 -07:00
BeeManager . beeRoot . registerBeekeepingMode ( BeekeepingMode . easy );
BeeManager . beeRoot . registerBeekeepingMode ( BeekeepingMode . normal );
BeeManager . beeRoot . registerBeekeepingMode ( BeekeepingMode . hard );
BeeManager . beeRoot . registerBeekeepingMode ( BeekeepingMode . hardcore );
BeeManager . beeRoot . registerBeekeepingMode ( BeekeepingMode . insane );
2015-04-05 14:16:41 -07:00
}
@Override
2015-11-05 04:47:04 -08:00
protected void registerItemsAndBlocks () {
2015-11-18 13:51:57 -08:00
items = new ItemRegistryApiculture ();
2015-04-05 14:16:41 -07:00
2015-09-25 15:06:43 -07:00
ForestryBlock . apiculture . registerBlock ( new BlockBase ( Material . iron ), ItemBlockForestry . class , "apiculture" );
2014-08-18 05:20:29 -07:00
ForestryBlock . apiculture . block (). setCreativeTab ( Tabs . tabApiculture );
2015-03-01 00:05:31 -08:00
ForestryBlock . apiculture . block (). setHarvestLevel ( "axe" , 0 );
2014-08-18 05:20:29 -07:00
2015-09-25 15:06:43 -07:00
ForestryBlock . apicultureChest . registerBlock ( new BlockBase ( Material . iron , true ), ItemBlockForestry . class , "apicultureChest" );
2015-09-23 00:24:48 -07:00
ForestryBlock . apicultureChest . block (). setCreativeTab ( Tabs . tabApiculture );
ForestryBlock . apicultureChest . block (). setHarvestLevel ( "axe" , 0 );
2015-11-05 04:47:04 -08:00
ForestryBlock . beehives . registerBlock ( new BlockBeehives (), ItemBlockForestry . class , "beehives" );
// Candles
ForestryBlock . candle . registerBlock ( new BlockCandle (), ItemBlockCandle . class , "candle" );
ForestryBlock . stump . registerBlock ( new BlockStump (), ItemBlockForestry . class , "stump" );
// Alveary and Components
ForestryBlock . alveary . registerBlock ( new BlockAlveary (), ItemBlockForestry . class , "alveary" );
ForestryBlock . alveary . block (). setHarvestLevel ( "axe" , 0 );
}
@Override
public void preInit () {
super . preInit ();
MinecraftForge . EVENT_BUS . register ( this );
2015-09-25 15:06:43 -07:00
definitionApiary = (( BlockBase ) ForestryBlock . apiculture . block ()). addDefinition ( new MachineDefinition ( Constants . DEFINITION_APIARY_META , "forestry.Apiary" , TileApiary . class ,
ShapedRecipeCustom . createShapedRecipe ( ForestryBlock . apiculture . getItemStack ( 1 , Constants . DEFINITION_APIARY_META ),
2014-08-18 05:20:29 -07:00
"XXX" ,
"#C#" ,
"###" ,
'X' , "slabWood" ,
'#' , "plankWood" ,
2015-11-17 22:28:46 -08:00
'C' , PluginCore . items . impregnatedCasing ))
2014-08-18 05:20:29 -07:00
. setFaces ( 0 , 1 , 2 , 2 , 4 , 4 , 0 , 7 ));
2015-09-25 15:06:43 -07:00
definitionChestLegacy = (( BlockBase ) ForestryBlock . apiculture . block ()). addDefinition ( new MachineDefinition ( Constants . DEFINITION_APIARISTCHEST_LEGACY_META , "forestry.ApiaristChest" , TileApiaristChest . class ). setLegacy ());
2015-09-23 00:24:48 -07:00
2015-09-25 15:30:25 -07:00
definitionChest = (( BlockBase ) ForestryBlock . apicultureChest . block ()). addDefinition ( new MachineDefinition ( Constants . DEFINITION_APIARISTCHEST_META , "forestry.ApiaristChestNew" , TileApiaristChest . class , Proxies . render . getRenderChest ( "apiaristchest" ),
2015-09-25 15:06:43 -07:00
ShapedRecipeCustom . createShapedRecipe ( ForestryBlock . apicultureChest . getItemStack ( 1 , Constants . DEFINITION_APIARISTCHEST_META ),
2014-08-18 05:20:29 -07:00
" # " ,
"XYX" ,
"XXX" ,
2015-08-21 01:45:09 -05:00
'#' , "blockGlass" ,
2014-08-18 05:20:29 -07:00
'X' , "beeComb" ,
2015-08-21 02:01:41 -05:00
'Y' , "chestWood" ))
2015-08-26 01:17:42 +01:00
. setBoundingBox ( 0 . 0625F , 0 . 0F , 0 . 0625F , 0 . 9375F , 0 . 875F , 0 . 9375F ));
2014-08-18 05:20:29 -07:00
2015-09-25 15:45:23 -07:00
definitionBeehouse = (( BlockBase ) ForestryBlock . apiculture . block ()). addDefinition ( new MachineDefinition ( Constants . DEFINITION_BEEHOUSE_META , "forestry.Beehouse" , TileBeehouse . class ,
2015-09-25 15:06:43 -07:00
ShapedRecipeCustom . createShapedRecipe ( ForestryBlock . apiculture . getItemStack ( 1 , Constants . DEFINITION_BEEHOUSE_META ),
2014-08-18 05:20:29 -07:00
"XXX" ,
"#C#" ,
"###" ,
'X' , "slabWood" ,
'#' , "plankWood" ,
'C' , "beeComb" ))
. setFaces ( 0 , 1 , 2 , 2 , 4 , 4 , 0 , 7 ));
2015-09-25 15:06:43 -07:00
definitionAnalyzer = (( BlockBase ) ForestryBlock . core . block ()). addDefinition ( new MachineDefinition ( Constants . DEFINITION_ANALYZER_META , "forestry.Analyzer" , TileAnalyzer . class ,
PluginApiculture . proxy . getRendererAnalyzer ( Constants . TEXTURE_PATH_BLOCKS + "/analyzer_" )));
2014-10-01 22:28:21 -07:00
2014-05-02 21:31:20 +02:00
// Add triggers
2014-11-29 19:53:40 -08:00
if ( PluginManager . Module . BUILDCRAFT_STATEMENTS . isEnabled ()) {
2014-11-26 23:40:37 -08:00
ApicultureTriggers . initialize ();
}
2014-05-02 21:31:20 +02:00
2015-06-21 22:34:42 -07:00
if ( Config . enableVillagers ) {
2015-01-24 00:21:20 -08:00
// Register village components with the Structure registry.
VillageHandlerApiculture . registerVillageComponents ();
}
2014-11-14 22:49:26 -08:00
// Commands
2014-12-13 23:38:36 -08:00
PluginCore . rootCommand . addChildCommand ( new CommandBee ());
2014-05-02 21:31:20 +02:00
}
@Override
public void doInit () {
2015-11-05 04:47:04 -08:00
File configFile = new File ( Forestry . instance . getConfigFolder (), CONFIG_CATEGORY + ".cfg" );
2015-06-20 23:57:33 -07:00
if ( ! configFile . exists ()) {
setDefaultsForConfig ();
}
2015-07-24 23:08:17 -07:00
LocalizedConfiguration config = new LocalizedConfiguration ( configFile , "2.0.0" );
if ( ! config . getLoadedConfigVersion (). equals ( config . getDefinedConfigVersion ())) {
boolean deleted = configFile . delete ();
if ( deleted ) {
config = new LocalizedConfiguration ( configFile , "2.0.0" );
setDefaultsForConfig ();
}
}
2014-05-02 21:31:20 +02:00
2015-06-20 23:57:33 -07:00
List < IBeekeepingMode > beekeepingModes = BeeManager . beeRoot . getBeekeepingModes ();
String [] validBeekeepingModeNames = new String [ beekeepingModes . size () ] ;
for ( int i = 0 ; i < beekeepingModes . size (); i ++ ) {
validBeekeepingModeNames [ i ] = beekeepingModes . get ( i ). getName ();
}
2015-06-21 22:34:42 -07:00
beekeepingMode = config . getStringLocalized ( "beekeeping" , "mode" , "NORMAL" , validBeekeepingModeNames );
2015-09-25 15:06:43 -07:00
Log . finer ( "Beekeeping mode read from config: " + beekeepingMode );
2014-05-02 21:31:20 +02:00
2015-06-21 22:34:42 -07:00
secondPrincessChance = config . getFloatLocalized ( "beekeeping" , "second.princess" , secondPrincessChance , 0 . 0f , 100 . 0f );
String acceptedFlowerMessage = StringUtil . localize ( "config.beekeeping.flowers.accepted.comment" );
String plantableFlowerMessage = StringUtil . localize ( "config.beekeeping.flowers.plantable.comment" );
2015-02-09 23:36:32 -06:00
2015-06-20 23:57:33 -07:00
for ( String flowerType : FlowerManager . flowerRegistry . getFlowerTypes ()) {
String [] defaultAccepted = defaultAcceptedFlowers . get ( flowerType );
if ( defaultAccepted == null ) {
2015-11-18 13:51:57 -08:00
defaultAccepted = Constants . EMPTY_STRINGS ;
2015-06-20 23:57:33 -07:00
}
2015-06-21 22:34:42 -07:00
Property property = config . get ( "beekeeping.flowers." + flowerType , "accepted" , defaultAccepted );
property . comment = acceptedFlowerMessage ;
2015-08-08 15:51:43 -07:00
parseAcceptedFlowers ( property . getStringList (), flowerType );
2014-05-02 21:31:20 +02:00
2015-06-20 23:57:33 -07:00
String [] defaultPlantable = defaultPlantableFlowers . get ( flowerType );
if ( defaultPlantable == null ) {
2015-11-18 13:51:57 -08:00
defaultPlantable = Constants . EMPTY_STRINGS ;
2015-06-20 23:57:33 -07:00
}
property = config . get ( "beekeeping.flowers." + flowerType , "plantable" , defaultPlantable );
2015-06-21 22:34:42 -07:00
property . comment = plantableFlowerMessage ;
2015-06-20 23:57:33 -07:00
parsePlantableFlowers ( property , flowerType );
2015-06-28 13:56:54 -07:00
2015-06-29 22:15:39 -07:00
Set < IFlower > acceptableFlowers = FlowerManager . flowerRegistry . getAcceptableFlowers ( flowerType );
2015-06-28 13:56:54 -07:00
if ( acceptableFlowers == null || acceptableFlowers . size () == 0 ) {
2015-09-25 15:06:43 -07:00
Log . severe ( "Flower type '" + flowerType + "' has no valid flowers set in apiculture.cfg. Add valid flowers or delete the config to set it to default." );
2015-06-28 13:56:54 -07:00
}
2015-06-20 23:57:33 -07:00
}
2014-05-02 21:31:20 +02:00
2015-11-18 13:51:57 -08:00
String [] blacklist = config . getStringListLocalized ( "species" , "blacklist" , Constants . EMPTY_STRINGS );
2015-06-21 22:34:42 -07:00
parseBeeBlacklist ( blacklist );
2015-06-20 23:57:33 -07:00
config . save ();
2014-05-02 21:31:20 +02:00
2015-02-08 00:04:23 -08:00
// Genetics
2014-09-23 13:37:23 -07:00
createAlleles ();
2015-04-18 12:32:09 -07:00
BeeDefinition . initBees ();
2015-02-08 00:04:23 -08:00
2015-07-13 20:51:45 -07:00
AlleleManager . alleleRegistry . registerDeprecatedAlleleReplacement ( "forestry.speciesArgrarian" , BeeDefinition . AGRARIAN . getGenome (). getPrimary ());
2015-02-08 00:04:23 -08:00
// Hives
createHives ();
2015-04-18 12:32:09 -07:00
registerBeehiveDrops ();
2014-05-02 21:31:20 +02:00
// Inducers for swarmer
2015-11-18 13:51:57 -08:00
BeeManager . inducers . put ( items . royalJelly . getItemStack (), 10 );
2014-05-02 21:31:20 +02:00
GameRegistry . registerTileEntity ( TileAlvearyPlain . class , "forestry.Alveary" );
GameRegistry . registerTileEntity ( TileSwarm . class , "forestry.Swarm" );
GameRegistry . registerTileEntity ( TileAlvearySwarmer . class , "forestry.AlvearySwarmer" );
GameRegistry . registerTileEntity ( TileAlvearyHeater . class , "forestry.AlvearyHeater" );
GameRegistry . registerTileEntity ( TileAlvearyFan . class , "forestry.AlvearyFan" );
GameRegistry . registerTileEntity ( TileAlvearyHygroregulator . class , "forestry.AlvearyHygro" );
GameRegistry . registerTileEntity ( TileAlvearyStabiliser . class , "forestry.AlvearyStabiliser" );
GameRegistry . registerTileEntity ( TileAlvearySieve . class , "forestry.AlvearySieve" );
GameRegistry . registerTileEntity ( TileCandle . class , "forestry.Candle" );
2015-10-18 18:09:40 -07:00
EntityUtil . registerEntity ( EntityMinecartBeehouse . class , "cart.beehouse" , 1 , 0x000000 , 0xffffff , 256 , 3 , true );
2015-11-05 21:58:01 -08:00
EntityUtil . registerEntity ( EntityMinecartApiary . class , "cart.apiary" , 2 , 0x000000 , 0xffffff , 256 , 3 , true );
2014-05-02 21:31:20 +02:00
2015-04-18 12:32:09 -07:00
BeeManager . villageBees [ 0 ] . add ( BeeDefinition . FOREST . getGenome ());
BeeManager . villageBees [ 0 ] . add ( BeeDefinition . MEADOWS . getGenome ());
BeeManager . villageBees [ 0 ] . add ( BeeDefinition . MODEST . getGenome ());
BeeManager . villageBees [ 0 ] . add ( BeeDefinition . MARSHY . getGenome ());
BeeManager . villageBees [ 0 ] . add ( BeeDefinition . WINTRY . getGenome ());
BeeManager . villageBees [ 0 ] . add ( BeeDefinition . TROPICAL . getGenome ());
BeeManager . villageBees [ 1 ] . add ( BeeDefinition . FOREST . getRainResist (). getGenome ());
BeeManager . villageBees [ 1 ] . add ( BeeDefinition . COMMON . getGenome ());
BeeManager . villageBees [ 1 ] . add ( BeeDefinition . VALIANT . getGenome ());
2014-05-02 21:31:20 +02:00
2015-06-21 22:34:42 -07:00
if ( Config . enableVillagers ) {
2015-01-24 00:21:20 -08:00
// Register villager stuff
VillageHandlerApiculture villageHandler = new VillageHandlerApiculture ();
VillagerRegistry . instance (). registerVillageCreationHandler ( villageHandler );
2015-09-25 15:06:43 -07:00
VillagerRegistry . instance (). registerVillagerId ( Constants . ID_VILLAGER_BEEKEEPER );
Proxies . render . registerVillagerSkin ( Constants . ID_VILLAGER_BEEKEEPER , Constants . TEXTURE_SKIN_BEEKPEEPER );
VillagerRegistry . instance (). registerVillageTradeHandler ( Constants . ID_VILLAGER_BEEKEEPER , villageHandler );
2015-01-24 00:21:20 -08:00
}
2014-05-02 21:31:20 +02:00
proxy . initializeRendering ();
}
@Override
public void postInit () {
super . postInit ();
registerDungeonLoot ();
}
2015-06-20 23:57:33 -07:00
private void setDefaultsForConfig () {
IFlowerRegistry flowerRegistry = FlowerManager . flowerRegistry ;
// Register acceptable plants
flowerRegistry . registerAcceptableFlower ( Blocks . dragon_egg , FlowerManager . FlowerTypeEnd );
flowerRegistry . registerAcceptableFlower ( Blocks . vine , FlowerManager . FlowerTypeJungle );
flowerRegistry . registerAcceptableFlower ( Blocks . tallgrass , FlowerManager . FlowerTypeJungle );
flowerRegistry . registerAcceptableFlower ( Blocks . wheat , FlowerManager . FlowerTypeWheat );
flowerRegistry . registerAcceptableFlower ( Blocks . pumpkin_stem , FlowerManager . FlowerTypeGourd );
flowerRegistry . registerAcceptableFlower ( Blocks . melon_stem , FlowerManager . FlowerTypeGourd );
flowerRegistry . registerAcceptableFlower ( Blocks . nether_wart , FlowerManager . FlowerTypeNether );
2015-06-26 19:36:36 -07:00
flowerRegistry . registerAcceptableFlower ( Blocks . cactus , FlowerManager . FlowerTypeCacti );
2015-06-20 23:57:33 -07:00
flowerRegistry . registerAcceptableFlower ( Blocks . double_plant , 0 , FlowerManager . FlowerTypeVanilla , FlowerManager . FlowerTypeSnow );
flowerRegistry . registerAcceptableFlower ( Blocks . double_plant , 1 , FlowerManager . FlowerTypeVanilla , FlowerManager . FlowerTypeSnow );
flowerRegistry . registerAcceptableFlower ( Blocks . double_plant , 4 , FlowerManager . FlowerTypeVanilla , FlowerManager . FlowerTypeSnow );
flowerRegistry . registerAcceptableFlower ( Blocks . double_plant , 5 , FlowerManager . FlowerTypeVanilla , FlowerManager . FlowerTypeSnow );
// Register plantable plants
for ( int meta = 0 ; meta <= 8 ; meta ++ ) {
flowerRegistry . registerPlantableFlower ( Blocks . red_flower , meta , 1 . 0 , FlowerManager . FlowerTypeVanilla , FlowerManager . FlowerTypeSnow );
}
flowerRegistry . registerPlantableFlower ( Blocks . yellow_flower , 0 , 1 . 0 , FlowerManager . FlowerTypeVanilla , FlowerManager . FlowerTypeSnow );
flowerRegistry . registerPlantableFlower ( Blocks . brown_mushroom , 0 , 1 . 0 , FlowerManager . FlowerTypeMushrooms );
flowerRegistry . registerPlantableFlower ( Blocks . red_mushroom , 0 , 1 . 0 , FlowerManager . FlowerTypeMushrooms );
flowerRegistry . registerPlantableFlower ( Blocks . cactus , 0 , 1 . 0 , FlowerManager . FlowerTypeCacti );
for ( String flowerType : FlowerManager . flowerRegistry . getFlowerTypes ()) {
2015-06-29 22:15:39 -07:00
Set < IFlower > flowers = FlowerManager . flowerRegistry . getAcceptableFlowers ( flowerType );
2015-10-10 04:16:52 -07:00
List < String > acceptedFlowerNames = new ArrayList <> ();
List < String > plantableFlowerNames = new ArrayList <> ();
2015-06-20 23:57:33 -07:00
if ( flowers != null ) {
for ( IFlower flower : flowers ) {
2015-08-15 19:01:30 -07:00
String name = GameData . getBlockRegistry (). getNameForObject ( flower . getBlock ());
2015-08-08 15:51:43 -07:00
if ( name == null ) {
2015-09-25 15:06:43 -07:00
Log . severe ( "Could not find name for flower: " + flower + " with type: " + flowerType );
2015-08-08 15:51:43 -07:00
continue ;
}
2015-06-20 23:57:33 -07:00
int meta = flower . getMeta ();
if ( flower . getMeta () != OreDictionary . WILDCARD_VALUE ) {
name = name + ':' + meta ;
}
if ( flower . isPlantable ()) {
2015-07-24 23:08:17 -07:00
plantableFlowerNames . add ( name );
2015-06-20 23:57:33 -07:00
} else {
acceptedFlowerNames . add ( name );
}
}
}
String [] acceptedFlowerNamesArray = acceptedFlowerNames . toArray ( new String [ acceptedFlowerNames . size () ] );
defaultAcceptedFlowers . put ( flowerType , acceptedFlowerNamesArray );
String [] plantableFlowerNamesArray = plantableFlowerNames . toArray ( new String [ plantableFlowerNames . size () ] );
defaultPlantableFlowers . put ( flowerType , plantableFlowerNamesArray );
}
}
2014-05-02 21:31:20 +02:00
@Override
2015-11-08 19:24:46 -08:00
public GuiHandlerBase getGuiHandler () {
2014-05-02 21:31:20 +02:00
return new GuiHandlerApiculture ();
}
@Override
2015-11-17 19:34:11 -08:00
public IPacketRegistry getPacketRegistry () {
return new PacketRegistryApiculture ();
2014-05-02 21:31:20 +02:00
}
@Override
protected void registerCrates () {
2014-12-26 02:13:39 -08:00
ICrateRegistry crateRegistry = StorageManager . crateRegistry ;
2015-11-17 22:28:46 -08:00
crateRegistry . registerCrate ( PluginCore . items . beeswax . getItemStack (), "cratedBeeswax" );
2015-11-18 13:51:57 -08:00
crateRegistry . registerCrate ( items . pollenCluster . get ( EnumPollenCluster . NORMAL , 1 ), "cratedPollen" );
crateRegistry . registerCrate ( items . pollenCluster . get ( EnumPollenCluster . CRYSTALLINE , 1 ), "cratedCrystallinePollen" );
crateRegistry . registerCrate ( items . propolis . getItemStack (), "cratedPropolis" );
crateRegistry . registerCrate ( items . honeydew . getItemStack (), "cratedHoneydew" );
crateRegistry . registerCrate ( items . royalJelly . getItemStack (), "cratedRoyalJelly" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . HONEY , 1 ), "cratedHoneycombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . COCOA , 1 ), "cratedCocoaComb" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . SIMMERING , 1 ), "cratedSimmeringCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . STRINGY , 1 ), "cratedStringyCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . FROZEN , 1 ), "cratedFrozenCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . DRIPPING , 1 ), "cratedDrippingCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . SILKY , 1 ), "cratedSilkyCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . PARCHED , 1 ), "cratedParchedCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . MYSTERIOUS , 1 ), "cratedMysteriousCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . POWDERY , 1 ), "cratedPowderyCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . WHEATEN , 1 ), "cratedWheatenCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . MOSSY , 1 ), "cratedMossyCombs" );
crateRegistry . registerCrate ( items . beeComb . get ( EnumHoneyComb . MELLOW , 1 ), "cratedMellowCombs" );
2014-12-26 02:13:39 -08:00
2015-11-17 22:28:46 -08:00
crateRegistry . registerCrate ( PluginCore . items . refractoryWax . getItemStack (), "cratedRefractoryWax" );
2014-05-02 21:31:20 +02:00
}
@Override
protected void registerRecipes () {
// / APIARIST'S ARMOR
2015-11-17 22:28:46 -08:00
ItemStack wovenSilk = PluginCore . items . craftingMaterial . getWovenSilk ();
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . apiaristHat ,
2014-09-24 18:01:00 -07:00
"###" , "# #" ,
2015-11-17 22:28:46 -08:00
'#' , wovenSilk );
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . apiaristChest ,
2014-09-24 18:01:00 -07:00
"# #" , "###" , "###" ,
2015-11-17 22:28:46 -08:00
'#' , wovenSilk );
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . apiaristLegs ,
2014-09-24 18:01:00 -07:00
"###" , "# #" , "# #" ,
2015-11-17 22:28:46 -08:00
'#' , wovenSilk );
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . apiaristBoots ,
2014-09-24 18:01:00 -07:00
"# #" , "# #" ,
2015-11-17 22:28:46 -08:00
'#' , wovenSilk );
2014-05-02 21:31:20 +02:00
// / HABITAT LOCATOR
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . habitatLocator ,
2015-01-25 20:00:19 -08:00
" X " ,
"X#X" ,
" X " ,
2015-08-21 01:45:09 -05:00
'#' , "dustRedstone" , 'X' , "ingotBronze" );
2014-05-02 21:31:20 +02:00
// Bees
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . scoop ,
2014-05-02 21:31:20 +02:00
"#X#" , "###" , " # " ,
'#' , "stickWood" ,
'X' , Blocks . wool );
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( new ItemStack ( Items . slime_ball ),
2014-05-02 21:31:20 +02:00
"#X#" , "#X#" , "#X#" ,
2015-11-18 13:51:57 -08:00
'#' , items . propolis ,
'X' , items . pollenCluster . get ( EnumPollenCluster . NORMAL , 1 ));
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( new ItemStack ( Items . speckled_melon ),
2014-05-02 21:31:20 +02:00
"#X#" , "#Y#" , "#X#" ,
2015-11-18 13:51:57 -08:00
'#' , items . honeyDrop ,
'X' , items . honeydew ,
2014-05-02 21:31:20 +02:00
'Y' , Items . melon );
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . frameUntreated ,
2014-05-02 21:31:20 +02:00
"###" , "#S#" , "###" ,
'#' , "stickWood" ,
'S' , Items . string );
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . frameImpregnated ,
2014-05-02 21:31:20 +02:00
"###" , "#S#" , "###" ,
2015-11-17 22:28:46 -08:00
'#' , PluginCore . items . stickImpregnated ,
2014-05-02 21:31:20 +02:00
'S' , Items . string );
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . minecartBeehouse . getBeeHouseMinecart (),
2015-10-18 18:09:40 -07:00
"B" ,
"C" ,
'B' , ForestryBlock . apiculture . getItemStack ( 1 , Constants . DEFINITION_BEEHOUSE_META ),
'C' , Items . minecart );
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . minecartBeehouse . getApiaryMinecart (),
2015-11-05 21:58:01 -08:00
"B" ,
"C" ,
'B' , ForestryBlock . apiculture . getItemStack ( 1 , Constants . DEFINITION_APIARY_META ),
'C' , Items . minecart );
2014-05-02 21:31:20 +02:00
// FOOD STUFF
2015-01-26 22:26:21 -08:00
if ( ForestryItem . honeyedSlice . item () != null ) {
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryItem . honeyedSlice . getItemStack ( 4 ),
2014-05-02 21:31:20 +02:00
"###" , "#X#" , "###" ,
2015-11-18 13:51:57 -08:00
'#' , items . honeyDrop ,
2014-05-02 21:31:20 +02:00
'X' , Items . bread );
2015-01-26 22:26:21 -08:00
}
if ( ForestryItem . honeyPot . item () != null ) {
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryItem . honeyPot . getItemStack ( 1 ),
2014-05-02 21:31:20 +02:00
"# #" , " X " , "# #" ,
2015-11-18 13:51:57 -08:00
'#' , items . honeyDrop ,
2014-05-02 21:31:20 +02:00
'X' , ForestryItem . waxCapsule );
2015-01-26 22:26:21 -08:00
}
if ( ForestryItem . ambrosia . item () != null ) {
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryItem . ambrosia . getItemStack (),
2014-05-02 21:31:20 +02:00
"#Y#" , "XXX" , "###" ,
2015-11-18 13:51:57 -08:00
'#' , items . honeydew ,
'X' , items . royalJelly ,
2014-05-02 21:31:20 +02:00
'Y' , ForestryItem . waxCapsule );
2015-01-26 22:26:21 -08:00
}
2014-05-02 21:31:20 +02:00
// / CAPSULES
2015-11-17 22:28:46 -08:00
RecipeUtil . addRecipe ( ForestryAPI . activeMode . getStackSetting ( "recipe.output.capsule" ), "###" , '#' , PluginCore . items . beeswax );
RecipeUtil . addRecipe ( ForestryAPI . activeMode . getStackSetting ( "recipe.output.refractory" ), "###" , '#' , PluginCore . items . refractoryWax );
2014-05-02 21:31:20 +02:00
// / BITUMINOUS PEAT
2015-11-17 22:28:46 -08:00
RecipeUtil . addRecipe ( PluginCore . items . bituminousPeat . getItemStack (),
2014-09-24 18:01:00 -07:00
" # " , "XYX" , " # " ,
'#' , "dustAsh" ,
2015-11-17 22:28:46 -08:00
'X' , PluginCore . items . peat ,
2015-11-18 13:51:57 -08:00
'Y' , items . propolis );
2015-01-07 07:07:45 -08:00
2014-05-02 21:31:20 +02:00
// / TORCHES
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( new ItemStack ( Blocks . torch , 3 ),
2014-09-24 18:01:00 -07:00
" # " , " # " , " Y " ,
2015-11-17 22:28:46 -08:00
'#' , PluginCore . items . beeswax ,
2014-09-24 18:01:00 -07:00
'Y' , "stickWood" );
2015-11-17 22:28:46 -08:00
RecipeUtil . addRecipe ( PluginCore . items . craftingMaterial . getPulsatingMesh (),
2014-09-24 18:01:00 -07:00
"# #" , " # " , "# #" ,
2015-11-18 13:51:57 -08:00
'#' , items . propolis . get ( EnumPropolis . PULSATING , 1 ));
2014-05-02 21:31:20 +02:00
// / WAX CAST
2015-11-18 13:51:57 -08:00
RecipeUtil . addRecipe ( items . waxCast ,
2014-08-18 05:20:29 -07:00
"###" ,
"# #" ,
"###" ,
2015-11-17 22:28:46 -08:00
'#' , PluginCore . items . beeswax );
2014-05-02 21:31:20 +02:00
// / ALVEARY
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryBlock . alveary . getItemStack ( 1 , TileAlveary . PLAIN_META ),
2014-08-18 05:20:29 -07:00
"###" ,
"#X#" ,
"###" ,
2015-11-17 22:28:46 -08:00
'X' , PluginCore . items . impregnatedCasing ,
'#' , PluginCore . items . craftingMaterial . getScentedPaneling ());
2014-05-02 21:31:20 +02:00
// SWARMER
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryBlock . alveary . getItemStack ( 1 , TileAlveary . SWARMER_META ),
2014-08-18 05:20:29 -07:00
"#G#" ,
" X " ,
"#G#" ,
2015-11-17 22:28:46 -08:00
'#' , PluginCore . items . tubes . get ( EnumElectronTube . DIAMOND , 1 ),
2014-05-02 21:31:20 +02:00
'X' , ForestryBlock . alveary ,
2015-08-21 01:45:09 -05:00
'G' , "ingotGold" );
2014-05-02 21:31:20 +02:00
// FAN
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryBlock . alveary . getItemStack ( 1 , TileAlveary . FAN_META ),
2014-08-18 05:20:29 -07:00
"I I" ,
" X " ,
"I#I" ,
2015-11-17 22:28:46 -08:00
'#' , PluginCore . items . tubes . get ( EnumElectronTube . GOLD , 1 ),
2014-05-02 21:31:20 +02:00
'X' , ForestryBlock . alveary ,
2015-08-21 01:45:09 -05:00
'I' , "ingotIron" );
2014-05-02 21:31:20 +02:00
// HEATER
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryBlock . alveary . getItemStack ( 1 , TileAlveary . HEATER_META ),
2014-08-18 05:20:29 -07:00
"#I#" ,
" X " ,
"YYY" ,
2015-11-17 22:28:46 -08:00
'#' , PluginCore . items . tubes . get ( EnumElectronTube . GOLD , 1 ),
2014-05-02 21:31:20 +02:00
'X' , ForestryBlock . alveary ,
2015-08-21 02:34:49 -05:00
'I' , "ingotIron" , 'Y' , "stone" );
2014-05-02 21:31:20 +02:00
// HYGROREGULATOR
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryBlock . alveary . getItemStack ( 1 , TileAlveary . HYGRO_META ),
2014-08-18 05:20:29 -07:00
"GIG" ,
"GXG" ,
"GIG" ,
2014-05-02 21:31:20 +02:00
'X' , ForestryBlock . alveary ,
2015-08-21 01:45:09 -05:00
'I' , "ingotIron" ,
'G' , "blockGlass" );
2014-05-02 21:31:20 +02:00
// STABILISER
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryBlock . alveary . getItemStack ( 1 , TileAlveary . STABILIZER_META ),
2014-08-18 05:20:29 -07:00
"G G" ,
"GXG" ,
"G G" ,
2014-05-02 21:31:20 +02:00
'X' , ForestryBlock . alveary ,
2015-08-21 01:45:09 -05:00
'G' , "gemQuartz" );
2014-05-02 21:31:20 +02:00
// SIEVE
2015-10-17 12:25:13 -07:00
RecipeUtil . addRecipe ( ForestryBlock . alveary . getItemStack ( 1 , TileAlveary . SIEVE_META ),
2014-08-18 05:20:29 -07:00
"III" ,
" X " ,
"WWW" ,
2014-05-02 21:31:20 +02:00
'X' , ForestryBlock . alveary ,
2015-08-21 01:45:09 -05:00
'I' , "ingotIron" ,
2015-11-17 22:28:46 -08:00
'W' , PluginCore . items . craftingMaterial . getWovenSilk ());
2014-05-02 21:31:20 +02:00
2015-01-07 07:07:45 -08:00
if ( PluginManager . Module . FACTORY . isEnabled ()) {
// / SQUEEZER
2015-11-18 13:51:57 -08:00
FluidStack honeyDropFluid = Fluids . HONEY . getFluid ( Constants . FLUID_PER_HONEY_DROP );
RecipeManagers . squeezerManager . addRecipe ( 10 , new ItemStack [] { items . honeyDrop . getItemStack ()}, honeyDropFluid , items . propolis . getItemStack (), 5 );
RecipeManagers . squeezerManager . addRecipe ( 10 , new ItemStack [] { items . honeydew . getItemStack ()}, honeyDropFluid );
ItemStack phosphor = PluginCore . items . phosphor . getItemStack ( 2 );
RecipeManagers . squeezerManager . addRecipe ( 10 , new ItemStack [] { phosphor , new ItemStack ( Blocks . sand )}, Fluids . LAVA . getFluid ( 2000 ));
RecipeManagers . squeezerManager . addRecipe ( 10 , new ItemStack [] { phosphor , new ItemStack ( Blocks . sand , 1 , 1 )}, Fluids . LAVA . getFluid ( 2000 ));
RecipeManagers . squeezerManager . addRecipe ( 10 , new ItemStack [] { phosphor , new ItemStack ( Blocks . dirt )}, Fluids . LAVA . getFluid ( 1600 ));
2015-01-07 07:07:45 -08:00
// / CARPENTER
2015-11-18 13:51:57 -08:00
RecipeManagers . carpenterManager . addRecipe ( 100 , Fluids . WATER . getFluid ( 2000 ), null , items . beealyzer . getItemStack (),
2015-01-07 07:07:45 -08:00
"X#X" , "X#X" , "RDR" ,
2015-08-21 01:45:09 -05:00
'#' , "paneGlass" ,
2015-01-07 07:07:45 -08:00
'X' , "ingotTin" ,
2015-08-21 01:45:09 -05:00
'R' , "dustRedstone" ,
'D' , "gemDiamond" );
2015-11-17 22:28:46 -08:00
RecipeManagers . carpenterManager . addRecipe ( 50 , Fluids . HONEY . getFluid ( 500 ), null , PluginCore . items . craftingMaterial . getScentedPaneling (),
2015-01-07 07:07:45 -08:00
" J " , "###" , "WPW" ,
'#' , "plankWood" ,
2015-11-18 13:51:57 -08:00
'J' , items . royalJelly ,
2015-11-17 22:28:46 -08:00
'W' , PluginCore . items . beeswax ,
2015-11-18 13:51:57 -08:00
'P' , items . pollenCluster . get ( EnumPollenCluster . NORMAL , 1 ));
2015-01-07 07:07:45 -08:00
RecipeManagers . carpenterManager . addRecipe ( 30 , Fluids . WATER . getFluid ( 600 ), null , ForestryBlock . candle . getItemStack ( 24 ),
" X " ,
"###" ,
"###" ,
2015-11-17 22:28:46 -08:00
'#' , PluginCore . items . beeswax ,
2015-01-07 07:07:45 -08:00
'X' , Items . string );
RecipeManagers . carpenterManager . addRecipe ( 10 , Fluids . WATER . getFluid ( 200 ), null , ForestryBlock . candle . getItemStack ( 6 ),
"#X#" ,
2015-11-17 22:28:46 -08:00
'#' , PluginCore . items . beeswax ,
'X' , PluginCore . items . craftingMaterial . getSilkWisp ());
2015-10-17 12:25:13 -07:00
RecipeUtil . addShapelessRecipe ( ForestryBlock . candle . getItemStack (), ForestryBlock . candle . getItemStack ());
RecipeUtil . addShapelessRecipe ( ForestryBlock . candle . getItemStack ( 1 , 1 ), ForestryBlock . candle . getItemStack ( 1 , 1 ));
2015-01-07 07:07:45 -08:00
// / CENTRIFUGE
// Honey combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . HONEY , 1 ), ImmutableMap . of (
2015-11-17 22:28:46 -08:00
PluginCore . items . beeswax . getItemStack (), 1 . 0f ,
2015-11-18 13:51:57 -08:00
items . honeyDrop . getItemStack (), 0 . 9f
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
// Cocoa combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . COCOA , 1 ), ImmutableMap . of (
2015-11-17 22:28:46 -08:00
PluginCore . items . beeswax . getItemStack (), 1 . 0f ,
2015-06-07 01:13:34 -07:00
new ItemStack ( Items . dye , 1 , 3 ), 0 . 5f
));
2015-01-07 07:07:45 -08:00
// Simmering combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . SIMMERING , 1 ), ImmutableMap . of (
2015-11-17 22:28:46 -08:00
PluginCore . items . refractoryWax . getItemStack (), 1 . 0f ,
PluginCore . items . phosphor . getItemStack ( 2 ), 0 . 7f
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
// Stringy combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . STRINGY , 1 ), ImmutableMap . of (
items . propolis . getItemStack (), 1 . 0f ,
items . honeyDrop . getItemStack (), 0 . 4f
2015-06-07 01:13:34 -07:00
));
2015-04-12 22:33:28 -07:00
// Dripping combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . DRIPPING , 1 ), ImmutableMap . of (
items . honeydew . getItemStack (), 1 . 0f ,
items . honeyDrop . getItemStack (), 0 . 4f
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
// Frozen combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . FROZEN , 1 ), ImmutableMap . of (
2015-11-17 22:28:46 -08:00
PluginCore . items . beeswax . getItemStack (), 0 . 8f ,
2015-11-18 13:51:57 -08:00
items . honeyDrop . getItemStack (), 0 . 7f ,
2015-06-07 01:13:34 -07:00
new ItemStack ( Items . snowball ), 0 . 4f ,
2015-11-18 13:51:57 -08:00
items . pollenCluster . get ( EnumPollenCluster . CRYSTALLINE , 1 ), 0 . 2f
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
// Silky combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . SILKY , 1 ), ImmutableMap . of (
items . honeyDrop . getItemStack (), 1 . 0f ,
items . propolis . get ( EnumPropolis . SILKY , 1 ), 0 . 8f
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
// Parched combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . PARCHED , 1 ), ImmutableMap . of (
2015-11-17 22:28:46 -08:00
PluginCore . items . beeswax . getItemStack (), 1 . 0f ,
2015-11-18 13:51:57 -08:00
items . honeyDrop . getItemStack (), 0 . 9f
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
// Mysterious combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . MYSTERIOUS , 1 ), ImmutableMap . of (
items . propolis . get ( EnumPropolis . PULSATING , 1 ), 1 . 0f ,
items . honeyDrop . getItemStack (), 0 . 4f
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
// Irradiated combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . IRRADIATED , 1 ), ImmutableMap . < ItemStack , Float > of (
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
// Powdery combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . POWDERY , 1 ), ImmutableMap . of (
items . honeyDrop . getItemStack (), 0 . 2f ,
2015-11-17 22:28:46 -08:00
PluginCore . items . beeswax . getItemStack (), 0 . 2f ,
2015-06-07 01:13:34 -07:00
new ItemStack ( Items . gunpowder ), 0 . 9f
));
2015-01-07 07:07:45 -08:00
// Wheaten Combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . WHEATEN , 1 ), ImmutableMap . of (
items . honeyDrop . getItemStack (), 0 . 2f ,
2015-11-17 22:28:46 -08:00
PluginCore . items . beeswax . getItemStack (), 0 . 2f ,
2015-06-07 01:13:34 -07:00
new ItemStack ( Items . wheat ), 0 . 8f
));
2015-01-07 07:07:45 -08:00
// Mossy Combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . MOSSY , 1 ), ImmutableMap . of (
2015-11-17 22:28:46 -08:00
PluginCore . items . beeswax . getItemStack (), 1 . 0f ,
2015-11-18 13:51:57 -08:00
items . honeyDrop . getItemStack (), 0 . 9f
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
2015-06-07 01:13:34 -07:00
// Mellow Combs
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 20 , items . beeComb . get ( EnumHoneyComb . MELLOW , 1 ), ImmutableMap . of (
items . honeydew . getItemStack (), 0 . 6f ,
2015-11-17 22:28:46 -08:00
PluginCore . items . beeswax . getItemStack (), 0 . 2f ,
2015-06-07 01:13:34 -07:00
new ItemStack ( Items . quartz ), 0 . 3f
));
// Silky Propolis
2015-11-18 13:51:57 -08:00
RecipeManagers . centrifugeManager . addRecipe ( 5 , items . propolis . get ( EnumPropolis . SILKY , 1 ), ImmutableMap . of (
2015-11-17 22:28:46 -08:00
PluginCore . items . craftingMaterial . getSilkWisp (), 0 . 6f ,
2015-11-18 13:51:57 -08:00
items . propolis . getItemStack (), 0 . 1f
2015-06-07 01:13:34 -07:00
));
2015-01-07 07:07:45 -08:00
// / FERMENTER
2015-11-18 13:51:57 -08:00
RecipeManagers . fermenterManager . addRecipe ( items . honeydew . getItemStack (), 500 , 1 . 0f , Fluids . SHORT_MEAD . getFluid ( 1 ), Fluids . HONEY . getFluid ( 1 ));
2015-01-07 07:07:45 -08:00
}
2014-05-02 21:31:20 +02:00
2014-10-01 22:28:21 -07:00
// ANALYZER
2015-09-25 15:06:43 -07:00
definitionAnalyzer . recipes = createAlyzerRecipes ( ForestryBlock . core . block (), Constants . DEFINITION_ANALYZER_META );
2014-12-07 12:45:21 -08:00
definitionAnalyzer . register ();
definitionApiary . register ();
definitionBeehouse . register ();
2015-09-23 00:24:48 -07:00
definitionChestLegacy . register ();
2014-12-07 12:45:21 -08:00
definitionChest . register ();
2014-10-01 22:28:21 -07:00
}
2015-08-02 01:15:41 -07:00
private static IRecipe [] createAlyzerRecipes ( Block block , int meta ) {
2015-10-10 04:16:52 -07:00
ArrayList < IRecipe > recipes = new ArrayList <> ();
2015-11-17 22:28:46 -08:00
recipes . add ( ShapedRecipeCustom . createShapedRecipe ( new ItemStack ( block , 1 , meta ),
"XTX" ,
" Y " ,
"X X" ,
'Y' , PluginCore . items . sturdyCasing ,
2015-11-18 13:51:57 -08:00
'T' , items . beealyzer ,
2015-11-17 22:28:46 -08:00
'X' , "ingotBronze" ));
recipes . add ( ShapedRecipeCustom . createShapedRecipe ( new ItemStack ( block , 1 , meta ),
"XTX" ,
" Y " ,
"X X" ,
'Y' , PluginCore . items . sturdyCasing ,
'T' , ForestryItem . treealyzer ,
'X' , "ingotBronze" ));
2014-10-01 22:28:21 -07:00
return recipes . toArray ( new IRecipe [ recipes . size () ] );
2014-05-02 21:31:20 +02:00
}
2015-04-12 22:33:28 -07:00
private static void registerBeehiveDrops () {
2015-11-18 13:51:57 -08:00
ItemStack honeyComb = items . beeComb . get ( EnumHoneyComb . HONEY , 1 );
2015-04-12 22:33:28 -07:00
hiveRegistry . addDrops ( HiveRegistry . forest ,
2015-04-18 12:32:09 -07:00
new HiveDrop ( 80 , BeeDefinition . FOREST , honeyComb ). setIgnobleShare ( 0 . 7f ),
new HiveDrop ( 8 , BeeDefinition . FOREST . getRainResist (), honeyComb ),
new HiveDrop ( 3 , BeeDefinition . VALIANT , honeyComb )
2015-04-12 22:33:28 -07:00
);
hiveRegistry . addDrops ( HiveRegistry . meadows ,
2015-04-18 12:32:09 -07:00
new HiveDrop ( 80 , BeeDefinition . MEADOWS , honeyComb ). setIgnobleShare ( 0 . 7f ),
new HiveDrop ( 3 , BeeDefinition . VALIANT , honeyComb )
2015-04-12 22:33:28 -07:00
);
2015-11-18 13:51:57 -08:00
ItemStack parchedComb = items . beeComb . get ( EnumHoneyComb . PARCHED , 1 );
2015-04-12 22:33:28 -07:00
hiveRegistry . addDrops ( HiveRegistry . desert ,
2015-04-18 12:32:09 -07:00
new HiveDrop ( 80 , BeeDefinition . MODEST , parchedComb ). setIgnobleShare ( 0 . 7f ),
new HiveDrop ( 3 , BeeDefinition . VALIANT , parchedComb )
2015-04-12 22:33:28 -07:00
);
2015-11-18 13:51:57 -08:00
ItemStack silkyComb = items . beeComb . get ( EnumHoneyComb . SILKY , 1 );
2015-04-12 22:33:28 -07:00
hiveRegistry . addDrops ( HiveRegistry . jungle ,
2015-04-18 12:32:09 -07:00
new HiveDrop ( 80 , BeeDefinition . TROPICAL , silkyComb ). setIgnobleShare ( 0 . 7f ),
new HiveDrop ( 3 , BeeDefinition . VALIANT , silkyComb )
2015-04-12 22:33:28 -07:00
);
2015-11-18 13:51:57 -08:00
ItemStack mysteriousComb = items . beeComb . get ( EnumHoneyComb . MYSTERIOUS , 1 );
2015-04-12 22:33:28 -07:00
hiveRegistry . addDrops ( HiveRegistry . end ,
2015-04-18 12:32:09 -07:00
new HiveDrop ( 90 , BeeDefinition . ENDED , mysteriousComb )
2015-04-12 22:33:28 -07:00
);
2015-11-18 13:51:57 -08:00
ItemStack frozenComb = items . beeComb . get ( EnumHoneyComb . FROZEN , 1 );
2015-04-12 22:33:28 -07:00
hiveRegistry . addDrops ( HiveRegistry . snow ,
2015-04-18 12:32:09 -07:00
new HiveDrop ( 80 , BeeDefinition . WINTRY , frozenComb ). setIgnobleShare ( 0 . 5f ),
new HiveDrop ( 3 , BeeDefinition . VALIANT , frozenComb )
2015-04-12 22:33:28 -07:00
);
2015-11-18 13:51:57 -08:00
ItemStack mossyComb = items . beeComb . get ( EnumHoneyComb . MOSSY , 1 );
2015-04-12 22:33:28 -07:00
hiveRegistry . addDrops ( HiveRegistry . swamp ,
2015-04-18 12:32:09 -07:00
new HiveDrop ( 80 , BeeDefinition . MARSHY , mossyComb ). setIgnobleShare ( 0 . 4f ),
new HiveDrop ( 3 , BeeDefinition . VALIANT , mossyComb )
2015-04-12 22:33:28 -07:00
);
2014-05-02 21:31:20 +02:00
}
2015-04-05 14:16:41 -07:00
private static void registerDungeonLoot () {
2014-05-02 21:31:20 +02:00
int rarity ;
2015-01-26 22:26:21 -08:00
if ( Config . dungeonLootRare ) {
2014-05-02 21:31:20 +02:00
rarity = 5 ;
2015-01-26 22:26:21 -08:00
} else {
2014-05-02 21:31:20 +02:00
rarity = 10 ;
2015-01-26 22:26:21 -08:00
}
2014-05-02 21:31:20 +02:00
2015-04-18 12:32:09 -07:00
ChestGenHooks . addItem ( ChestGenHooks . DUNGEON_CHEST , new WeightedRandomChestContent ( BeeDefinition . STEADFAST . getMemberStack ( EnumBeeType . DRONE ), 1 , 1 , rarity ));
2014-05-02 21:31:20 +02:00
2014-08-18 05:20:29 -07:00
ItemStack stack = ForestryBlock . candle . getItemStack ();
2014-05-02 21:31:20 +02:00
NBTTagCompound tag = new NBTTagCompound ();
tag . setInteger ( BlockCandle . colourTagName , 0xffffff );
stack . setTagCompound ( tag );
2015-09-25 15:06:43 -07:00
ChestGenHooks . addItem ( Constants . CHEST_GEN_HOOK_NATURALIST_CHEST , new WeightedRandomChestContent ( stack , 7 , 12 , 12 ));
2015-11-18 13:51:57 -08:00
ChestGenHooks . addItem ( Constants . CHEST_GEN_HOOK_NATURALIST_CHEST , new WeightedRandomChestContent ( items . scoop . getItemStack (), 1 , 1 , 8 ));
ChestGenHooks . addItem ( Constants . CHEST_GEN_HOOK_NATURALIST_CHEST , new WeightedRandomChestContent ( items . propolis . get ( EnumPropolis . NORMAL , 1 ), 2 , 4 , 6 ));
ChestGenHooks . addItem ( Constants . CHEST_GEN_HOOK_NATURALIST_CHEST , new WeightedRandomChestContent ( items . beeComb . get ( EnumHoneyComb . HONEY , 1 ), 4 , 12 , 7 ));
ChestGenHooks . addItem ( Constants . CHEST_GEN_HOOK_NATURALIST_CHEST , new WeightedRandomChestContent ( items . beeComb . get ( EnumHoneyComb . FROZEN , 1 ), 2 , 10 , 7 ));
ChestGenHooks . addItem ( Constants . CHEST_GEN_HOOK_NATURALIST_CHEST , new WeightedRandomChestContent ( items . beeComb . get ( EnumHoneyComb . SILKY , 1 ), 1 , 6 , 7 ));
2014-05-02 21:31:20 +02:00
2015-09-25 15:06:43 -07:00
ChestGenHooks . addItem ( Constants . CHEST_GEN_HOOK_NATURALIST_CHEST , new WeightedRandomChestContent ( BeeDefinition . FOREST . getRainResist (). getMemberStack ( EnumBeeType . PRINCESS ), 1 , 1 , 5 ));
ChestGenHooks . addItem ( Constants . CHEST_GEN_HOOK_NATURALIST_CHEST , new WeightedRandomChestContent ( BeeDefinition . COMMON . getMemberStack ( EnumBeeType . DRONE ), 1 , 2 , 8 ));
ChestGenHooks . addItem ( Constants . CHEST_GEN_HOOK_NATURALIST_CHEST , new WeightedRandomChestContent ( BeeDefinition . MEADOWS . getMemberStack ( EnumBeeType . PRINCESS ), 1 , 1 , 5 ));
2014-05-02 21:31:20 +02:00
}
2015-04-05 14:16:41 -07:00
private static void createHives () {
2015-01-11 01:40:54 -08:00
hiveRegistry . registerHive ( HiveRegistry . forest , HiveDescription . FOREST );
hiveRegistry . registerHive ( HiveRegistry . meadows , HiveDescription . MEADOWS );
hiveRegistry . registerHive ( HiveRegistry . desert , HiveDescription . DESERT );
hiveRegistry . registerHive ( HiveRegistry . jungle , HiveDescription . JUNGLE );
hiveRegistry . registerHive ( HiveRegistry . end , HiveDescription . END );
hiveRegistry . registerHive ( HiveRegistry . snow , HiveDescription . SNOW );
hiveRegistry . registerHive ( HiveRegistry . swamp , HiveDescription . SWAMP );
2014-10-03 02:08:41 -07:00
}
2015-04-05 14:16:41 -07:00
private static void createAlleles () {
2014-05-02 21:31:20 +02:00
IClassification hymnoptera = AlleleManager . alleleRegistry . createAndRegisterClassification ( EnumClassLevel . ORDER , "hymnoptera" , "Hymnoptera" );
AlleleManager . alleleRegistry . getClassification ( "class.insecta" ). addMemberGroup ( hymnoptera );
IClassification apidae = AlleleManager . alleleRegistry . createAndRegisterClassification ( EnumClassLevel . FAMILY , "apidae" , "Apidae" );
hymnoptera . addMemberGroup ( apidae );
2015-04-22 23:14:42 -07:00
for ( BeeBranchDefinition beeBranch : BeeBranchDefinition . values ()) {
2015-04-18 12:32:09 -07:00
apidae . addMemberGroup ( beeBranch . getBranch ());
}
2014-05-02 21:31:20 +02:00
2015-11-03 21:32:14 -08:00
AlleleEffect . createAlleles ();
2014-05-02 21:31:20 +02:00
}
2015-06-20 23:57:33 -07:00
public static double getSecondPrincessChance () {
2015-02-09 23:36:32 -06:00
return secondPrincessChance ;
}
2015-06-20 23:57:33 -07:00
private static void parseBeeBlacklist ( String [] items ) {
2014-05-02 21:31:20 +02:00
for ( String item : items ) {
2015-01-26 22:26:21 -08:00
if ( item . isEmpty ()) {
2014-05-02 21:31:20 +02:00
continue ;
2015-01-26 22:26:21 -08:00
}
2014-05-02 21:31:20 +02:00
FMLCommonHandler . instance (). getFMLLogger (). debug ( "Blacklisting bee species identified by " + item );
AlleleManager . alleleRegistry . blacklistAllele ( item );
}
}
2015-08-08 15:51:43 -07:00
private static void parseAcceptedFlowers ( String [] acceptedFlowers , String flowerType ) {
2015-09-25 15:06:43 -07:00
List < Stack > acceptedFlowerItemStacks = Stack . parseStackStrings ( acceptedFlowers , OreDictionary . WILDCARD_VALUE );
for ( Stack acceptedFlower : acceptedFlowerItemStacks ) {
2015-06-24 22:03:06 -07:00
Block acceptedFlowerBlock = acceptedFlower . getBlock ();
int meta = acceptedFlower . getMeta ();
2015-06-20 23:57:33 -07:00
if ( acceptedFlowerBlock != null ) {
FlowerManager . flowerRegistry . registerAcceptableFlower ( acceptedFlowerBlock , meta , flowerType );
} else {
2015-09-25 15:06:43 -07:00
Log . warning ( "No block found for '" + acceptedFlower + "' in apiculture config for '" + flowerType + "'." );
2015-06-20 23:57:33 -07:00
}
}
}
private static void parsePlantableFlowers ( Property property , String flowerType ) {
for ( String string : property . getStringList ()) {
2015-09-25 15:06:43 -07:00
Stack plantableFlower = Stack . parseStackString ( string , OreDictionary . WILDCARD_VALUE );
2015-06-20 23:57:33 -07:00
if ( plantableFlower == null ) {
continue ;
}
2015-06-24 22:03:06 -07:00
Block plantableFlowerBlock = plantableFlower . getBlock ();
int meta = plantableFlower . getMeta ();
2015-06-20 23:57:33 -07:00
if ( plantableFlowerBlock != null ) {
2015-07-24 23:08:17 -07:00
FlowerManager . flowerRegistry . registerPlantableFlower ( plantableFlowerBlock , meta , 1 . 0 , flowerType );
2015-06-20 23:57:33 -07:00
} else {
2015-09-25 15:06:43 -07:00
Log . warning ( "No block found for '" + string + "' in config '" + property . getName () + "'." );
2015-06-20 23:57:33 -07:00
}
}
}
2014-05-02 21:31:20 +02:00
@Override
public ISaveEventHandler getSaveEventHandler () {
return new SaveEventHandlerApiculture ();
}
2015-01-11 19:33:37 -08:00
@Override
public void populateChunk ( IChunkProvider chunkProvider , World world , Random rand , int chunkX , int chunkZ , boolean hasVillageGenerated ) {
2015-06-21 00:22:13 -07:00
if ( Config . getBeehivesAmount () > 0 . 0 ) {
2015-08-02 01:15:41 -07:00
HiveDecorator . decorateHives ( chunkProvider , world , rand , chunkX , chunkZ , hasVillageGenerated );
2015-01-26 22:26:21 -08:00
}
2015-01-11 19:33:37 -08:00
}
@Override
public void populateChunkRetroGen ( World world , Random rand , int chunkX , int chunkZ ) {
2015-06-21 00:22:13 -07:00
if ( Config . getBeehivesAmount () > 0 . 0 ) {
2015-08-02 01:15:41 -07:00
HiveDecorator . decorateHives ( world , rand , chunkX , chunkZ );
2015-01-26 22:26:21 -08:00
}
2015-01-11 19:33:37 -08:00
}
2014-05-02 21:31:20 +02:00
@Override
public boolean processIMCMessage ( IMCMessage message ) {
if ( message . key . equals ( "add-candle-lighting-id" )) {
ItemStack value = message . getItemStackValue ();
2015-01-26 22:26:21 -08:00
if ( value != null ) {
2015-06-13 16:36:46 -07:00
BlockCandle . addItemToLightingList ( value . getItem ());
2015-01-26 22:26:21 -08:00
} else {
2015-06-13 16:36:46 -07:00
logInvalidIMCMessage ( message );
2015-01-26 22:26:21 -08:00
}
2014-05-02 21:31:20 +02:00
return true ;
2015-01-26 22:26:21 -08:00
} else if ( message . key . equals ( "add-alveary-slab" ) && message . isStringMessage ()) {
2015-06-29 22:15:39 -07:00
String messageString = String . format ( "Received a '%s' request from mod '%s'. This IMC message has been replaced with the oreDictionary for 'slabWood'. Please contact the author and report this issue." , message . key , message . getSender ());
2015-09-25 15:06:43 -07:00
Log . warning ( messageString );
2015-06-13 16:36:46 -07:00
return true ;
2015-01-26 22:26:21 -08:00
}
2015-06-13 16:36:46 -07:00
2014-05-02 21:31:20 +02:00
return super . processIMCMessage ( message );
}
@SubscribeEvent
@SideOnly ( Side . CLIENT )
public void textureHook ( TextureStitchEvent . Pre event ) {
if ( event . map . getTextureType () == 1 ) {
2015-09-25 15:06:43 -07:00
EntityFXSnow . icons = new IIcon [ 3 ] ;
for ( int i = 0 ; i < EntityFXSnow . icons . length ; i ++ ) {
EntityFXSnow . icons [ i ] = event . map . registerIcon ( "forestry:particles/snow." + ( i + 1 ));
2015-01-26 22:26:21 -08:00
}
2014-05-02 21:31:20 +02:00
}
}
}