From 14a712260ba6b0f6cb791d7dd55c5ea93358c0ef Mon Sep 17 00:00:00 2001 From: kuba6000 Date: Wed, 12 Oct 2022 21:09:45 +0200 Subject: [PATCH] Spotless --- src/main/java/magicbees/api/MagicBeesAPI.java | 15 +- .../magicbees/api/bees/AuraChargeType.java | 8 +- .../api/bees/IMagicApiaryAuraProvider.java | 68 +- .../bees/ITransmutationEffectController.java | 8 +- .../api/bees/ITransmutationEffectLogic.java | 37 +- src/main/java/magicbees/bees/Allele.java | 523 +-- .../java/magicbees/bees/AlleleEffect.java | 147 +- src/main/java/magicbees/bees/AlleleFloat.java | 24 +- .../java/magicbees/bees/AlleleFlower.java | 33 +- src/main/java/magicbees/bees/AuraCharge.java | 51 +- .../magicbees/bees/BeeClassification.java | 200 +- .../java/magicbees/bees/BeeGenomeManager.java | 2970 ++++++++--------- .../magicbees/bees/BeeIconColourProvider.java | 33 +- .../java/magicbees/bees/BeeIconProvider.java | 62 +- src/main/java/magicbees/bees/BeeManager.java | 196 +- src/main/java/magicbees/bees/BeeMutation.java | 1199 +++++-- .../java/magicbees/bees/BeeProductHelper.java | 823 ++--- src/main/java/magicbees/bees/BeeSpecies.java | 2479 ++++++++++---- .../java/magicbees/bees/HiveDescription.java | 339 +- src/main/java/magicbees/bees/HiveDrop.java | 119 +- .../bees/MoonPhaseMutationBonus.java | 76 +- .../bees/MoonPhaseMutationRestriction.java | 71 +- .../allele/effect/AlleleEffectCrumbling.java | 127 +- .../bees/allele/effect/AlleleEffectCure.java | 52 +- .../allele/effect/AlleleEffectEmpowering.java | 90 +- .../effect/AlleleEffectNodeConversion.java | 63 +- .../allele/effect/AlleleEffectNodeRepair.java | 56 +- .../effect/AlleleEffectPlaceholder.java | 23 +- .../allele/effect/AlleleEffectPotion.java | 93 +- .../allele/effect/AlleleEffectRecharge.java | 64 +- .../allele/effect/AlleleEffectSpawnMob.java | 310 +- .../effect/AlleleEffectSpawnMobWeighted.java | 131 +- .../allele/effect/AlleleEffectSpawnWisp.java | 112 +- .../effect/AlleleEffectTransmuting.java | 84 +- .../bees/allele/effect/EffectData.java | 131 +- .../effect/TransmutationEffectController.java | 57 +- .../TransmutationEffectLBotaniaLiving.java | 36 +- .../effect/TransmutationEffectRailcraft.java | 68 +- .../effect/TransmutationEffectVanilla.java | 25 +- .../allele/flowerProvider/FlowerProvider.java | 34 +- .../FlowerProviderArsMagicaFlower.java | 146 +- .../FlowerProviderAuraNode.java | 95 +- .../FlowerProviderBookshelf.java | 57 +- .../flowerProvider/FlowerProviderBotania.java | 96 +- .../FlowerProviderThaumcraftFlower.java | 112 +- .../java/magicbees/block/BlockEffectJar.java | 156 +- .../magicbees/block/BlockEnchantedEarth.java | 107 +- src/main/java/magicbees/block/BlockHive.java | 155 +- .../magicbees/block/BlockMagicApiary.java | 40 +- .../block/BlockManaAuraProvider.java | 56 +- .../magicbees/block/BlockVisAuraProvider.java | 59 +- .../java/magicbees/block/MaterialHive.java | 15 +- .../java/magicbees/block/types/HiveType.java | 299 +- .../java/magicbees/block/types/PlankType.java | 77 +- .../client/gui/ContainerEffectJar.java | 182 +- .../magicbees/client/gui/ContainerMB.java | 15 +- .../client/gui/ContainerMagicApiary.java | 66 +- .../magicbees/client/gui/GUIEffectJar.java | 103 +- .../java/magicbees/client/gui/GUIHandler.java | 50 +- .../java/magicbees/client/gui/GuiFactory.java | 40 +- .../magicbees/client/gui/GuiMagicApiary.java | 156 +- .../magicbees/client/gui/ModGuiConfig.java | 55 +- .../magicbees/client/gui/SlotCustomItems.java | 145 +- .../java/magicbees/client/gui/SlotFrame.java | 8 +- .../java/magicbees/client/gui/UIScreens.java | 8 +- .../client/model/ModelEffectJar.java | 52 +- .../client/model/ModelVisAuraProvider.java | 60 +- .../client/render/RendererEffectJar.java | 111 +- .../render/RendererVisAuraProvider.java | 63 +- src/main/java/magicbees/item/ItemCapsule.java | 148 +- src/main/java/magicbees/item/ItemComb.java | 169 +- src/main/java/magicbees/item/ItemDrop.java | 145 +- src/main/java/magicbees/item/ItemGrafter.java | 85 +- .../java/magicbees/item/ItemMagicHive.java | 54 +- .../magicbees/item/ItemMagicHiveFrame.java | 84 +- .../magicbees/item/ItemManasteelGrafter.java | 72 +- .../magicbees/item/ItemManasteelScoop.java | 98 +- .../magicbees/item/ItemMiscResources.java | 104 +- .../java/magicbees/item/ItemMoonDial.java | 81 +- .../magicbees/item/ItemMysteriousMagnet.java | 345 +- src/main/java/magicbees/item/ItemNugget.java | 112 +- src/main/java/magicbees/item/ItemPollen.java | 143 +- .../java/magicbees/item/ItemPropolis.java | 100 +- .../magicbees/item/ItemThaumiumGrafter.java | 130 +- .../magicbees/item/ItemThaumiumScoop.java | 137 +- .../java/magicbees/item/ItemVoidGrafter.java | 181 +- .../java/magicbees/item/ItemVoidScoop.java | 187 +- src/main/java/magicbees/item/ItemWax.java | 122 +- .../magicbees/item/types/CapsuleType.java | 48 +- .../java/magicbees/item/types/CombType.java | 171 +- .../java/magicbees/item/types/DropType.java | 48 +- .../java/magicbees/item/types/FluidType.java | 113 +- .../magicbees/item/types/HiveFrameType.java | 202 +- .../java/magicbees/item/types/NuggetType.java | 79 +- .../java/magicbees/item/types/PollenType.java | 39 +- .../magicbees/item/types/PropolisType.java | 47 +- .../magicbees/item/types/ResourceType.java | 107 +- .../java/magicbees/item/types/WaxType.java | 42 +- src/main/java/magicbees/main/ClientProxy.java | 37 +- src/main/java/magicbees/main/CommonProxy.java | 30 +- src/main/java/magicbees/main/Config.java | 833 ++--- src/main/java/magicbees/main/MagicBees.java | 141 +- .../magicbees/main/utils/BlockInterface.java | 17 +- .../java/magicbees/main/utils/BlockUtil.java | 103 +- .../magicbees/main/utils/ChunkCoords.java | 162 +- .../magicbees/main/utils/CraftingManager.java | 1321 ++++---- .../java/magicbees/main/utils/IMCManager.java | 88 +- .../magicbees/main/utils/ItemInterface.java | 60 +- .../magicbees/main/utils/ItemStackUtils.java | 187 +- .../main/utils/LocalizationManager.java | 39 +- .../java/magicbees/main/utils/LogHelper.java | 66 +- .../java/magicbees/main/utils/MoonPhase.java | 81 +- .../magicbees/main/utils/TabMagicBees.java | 23 +- .../main/utils/TickHandlerVersion.java | 123 +- src/main/java/magicbees/main/utils/Tuple.java | 14 +- .../magicbees/main/utils/VersionInfo.java | 324 +- .../compat/AppliedEnergisticsHelper.java | 54 +- .../main/utils/compat/ArsMagicaHelper.java | 131 +- .../main/utils/compat/BotaniaHelper.java | 414 +-- .../compat/EquivalentExchangeHelper.java | 50 +- .../main/utils/compat/ExtraBeesHelper.java | 215 +- .../main/utils/compat/ForestryHelper.java | 296 +- .../main/utils/compat/IModHelper.java | 12 +- .../main/utils/compat/ModHelperManager.java | 68 +- .../utils/compat/RedstoneArsenalHelper.java | 72 +- .../main/utils/compat/ThaumcraftHelper.java | 1649 +++++---- .../main/utils/compat/ThermalModsHelper.java | 310 +- .../botania/BotaniaAPIDistanceHelper.java | 251 +- .../compat/botania/BotaniaLexiconEntry.java | 25 +- .../compat/botania/BotaniaSignature.java | 45 +- .../botania/SpeciesRecipeElvenTrade.java | 83 +- .../botania/SpeciesRecipeManaInfusion.java | 76 +- .../utils/compat/botania/SubTileBeegonia.java | 244 +- .../compat/botania/SubTileHibeescus.java | 331 +- .../compat/botania/SubTileHiveacynth.java | 133 +- .../utils/compat/thaumcraft/NodeHelper.java | 405 ++- .../error/InvalidEventTypeIndexException.java | 16 +- .../main/utils/net/EventAuraChargeUpdate.java | 89 +- .../magicbees/main/utils/net/EventBase.java | 167 +- .../magicbees/main/utils/net/EventCoords.java | 97 +- .../main/utils/net/EventFlagsUpdate.java | 119 +- .../main/utils/net/EventInventoryUpdate.java | 102 +- .../main/utils/net/NetworkEventHandler.java | 210 +- .../magicbees/storage/BackpackDefinition.java | 119 +- .../magicbees/tileentity/AuraCharges.java | 102 +- .../tileentity/EffectJarHousing.java | 347 +- .../tileentity/ITileEntityAuraCharged.java | 2 +- .../tileentity/ITileEntityFlags.java | 2 +- .../tileentity/TileEntityEffectJar.java | 394 ++- .../tileentity/TileEntityMagicApiary.java | 263 +- .../TileEntityManaAuraProvider.java | 254 +- .../tileentity/TileEntityVisAuraProvider.java | 201 +- .../world/feature/FeatureOreVein.java | 125 +- .../world/feature/HiveGenNether.java | 39 +- .../world/feature/HiveGenOblivion.java | 80 +- .../world/feature/HiveGenUnderground.java | 63 +- 156 files changed, 14896 insertions(+), 13422 deletions(-) diff --git a/src/main/java/magicbees/api/MagicBeesAPI.java b/src/main/java/magicbees/api/MagicBeesAPI.java index 44473e4..e5666d3 100644 --- a/src/main/java/magicbees/api/MagicBeesAPI.java +++ b/src/main/java/magicbees/api/MagicBeesAPI.java @@ -2,12 +2,11 @@ package magicbees.api; import magicbees.api.bees.ITransmutationEffectController; -public class MagicBeesAPI -{ - // Use this object during or after the Mod.Init phase to add your logic to the Transmutation bee effect. - public static ITransmutationEffectController transmutationEffectController; - - // This is a reference to the Tempus aspect. Initialized after MagicBees's post init phase. - // Ensure it is not null, and cast it to thaumcraft.api.aspects.Aspect. - public static Object thaumcraftAspectTempus; +public class MagicBeesAPI { + // Use this object during or after the Mod.Init phase to add your logic to the Transmutation bee effect. + public static ITransmutationEffectController transmutationEffectController; + + // This is a reference to the Tempus aspect. Initialized after MagicBees's post init phase. + // Ensure it is not null, and cast it to thaumcraft.api.aspects.Aspect. + public static Object thaumcraftAspectTempus; } diff --git a/src/main/java/magicbees/api/bees/AuraChargeType.java b/src/main/java/magicbees/api/bees/AuraChargeType.java index 0199873..90cb8e0 100644 --- a/src/main/java/magicbees/api/bees/AuraChargeType.java +++ b/src/main/java/magicbees/api/bees/AuraChargeType.java @@ -1,8 +1,8 @@ package magicbees.api.bees; public enum AuraChargeType { - MUTATION, - DEATH, - PRODUCTION, - ; + MUTATION, + DEATH, + PRODUCTION, + ; } diff --git a/src/main/java/magicbees/api/bees/IMagicApiaryAuraProvider.java b/src/main/java/magicbees/api/bees/IMagicApiaryAuraProvider.java index 8bc9fca..758b76e 100644 --- a/src/main/java/magicbees/api/bees/IMagicApiaryAuraProvider.java +++ b/src/main/java/magicbees/api/bees/IMagicApiaryAuraProvider.java @@ -2,45 +2,45 @@ package magicbees.api.bees; /** * Allows a tile entity to provide a Magic Apiary with 'aura' to boost bee production, mutation rate, - * or decrease bee lifespan. - * + * or decrease bee lifespan. + * * @author MysteriousAges */ public interface IMagicApiaryAuraProvider { - /** - * Requests a mutation charge from the aura provider. If true is returned, the - * aura provider should decrement its internal charge by one. If there are no - * charges remaining, it should return false. - * - * @return True if a charge is given; false otherwise. - */ - boolean getMutationCharge(); + /** + * Requests a mutation charge from the aura provider. If true is returned, the + * aura provider should decrement its internal charge by one. If there are no + * charges remaining, it should return false. + * + * @return True if a charge is given; false otherwise. + */ + boolean getMutationCharge(); - /** - * Requests a mutation charge from the aura provider. If true is returned, the - * aura provider should decrement its internal charge by one. If there are no - * charges remaining, it should return false. - * - * @return True if a charge is given; false otherwise. - */ - boolean getDeathRateCharge(); + /** + * Requests a mutation charge from the aura provider. If true is returned, the + * aura provider should decrement its internal charge by one. If there are no + * charges remaining, it should return false. + * + * @return True if a charge is given; false otherwise. + */ + boolean getDeathRateCharge(); - /** - * Requests a mutation charge from the aura provider. If true is returned, the - * aura provider should decrement its internal charge by one. If there are no - * charges remaining, it should return false. - * - * @return True if a charge is given; false otherwise. - */ - boolean getProductionCharge(); + /** + * Requests a mutation charge from the aura provider. If true is returned, the + * aura provider should decrement its internal charge by one. If there are no + * charges remaining, it should return false. + * + * @return True if a charge is given; false otherwise. + */ + boolean getProductionCharge(); - /** - * Requests a mutation charge from the aura provider. If true is returned, the - * aura provider should decrement its internal charge by one. If there are no - * charges remaining, it should return false. - * - * @return True if a charge is given; false otherwise. - */ - boolean getCharge(AuraChargeType auraChargeType); + /** + * Requests a mutation charge from the aura provider. If true is returned, the + * aura provider should decrement its internal charge by one. If there are no + * charges remaining, it should return false. + * + * @return True if a charge is given; false otherwise. + */ + boolean getCharge(AuraChargeType auraChargeType); } diff --git a/src/main/java/magicbees/api/bees/ITransmutationEffectController.java b/src/main/java/magicbees/api/bees/ITransmutationEffectController.java index 0c9b0da..c5333e3 100644 --- a/src/main/java/magicbees/api/bees/ITransmutationEffectController.java +++ b/src/main/java/magicbees/api/bees/ITransmutationEffectController.java @@ -3,12 +3,10 @@ package magicbees.api.bees; /** * Manages adding custom ITransmutationEffectLogic instances into the bee effect * system. - * + * * @author MysteriousAges * */ -public interface ITransmutationEffectController -{ - public void addEffectLogic(ITransmutationEffectLogic logic); - +public interface ITransmutationEffectController { + public void addEffectLogic(ITransmutationEffectLogic logic); } diff --git a/src/main/java/magicbees/api/bees/ITransmutationEffectLogic.java b/src/main/java/magicbees/api/bees/ITransmutationEffectLogic.java index e266723..64737ab 100644 --- a/src/main/java/magicbees/api/bees/ITransmutationEffectLogic.java +++ b/src/main/java/magicbees/api/bees/ITransmutationEffectLogic.java @@ -8,26 +8,25 @@ import net.minecraft.world.biome.BiomeGenBase; * Class to control plugin logic for the Transmutation bee effect. Turns blocks * into other blocks based on biome, time of day, or whatever is deemed * appropriate at the time. - * + * * @author MysteriousAges * */ -public interface ITransmutationEffectLogic -{ - /** - * Allows an external mod to add transmutation logic to the Transmuting bee effect. - * Called from a list of ITransmutationEffectLogic until one returns true. You can - * implement more than one transmutation effect in a single implementation of the - * interface. Function checks for a series of conditions based on block ID/meta, or - * biome information, or world information. - * - * @param world World object - * @param biome Biome information for current coordinates - * @param sourceBlock ItemStack representing the block at current coordinates - * @param x Current X coordinate to attempt a transmute - * @param y Current Y coordinate to attempt a transmute - * @param z Current Z coordinate to attempt a transmute - * @return true if a block was changed. - */ - public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z); +public interface ITransmutationEffectLogic { + /** + * Allows an external mod to add transmutation logic to the Transmuting bee effect. + * Called from a list of ITransmutationEffectLogic until one returns true. You can + * implement more than one transmutation effect in a single implementation of the + * interface. Function checks for a series of conditions based on block ID/meta, or + * biome information, or world information. + * + * @param world World object + * @param biome Biome information for current coordinates + * @param sourceBlock ItemStack representing the block at current coordinates + * @param x Current X coordinate to attempt a transmute + * @param y Current Y coordinate to attempt a transmute + * @param z Current Z coordinate to attempt a transmute + * @return true if a block was changed. + */ + public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z); } diff --git a/src/main/java/magicbees/bees/Allele.java b/src/main/java/magicbees/bees/Allele.java index 0df9afa..501661d 100644 --- a/src/main/java/magicbees/bees/Allele.java +++ b/src/main/java/magicbees/bees/Allele.java @@ -1,5 +1,15 @@ package magicbees.bees; +import forestry.api.apiculture.EnumBeeChromosome; +import forestry.api.apiculture.IAlleleBeeEffect; +import forestry.api.apiculture.IAlleleBeeSpecies; +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IAlleleEffect; +import forestry.api.genetics.IAlleleFlowers; +import forestry.api.genetics.IAlleleRegistry; +import forestry.api.genetics.IChromosomeType; +import forestry.api.genetics.IFlowerProvider; import magicbees.api.MagicBeesAPI; import magicbees.bees.allele.effect.AlleleEffectCrumbling; import magicbees.bees.allele.effect.AlleleEffectCure; @@ -30,287 +40,298 @@ import magicbees.main.utils.compat.ThermalModsHelper; import net.minecraft.potion.Potion; import thaumcraft.api.nodes.NodeType; -import forestry.api.apiculture.EnumBeeChromosome; -import forestry.api.apiculture.IAlleleBeeEffect; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleEffect; -import forestry.api.genetics.IAlleleFlowers; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IFlowerProvider; - public class Allele implements IAllele { - - private static final String FLOWER_ARS_MAGICA_PLANT = "flowerArsMagicaPlant"; - private static final String FLOWER_BOTANIA = "flowerBotania"; - private static final String EFFECT_TE_BLIZZY = "TEBlizzy"; - private static final String EFFECT_TE_BLITZ = "TEBlitz"; - private static final String EFFECT_TE_BASALZ = "TEBasalz"; - private static final String EFFECT_AM_WISP = "AMWisp"; - private static final String EFFECT_MANA_DRAIN = "ManaDrain"; - private static final String EFFECT_DREAMING = "Dreaming"; - private static final String EFFECT_WISPY = "Wispy"; - private static final String EFFECT_BATTY = "Batty"; - private static final String EFFECT_BRAINY = "Brainy"; - private static final String EFFECT_NODE_RAVENING = "NodeRavening"; - private static final String EFFECT_NODE_PURIFYING = "NodePurifying"; - private static final String EFFECT_NODE_TAINTING = "NodeTainting"; - private static final String EFFECT_NODE_REPAIR = "NodeRepair"; - private static final String EFFECT_NODE_EMPOWER = "NodeEmpower"; - private static final String EFFECT_VIS_RECHARGE = "VisRecharge"; - private static final String FLOWERS_AURA_NODE = "AuraNode"; - private static final String FLOWERS_THAUMCRAFT_PLANT = "ThaumcraftPlant"; - public static AlleleFloat speedBlinding; + private static final String FLOWER_ARS_MAGICA_PLANT = "flowerArsMagicaPlant"; + private static final String FLOWER_BOTANIA = "flowerBotania"; + private static final String EFFECT_TE_BLIZZY = "TEBlizzy"; + private static final String EFFECT_TE_BLITZ = "TEBlitz"; + private static final String EFFECT_TE_BASALZ = "TEBasalz"; + private static final String EFFECT_AM_WISP = "AMWisp"; + private static final String EFFECT_MANA_DRAIN = "ManaDrain"; + private static final String EFFECT_DREAMING = "Dreaming"; + private static final String EFFECT_WISPY = "Wispy"; + private static final String EFFECT_BATTY = "Batty"; + private static final String EFFECT_BRAINY = "Brainy"; + private static final String EFFECT_NODE_RAVENING = "NodeRavening"; + private static final String EFFECT_NODE_PURIFYING = "NodePurifying"; + private static final String EFFECT_NODE_TAINTING = "NodeTainting"; + private static final String EFFECT_NODE_REPAIR = "NodeRepair"; + private static final String EFFECT_NODE_EMPOWER = "NodeEmpower"; + private static final String EFFECT_VIS_RECHARGE = "VisRecharge"; + private static final String FLOWERS_AURA_NODE = "AuraNode"; + private static final String FLOWERS_THAUMCRAFT_PLANT = "ThaumcraftPlant"; - public static IAlleleBeeEffect forestryBaseEffect; + public static AlleleFloat speedBlinding; - public static IAlleleFlowers flowerBookshelf; - public static IAlleleFlowers flowerThaumcraft; - public static IAlleleFlowers flowerArsMagica; - public static IAlleleFlowers flowerAuraNode; - public static IAlleleFlowers flowerBotania; + public static IAlleleBeeEffect forestryBaseEffect; - public static IAlleleEffect effectCleansing; - public static IAlleleEffect effectDigSpeed; - public static IAlleleEffect effectMoveSpeed; - public static IAlleleEffect effectSlowSpeed; - public static IAlleleEffect effectWithering; - public static IAlleleEffect effectVisRecharge; - public static IAlleleEffect effectNodeEmpower; - public static IAlleleEffect effectNodeRepair; - public static IAlleleEffect effectNodeConversionTaint; - public static IAlleleEffect effectNodeConversionPure; - public static IAlleleEffect effectNodeConversionHungry; - public static IAlleleEffect effectTransmuting; - public static IAlleleEffect effectCrumbling; - public static IAlleleEffect effectInvisibility; - public static IAlleleEffect effectDreaming; + public static IAlleleFlowers flowerBookshelf; + public static IAlleleFlowers flowerThaumcraft; + public static IAlleleFlowers flowerArsMagica; + public static IAlleleFlowers flowerAuraNode; + public static IAlleleFlowers flowerBotania; - public static IAlleleEffect spawnWolf; - public static IAlleleEffect spawnBats; - public static IAlleleEffect spawnCow; - public static IAlleleEffect spawnChicken; - public static IAlleleEffect spawnPig; - public static IAlleleEffect spawnSheep; - public static IAlleleEffect spawnCat; - public static IAlleleEffect spawnHorse; - public static IAlleleEffect spawnGhast; - public static IAlleleEffect spawnSpider; - public static IAlleleEffect spawnBlaze; - public static IAlleleEffect spawnBrainyZombie; - public static IAlleleEffect spawnWisp; - public static IAlleleEffect spawnBlizz; - public static IAlleleEffect spawnBlitz; - public static IAlleleEffect spawnBasalz; - public static IAlleleEffect spawnManaDrainer; - public static IAlleleEffect spawnWispOrHecate; + public static IAlleleEffect effectCleansing; + public static IAlleleEffect effectDigSpeed; + public static IAlleleEffect effectMoveSpeed; + public static IAlleleEffect effectSlowSpeed; + public static IAlleleEffect effectWithering; + public static IAlleleEffect effectVisRecharge; + public static IAlleleEffect effectNodeEmpower; + public static IAlleleEffect effectNodeRepair; + public static IAlleleEffect effectNodeConversionTaint; + public static IAlleleEffect effectNodeConversionPure; + public static IAlleleEffect effectNodeConversionHungry; + public static IAlleleEffect effectTransmuting; + public static IAlleleEffect effectCrumbling; + public static IAlleleEffect effectInvisibility; + public static IAlleleEffect effectDreaming; - public static void setupAdditionalAlleles() { - forestryBaseEffect = (IAlleleBeeEffect) getBaseAllele("effectNone"); - IFlowerProvider vanillaFlowers = ((IAlleleFlowers)getBaseAllele("flowersVanilla")).getProvider(); + public static IAlleleEffect spawnWolf; + public static IAlleleEffect spawnBats; + public static IAlleleEffect spawnCow; + public static IAlleleEffect spawnChicken; + public static IAlleleEffect spawnPig; + public static IAlleleEffect spawnSheep; + public static IAlleleEffect spawnCat; + public static IAlleleEffect spawnHorse; + public static IAlleleEffect spawnGhast; + public static IAlleleEffect spawnSpider; + public static IAlleleEffect spawnBlaze; + public static IAlleleEffect spawnBrainyZombie; + public static IAlleleEffect spawnWisp; + public static IAlleleEffect spawnBlizz; + public static IAlleleEffect spawnBlitz; + public static IAlleleEffect spawnBasalz; + public static IAlleleEffect spawnManaDrainer; + public static IAlleleEffect spawnWispOrHecate; - speedBlinding = new AlleleFloat("speedBlinding", 2f, false, EnumBeeChromosome.SPEED); - flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true); + public static void setupAdditionalAlleles() { + forestryBaseEffect = (IAlleleBeeEffect) getBaseAllele("effectNone"); + IFlowerProvider vanillaFlowers = ((IAlleleFlowers) getBaseAllele("flowersVanilla")).getProvider(); - effectCleansing = new AlleleEffectCure("Curative", false); - effectDigSpeed = new AlleleEffectPotion("DigSpeed", Potion.digSpeed, 15, false); - effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false); - effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious(); - effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious(); + speedBlinding = new AlleleFloat("speedBlinding", 2f, false, EnumBeeChromosome.SPEED); + flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true); - TransmutationEffectController controller = new TransmutationEffectController( - new TransmutationEffectRailcraft(), - new TransmutationEffectVanilla() - ); - MagicBeesAPI.transmutationEffectController = controller; - effectTransmuting = new AlleleEffectTransmuting("Transmuting", true, controller, 200); - effectCrumbling = new AlleleEffectCrumbling("Crumbling", true); + effectCleansing = new AlleleEffectCure("Curative", false); + effectDigSpeed = new AlleleEffectPotion("DigSpeed", Potion.digSpeed, 15, false); + effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false); + effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious(); + effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious(); - effectInvisibility = new AlleleEffectPotion("Invisibility", Potion.invisibility, 10, false); + TransmutationEffectController controller = + new TransmutationEffectController(new TransmutationEffectRailcraft(), new TransmutationEffectVanilla()); + MagicBeesAPI.transmutationEffectController = controller; + effectTransmuting = new AlleleEffectTransmuting("Transmuting", true, controller, 200); + effectCrumbling = new AlleleEffectCrumbling("Crumbling", true); - spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan") - .setThrottle(2060) - .setChanceToSpawn(10) - .setMaxMobsInSpawnZone(1); - spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step") - .setThrottle(400) - .setChanceToSpawn(70) - .setMaxMobsInSpawnZone(4); - spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe") - .setThrottle(800) - .setChanceToSpawn(60) - .setMaxMobsInSpawnZone(2); - spawnWolf = new AlleleEffectSpawnMob("Canine", false , "Wolf", "mob.wolf.panting") - .setThrottle(650) - .setChanceToSpawn(40) - .setMaxMobsInSpawnZone(2); - spawnPig = new AlleleEffectSpawnMob("Porcine", true, "Pig", "mob.pig.say") - .setThrottle(350) - .setMaxMobsInSpawnZone(4); - spawnCow = new AlleleEffectSpawnMob("Bovine", true, "Cow", "mob.cow.say") - .setThrottle(640) - .setMaxMobsInSpawnZone(3); - spawnChicken = new AlleleEffectSpawnMob("Chicken", true, "Chicken", "mob.chicken.hurt") - .setThrottle(20) - .setMaxMobsInSpawnZone(20); - spawnSheep = new AlleleEffectSpawnMob("Sheep", false, "Sheep", "mob.sheep.say") - .setThrottle(450) - .setMaxMobsInSpawnZone(5); - spawnCat = new AlleleEffectSpawnMob("Catty", false, "Ozelot", "mob.cat.meow") - .setThrottle(702) - .setChanceToSpawn(60) - .setMaxMobsInSpawnZone(2); - spawnHorse = new AlleleEffectSpawnMob("Horse", false, "EntityHorse", "mob.horse.idle") - .setThrottle(450) - .setChanceToSpawn(59) - .setMaxMobsInSpawnZone(2); + effectInvisibility = new AlleleEffectPotion("Invisibility", Potion.invisibility, 10, false); - if (ThaumcraftHelper.isActive()) { - flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, new FlowerProviderThaumcraftFlower(), false); - flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, new FlowerProviderAuraNode(), true); - - effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false); - effectNodeEmpower = new AlleleEffectEmpowering(EFFECT_NODE_EMPOWER, false); - effectNodeRepair = new AlleleEffectNodeRepair(EFFECT_NODE_REPAIR, false); - effectNodeConversionTaint = new AlleleEffectNodeConversion(EFFECT_NODE_TAINTING, NodeType.TAINTED, false, 250); - effectNodeConversionPure = new AlleleEffectNodeConversion(EFFECT_NODE_PURIFYING, NodeType.PURE, false, 250); - effectNodeConversionHungry = new AlleleEffectNodeConversion(EFFECT_NODE_RAVENING, NodeType.HUNGRY, false, 2); + spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan") + .setThrottle(2060) + .setChanceToSpawn(10) + .setMaxMobsInSpawnZone(1); + spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step") + .setThrottle(400) + .setChanceToSpawn(70) + .setMaxMobsInSpawnZone(4); + spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe") + .setThrottle(800) + .setChanceToSpawn(60) + .setMaxMobsInSpawnZone(2); + spawnWolf = new AlleleEffectSpawnMob("Canine", false, "Wolf", "mob.wolf.panting") + .setThrottle(650) + .setChanceToSpawn(40) + .setMaxMobsInSpawnZone(2); + spawnPig = new AlleleEffectSpawnMob("Porcine", true, "Pig", "mob.pig.say") + .setThrottle(350) + .setMaxMobsInSpawnZone(4); + spawnCow = new AlleleEffectSpawnMob("Bovine", true, "Cow", "mob.cow.say") + .setThrottle(640) + .setMaxMobsInSpawnZone(3); + spawnChicken = new AlleleEffectSpawnMob("Chicken", true, "Chicken", "mob.chicken.hurt") + .setThrottle(20) + .setMaxMobsInSpawnZone(20); + spawnSheep = new AlleleEffectSpawnMob("Sheep", false, "Sheep", "mob.sheep.say") + .setThrottle(450) + .setMaxMobsInSpawnZone(5); + spawnCat = new AlleleEffectSpawnMob("Catty", false, "Ozelot", "mob.cat.meow") + .setThrottle(702) + .setChanceToSpawn(60) + .setMaxMobsInSpawnZone(2); + spawnHorse = new AlleleEffectSpawnMob("Horse", false, "EntityHorse", "mob.horse.idle") + .setThrottle(450) + .setChanceToSpawn(59) + .setMaxMobsInSpawnZone(2); - spawnBrainyZombie = new AlleleEffectSpawnMob(EFFECT_BRAINY, false, ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID) - .setAggrosPlayerOnSpawn() - .setThrottle(800) - .setSpawnsOnPlayerNear(null) - .setMaxMobsInSpawnZone(2); + if (ThaumcraftHelper.isActive()) { + flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, new FlowerProviderThaumcraftFlower(), false); + flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, new FlowerProviderAuraNode(), true); - spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, ThaumcraftHelper.Entity.FIREBAT.entityID) - .setThrottle(300) - .setSpawnsOnPlayerNear("Bat"); + effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false); + effectNodeEmpower = new AlleleEffectEmpowering(EFFECT_NODE_EMPOWER, false); + effectNodeRepair = new AlleleEffectNodeRepair(EFFECT_NODE_REPAIR, false); + effectNodeConversionTaint = + new AlleleEffectNodeConversion(EFFECT_NODE_TAINTING, NodeType.TAINTED, false, 250); + effectNodeConversionPure = new AlleleEffectNodeConversion(EFFECT_NODE_PURIFYING, NodeType.PURE, false, 250); + effectNodeConversionHungry = + new AlleleEffectNodeConversion(EFFECT_NODE_RAVENING, NodeType.HUNGRY, false, 2); - spawnWisp = new AlleleEffectSpawnWisp(EFFECT_WISPY, false, ThaumcraftHelper.Entity.WISP.entityID, "thaumcraft.wisplive") - .setThrottle(1800) - .setChanceToSpawn(79); - } - else { - spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, "Bat") - .setThrottle(150); - - flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, vanillaFlowers, false); - flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, vanillaFlowers, true);Allele.effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false); - effectNodeEmpower = new AlleleEffectPlaceholder(EFFECT_NODE_EMPOWER, false); - effectNodeRepair = new AlleleEffectPlaceholder(EFFECT_NODE_REPAIR, false); - effectNodeConversionTaint = new AlleleEffectPlaceholder(EFFECT_NODE_TAINTING, false); - effectNodeConversionPure = new AlleleEffectPlaceholder(EFFECT_NODE_PURIFYING, false); - effectNodeConversionHungry = new AlleleEffectPlaceholder(EFFECT_NODE_RAVENING, false); - spawnBrainyZombie = new AlleleEffectPlaceholder(EFFECT_BRAINY, false); - spawnWisp = new AlleleEffectPlaceholder(EFFECT_WISPY, false); - } + spawnBrainyZombie = new AlleleEffectSpawnMob( + EFFECT_BRAINY, false, ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID) + .setAggrosPlayerOnSpawn() + .setThrottle(800) + .setSpawnsOnPlayerNear(null) + .setMaxMobsInSpawnZone(2); - if (BotaniaHelper.isActive()) { - flowerBotania = new AlleleFlower(FLOWER_BOTANIA, new FlowerProviderBotania(), true); - effectDreaming = new AlleleEffectTransmuting(EFFECT_DREAMING, false, - new TransmutationEffectController(new TransmutationEffectLBotaniaLiving()), 100); - } - else { - flowerBotania = new AlleleFlower(FLOWER_BOTANIA, vanillaFlowers, true); - effectDreaming = new AlleleEffectPlaceholder(EFFECT_DREAMING, false); - } + spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, ThaumcraftHelper.Entity.FIREBAT.entityID) + .setThrottle(300) + .setSpawnsOnPlayerNear("Bat"); - if (ArsMagicaHelper.isActive()) { - flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, new FlowerProviderArsMagicaFlower(), false); - spawnManaDrainer = new AlleleEffectSpawnMobWeighted(EFFECT_MANA_DRAIN, true, 20, - new String[] { ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex" }, - new int[] { 60, 2 } - ); + spawnWisp = new AlleleEffectSpawnWisp( + EFFECT_WISPY, false, ThaumcraftHelper.Entity.WISP.entityID, "thaumcraft.wisplive") + .setThrottle(1800) + .setChanceToSpawn(79); + } else { + spawnBats = new AlleleEffectSpawnMob(EFFECT_BATTY, false, "Bat").setThrottle(150); - spawnWispOrHecate = new AlleleEffectSpawnMobWeighted(EFFECT_AM_WISP, true, 20, - new String[] { ArsMagicaHelper.Name + ".MobWisp", ArsMagicaHelper.Name + ".MobHecate" }, - new int[] { 40, 3 } - ); - } - else { - flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, vanillaFlowers, false); - spawnManaDrainer = new AlleleEffectPlaceholder(EFFECT_MANA_DRAIN, true); - spawnWispOrHecate = new AlleleEffectPlaceholder(EFFECT_AM_WISP, true); - } + flowerThaumcraft = new AlleleFlower(FLOWERS_THAUMCRAFT_PLANT, vanillaFlowers, false); + flowerAuraNode = new AlleleFlower(FLOWERS_AURA_NODE, vanillaFlowers, true); + Allele.effectVisRecharge = new AlleleEffectRecharge(EFFECT_VIS_RECHARGE, false); + effectNodeEmpower = new AlleleEffectPlaceholder(EFFECT_NODE_EMPOWER, false); + effectNodeRepair = new AlleleEffectPlaceholder(EFFECT_NODE_REPAIR, false); + effectNodeConversionTaint = new AlleleEffectPlaceholder(EFFECT_NODE_TAINTING, false); + effectNodeConversionPure = new AlleleEffectPlaceholder(EFFECT_NODE_PURIFYING, false); + effectNodeConversionHungry = new AlleleEffectPlaceholder(EFFECT_NODE_RAVENING, false); + spawnBrainyZombie = new AlleleEffectPlaceholder(EFFECT_BRAINY, false); + spawnWisp = new AlleleEffectPlaceholder(EFFECT_WISPY, false); + } - //TODO TE spawning - if (ThermalModsHelper.isActive()) { - spawnBlizz = new AlleleEffectSpawnMob(EFFECT_TE_BLIZZY, true, ThermalModsHelper.Entity.BLIZZ.entityID, ThermalModsHelper.Entity.BLIZZ.soundName) - .setThrottle(100) - .setChanceToSpawn(80); - spawnBlitz = new AlleleEffectSpawnMob(EFFECT_TE_BLITZ, true, ThermalModsHelper.Entity.BLITZ.entityID, ThermalModsHelper.Entity.BLITZ.soundName) - .setThrottle(100) - .setChanceToSpawn(80); - spawnBasalz = new AlleleEffectSpawnMob(EFFECT_TE_BASALZ, true, ThermalModsHelper.Entity.BASALZ.entityID, ThermalModsHelper.Entity.BASALZ.soundName) - .setThrottle(100) - .setChanceToSpawn(80); - } - else { - spawnBlizz = new AlleleEffectPlaceholder(EFFECT_TE_BLIZZY, true); - spawnBlitz = new AlleleEffectPlaceholder(EFFECT_TE_BLITZ, true); - spawnBasalz = new AlleleEffectPlaceholder(EFFECT_TE_BASALZ, true); - } - } + if (BotaniaHelper.isActive()) { + flowerBotania = new AlleleFlower(FLOWER_BOTANIA, new FlowerProviderBotania(), true); + effectDreaming = new AlleleEffectTransmuting( + EFFECT_DREAMING, + false, + new TransmutationEffectController(new TransmutationEffectLBotaniaLiving()), + 100); + } else { + flowerBotania = new AlleleFlower(FLOWER_BOTANIA, vanillaFlowers, true); + effectDreaming = new AlleleEffectPlaceholder(EFFECT_DREAMING, false); + } - public static void registerDeprecatedAlleleReplacements() { - IAlleleRegistry registry = AlleleManager.alleleRegistry; - - registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", effectNodeEmpower); - registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", effectNodeConversionPure); - registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", effectNodeConversionTaint); - registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", effectNodeEmpower); - registry.registerDeprecatedAlleleReplacement("magicbees.speciesTCAttractive", BeeSpecies.TC_EMPOWERING.getSpecies()); - registry.registerDeprecatedAlleleReplacement("magicbees.speciesBMBloodyBMBloody", BeeSpecies.EARTHY.getSpecies()); - registry.registerDeprecatedAlleleReplacement("magicbees.speciesBMBloodyBMBound", BeeSpecies.ARCANE.getSpecies()); - } + if (ArsMagicaHelper.isActive()) { + flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, new FlowerProviderArsMagicaFlower(), false); + spawnManaDrainer = new AlleleEffectSpawnMobWeighted( + EFFECT_MANA_DRAIN, + true, + 20, + new String[] {ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex"}, + new int[] {60, 2}); - public static IAlleleBeeSpecies getBaseSpecies(String name) { - return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("forestry.species").append(name).toString()); - } + spawnWispOrHecate = new AlleleEffectSpawnMobWeighted( + EFFECT_AM_WISP, + true, + 20, + new String[] {ArsMagicaHelper.Name + ".MobWisp", ArsMagicaHelper.Name + ".MobHecate"}, + new int[] {40, 3}); + } else { + flowerArsMagica = new AlleleFlower(FLOWER_ARS_MAGICA_PLANT, vanillaFlowers, false); + spawnManaDrainer = new AlleleEffectPlaceholder(EFFECT_MANA_DRAIN, true); + spawnWispOrHecate = new AlleleEffectPlaceholder(EFFECT_AM_WISP, true); + } - public static IAlleleBeeSpecies getExtraSpecies(String name) { - return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase()) - .toString()); - } + // TODO TE spawning + if (ThermalModsHelper.isActive()) { + spawnBlizz = new AlleleEffectSpawnMob( + EFFECT_TE_BLIZZY, + true, + ThermalModsHelper.Entity.BLIZZ.entityID, + ThermalModsHelper.Entity.BLIZZ.soundName) + .setThrottle(100) + .setChanceToSpawn(80); + spawnBlitz = new AlleleEffectSpawnMob( + EFFECT_TE_BLITZ, + true, + ThermalModsHelper.Entity.BLITZ.entityID, + ThermalModsHelper.Entity.BLITZ.soundName) + .setThrottle(100) + .setChanceToSpawn(80); + spawnBasalz = new AlleleEffectSpawnMob( + EFFECT_TE_BASALZ, + true, + ThermalModsHelper.Entity.BASALZ.entityID, + ThermalModsHelper.Entity.BASALZ.soundName) + .setThrottle(100) + .setChanceToSpawn(80); + } else { + spawnBlizz = new AlleleEffectPlaceholder(EFFECT_TE_BLIZZY, true); + spawnBlitz = new AlleleEffectPlaceholder(EFFECT_TE_BLITZ, true); + spawnBasalz = new AlleleEffectPlaceholder(EFFECT_TE_BASALZ, true); + } + } - public static IAllele getBaseAllele(String name) { - return AlleleManager.alleleRegistry.getAllele("forestry." + name); - } + public static void registerDeprecatedAlleleReplacements() { + IAlleleRegistry registry = AlleleManager.alleleRegistry; - public static IAllele getAllele(String name) { - return AlleleManager.alleleRegistry.getAllele(name); - } + registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", effectNodeEmpower); + registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", effectNodeConversionPure); + registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", effectNodeConversionTaint); + registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", effectNodeEmpower); + registry.registerDeprecatedAlleleReplacement( + "magicbees.speciesTCAttractive", BeeSpecies.TC_EMPOWERING.getSpecies()); + registry.registerDeprecatedAlleleReplacement( + "magicbees.speciesBMBloodyBMBloody", BeeSpecies.EARTHY.getSpecies()); + registry.registerDeprecatedAlleleReplacement( + "magicbees.speciesBMBloodyBMBound", BeeSpecies.ARCANE.getSpecies()); + } - private String uid; - private boolean dominant; + public static IAlleleBeeSpecies getBaseSpecies(String name) { + return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele( + (new StringBuilder()).append("forestry.species").append(name).toString()); + } - public Allele(String id, boolean isDominant, IChromosomeType... chromosomeTypes) { - this.uid = "magicbees." + id; - this.dominant = isDominant; - AlleleManager.alleleRegistry.registerAllele(this, chromosomeTypes); - } + public static IAlleleBeeSpecies getExtraSpecies(String name) { + return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()) + .append("extrabees.species.") + .append(name.toLowerCase()) + .toString()); + } - @Override - public String getUID() { - return this.uid; - } + public static IAllele getBaseAllele(String name) { + return AlleleManager.alleleRegistry.getAllele("forestry." + name); + } - @Override - public boolean isDominant() { - return this.dominant; - } + public static IAllele getAllele(String name) { + return AlleleManager.alleleRegistry.getAllele(name); + } - @Override - public String getName() { - return LocalizationManager.getLocalizedString(getUID()); - } + private String uid; + private boolean dominant; - @Override - public String getUnlocalizedName() { - return this.uid; - } + public Allele(String id, boolean isDominant, IChromosomeType... chromosomeTypes) { + this.uid = "magicbees." + id; + this.dominant = isDominant; + AlleleManager.alleleRegistry.registerAllele(this, chromosomeTypes); + } + @Override + public String getUID() { + return this.uid; + } + + @Override + public boolean isDominant() { + return this.dominant; + } + + @Override + public String getName() { + return LocalizationManager.getLocalizedString(getUID()); + } + + @Override + public String getUnlocalizedName() { + return this.uid; + } } diff --git a/src/main/java/magicbees/bees/AlleleEffect.java b/src/main/java/magicbees/bees/AlleleEffect.java index fd82ca0..e8d1239 100644 --- a/src/main/java/magicbees/bees/AlleleEffect.java +++ b/src/main/java/magicbees/bees/AlleleEffect.java @@ -1,95 +1,82 @@ package magicbees.bees; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; - import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.IAlleleBeeEffect; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; +import java.util.List; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; -public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect -{ - protected int throttle; - protected boolean combinable; +public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect { + protected int throttle; + protected boolean combinable; - public AlleleEffect(String id, boolean isDominant, int timeout) - { - super("effect" + id, isDominant, EnumBeeChromosome.EFFECT); - this.throttle = timeout; - combinable = false; - } + public AlleleEffect(String id, boolean isDominant, int timeout) { + super("effect" + id, isDominant, EnumBeeChromosome.EFFECT); + this.throttle = timeout; + combinable = false; + } - @Override - public boolean isCombinable() - { - return combinable; - } - - public AlleleEffect setIsCombinable(boolean canCombine) { - combinable = canCombine; - return this; - } + @Override + public boolean isCombinable() { + return combinable; + } - @Override - public abstract IEffectData validateStorage(IEffectData storedData); + public AlleleEffect setIsCombinable(boolean canCombine) { + combinable = canCombine; + return this; + } - @Override - public final IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) - { - int count = storedData.getInteger(0); - if (count >= this.throttle) - { - storedData = this.doEffectThrottled(genome, storedData, housing); - } - else - { - storedData.setInteger(0, count + 1); - } - return storedData; - } - - /** - * @param genome - * @param storedData - * @param housing - * @return - */ - protected abstract IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing); + @Override + public abstract IEffectData validateStorage(IEffectData storedData); - @Override - public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) - { - return Allele.forestryBaseEffect.doFX(genome, storedData, housing); - } - - @SuppressWarnings("unchecked") - protected List getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing, Class entityClass) - { - // Get the size of the affected area - int[] area = genome.getTerritory(); - ChunkCoordinates coords = housing.getCoordinates(); - - // Calculate offset - int[] min = new int[3]; - int[] max = new int[3]; - min[0] = coords.posX - area[0] / 2; - max[0] = coords.posX + area[0] / 2; - - min[1] = coords.posY - area[1] / 2; - max[1] = coords.posY + area[1] / 2; - - min[2] = coords.posZ - area[2] / 2; - max[2] = coords.posZ + area[2] / 2; - - AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]); - return (List)housing.getWorld().getEntitiesWithinAABB(entityClass, bounds); - } + @Override + public final IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + int count = storedData.getInteger(0); + if (count >= this.throttle) { + storedData = this.doEffectThrottled(genome, storedData, housing); + } else { + storedData.setInteger(0, count + 1); + } + return storedData; + } + /** + * @param genome + * @param storedData + * @param housing + * @return + */ + protected abstract IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing); + + @Override + public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + return Allele.forestryBaseEffect.doFX(genome, storedData, housing); + } + + @SuppressWarnings("unchecked") + protected List getEntitiesWithinRange( + IBeeGenome genome, IBeeHousing housing, Class entityClass) { + // Get the size of the affected area + int[] area = genome.getTerritory(); + ChunkCoordinates coords = housing.getCoordinates(); + + // Calculate offset + int[] min = new int[3]; + int[] max = new int[3]; + min[0] = coords.posX - area[0] / 2; + max[0] = coords.posX + area[0] / 2; + + min[1] = coords.posY - area[1] / 2; + max[1] = coords.posY + area[1] / 2; + + min[2] = coords.posZ - area[2] / 2; + max[2] = coords.posZ + area[2] / 2; + + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]); + return (List) housing.getWorld().getEntitiesWithinAABB(entityClass, bounds); + } } diff --git a/src/main/java/magicbees/bees/AlleleFloat.java b/src/main/java/magicbees/bees/AlleleFloat.java index ba962da..0d39aa2 100644 --- a/src/main/java/magicbees/bees/AlleleFloat.java +++ b/src/main/java/magicbees/bees/AlleleFloat.java @@ -3,20 +3,16 @@ package magicbees.bees; import forestry.api.genetics.IAlleleFloat; import forestry.api.genetics.IChromosomeType; -public class AlleleFloat extends Allele implements IAlleleFloat -{ - private float value; - - public AlleleFloat(String id, float val, boolean isDominant, IChromosomeType... chromosomeTypes) - { - super(id, isDominant, chromosomeTypes); - this.value = val; - } +public class AlleleFloat extends Allele implements IAlleleFloat { + private float value; - @Override - public float getValue() - { - return this.value; - } + public AlleleFloat(String id, float val, boolean isDominant, IChromosomeType... chromosomeTypes) { + super(id, isDominant, chromosomeTypes); + this.value = val; + } + @Override + public float getValue() { + return this.value; + } } diff --git a/src/main/java/magicbees/bees/AlleleFlower.java b/src/main/java/magicbees/bees/AlleleFlower.java index 95e9084..a4c4a59 100644 --- a/src/main/java/magicbees/bees/AlleleFlower.java +++ b/src/main/java/magicbees/bees/AlleleFlower.java @@ -1,29 +1,24 @@ package magicbees.bees; import forestry.api.apiculture.EnumBeeChromosome; -import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAlleleFlowers; import forestry.api.genetics.IFlowerProvider; -public class AlleleFlower extends Allele implements IAlleleFlowers -{ - private IFlowerProvider provider; - - public AlleleFlower(String uid, IFlowerProvider flowerProvider, boolean isDominant) - { - super("flower" + uid, isDominant, EnumBeeChromosome.FLOWER_PROVIDER); - this.provider = flowerProvider; - } +public class AlleleFlower extends Allele implements IAlleleFlowers { + private IFlowerProvider provider; - @Override - public IFlowerProvider getProvider() - { - return this.provider; - } + public AlleleFlower(String uid, IFlowerProvider flowerProvider, boolean isDominant) { + super("flower" + uid, isDominant, EnumBeeChromosome.FLOWER_PROVIDER); + this.provider = flowerProvider; + } - @Override - public String getName() { - return this.provider.getDescription(); - } + @Override + public IFlowerProvider getProvider() { + return this.provider; + } + @Override + public String getName() { + return this.provider.getDescription(); + } } diff --git a/src/main/java/magicbees/bees/AuraCharge.java b/src/main/java/magicbees/bees/AuraCharge.java index 6b9b657..9ed9464 100644 --- a/src/main/java/magicbees/bees/AuraCharge.java +++ b/src/main/java/magicbees/bees/AuraCharge.java @@ -3,31 +3,32 @@ package magicbees.bees; import magicbees.api.bees.AuraChargeType; public enum AuraCharge { - MUTATION(AuraChargeType.MUTATION, 850, 11), - DEATH(AuraChargeType.DEATH, 400, 5), - PRODUCTION(AuraChargeType.PRODUCTION, 300, 3), - ; + MUTATION(AuraChargeType.MUTATION, 850, 11), + DEATH(AuraChargeType.DEATH, 400, 5), + PRODUCTION(AuraChargeType.PRODUCTION, 300, 3), + ; - public final AuraChargeType type; - public final int duration; - /** The number of ticks to count between draining vis from the environment **/ - public final int tickRate; - public final int flag; + public final AuraChargeType type; + public final int duration; + /** The number of ticks to count between draining vis from the environment **/ + public final int tickRate; - AuraCharge(AuraChargeType chargeType, int duration, int tickRate) { - this.type = chargeType; - this.duration = duration; - this.tickRate = tickRate; - flag = 1 << ordinal(); - } - - public static AuraCharge fromChargeType(AuraChargeType type) { - for (AuraCharge charge : values()) { - if (type == charge.type) { - return charge; - } - } - - return null; - } + public final int flag; + + AuraCharge(AuraChargeType chargeType, int duration, int tickRate) { + this.type = chargeType; + this.duration = duration; + this.tickRate = tickRate; + flag = 1 << ordinal(); + } + + public static AuraCharge fromChargeType(AuraChargeType type) { + for (AuraCharge charge : values()) { + if (type == charge.type) { + return charge; + } + } + + return null; + } } diff --git a/src/main/java/magicbees/bees/BeeClassification.java b/src/main/java/magicbees/bees/BeeClassification.java index 6fe7153..9cdd477 100644 --- a/src/main/java/magicbees/bees/BeeClassification.java +++ b/src/main/java/magicbees/bees/BeeClassification.java @@ -1,128 +1,110 @@ package magicbees.bees; -import java.util.ArrayList; - -import magicbees.main.utils.LocalizationManager; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IClassification; +import java.util.ArrayList; +import magicbees.main.utils.LocalizationManager; -public enum BeeClassification implements IClassification -{ - VEILED("Veiled", "Velatapis"), - ARCANE("Arcane", "Arcanapis"), - SUPERNATURAL("Supernatural", "Occultapis"), - SCHOLARLY("Scholarly", "Doctapis"), - SKULKING("Skulking", "Malevolenapis"), - MAGICAL("Magic", "Magicapis"), - TIME("Time", "Tempestivapis"), - SOUL("Soul", "Animapis"), - - ABOMINABLE("Abominable", "Detestabilapis"), - EXTRINSIC("Extrinsic", "Extrarapis"), - - METALLIC("Metallic", "Metalliapis"), - GEM("Gem", "Lapidapis"), - TRANSMUTING("Transmuting", "Transmutapis"), - - THAUMIC("Thaumic", "Thaumiapis"), - FLESHY("Fleshy", "Carnosapis"), - - ALCHEMICAL("Alchemical", "Alchimiapis"), - - ESSENTIAL("Essential", "Essentiapis"), - - THERMAL("Thermal", "Thermametallic"), - ADORABLE("Adorable", "Amabilis"), +public enum BeeClassification implements IClassification { + VEILED("Veiled", "Velatapis"), + ARCANE("Arcane", "Arcanapis"), + SUPERNATURAL("Supernatural", "Occultapis"), + SCHOLARLY("Scholarly", "Doctapis"), + SKULKING("Skulking", "Malevolenapis"), + MAGICAL("Magic", "Magicapis"), + TIME("Time", "Tempestivapis"), + SOUL("Soul", "Animapis"), - BLOODY("Bloody", "Sanguis"), - - BOTANICAL("Botanical", "Botanica"), - ; - - private String uID; - private String latin; - private ArrayList species; - private IClassification parent; - private EnumClassLevel level; - - private BeeClassification(String name, String scientific) - { - this.uID = "classification." + name.toLowerCase(); - this.latin = scientific; - this.level = EnumClassLevel.GENUS; - this.species = new ArrayList(); - this.parent = AlleleManager.alleleRegistry.getClassification("family.apidae"); - AlleleManager.alleleRegistry.registerClassification(this); - } - - @Override - public EnumClassLevel getLevel() - { - return this.level; - } + ABOMINABLE("Abominable", "Detestabilapis"), + EXTRINSIC("Extrinsic", "Extrarapis"), - @Override - public String getUID() - { - return this.uID; - } + METALLIC("Metallic", "Metalliapis"), + GEM("Gem", "Lapidapis"), + TRANSMUTING("Transmuting", "Transmutapis"), - @Override - public String getName() - { - return LocalizationManager.getLocalizedString(getUID()); - } + THAUMIC("Thaumic", "Thaumiapis"), + FLESHY("Fleshy", "Carnosapis"), - @Override - public String getScientific() - { - return this.latin; - } + ALCHEMICAL("Alchemical", "Alchimiapis"), - @Override - public String getDescription() - { - return LocalizationManager.getLocalizedString(getUID() + ".description"); - } + ESSENTIAL("Essential", "Essentiapis"), - @Override - public IClassification[] getMemberGroups() - { - return null; - } + THERMAL("Thermal", "Thermametallic"), + ADORABLE("Adorable", "Amabilis"), - @Override - public void addMemberGroup(IClassification group) - { - - } + BLOODY("Bloody", "Sanguis"), - @Override - public IAlleleSpecies[] getMemberSpecies() - { - return this.species.toArray(new IAlleleSpecies[this.species.size()]); - } + BOTANICAL("Botanical", "Botanica"), + ; - @Override - public void addMemberSpecies(IAlleleSpecies species) - { - if (!this.species.contains(species)) - { - this.species.add(species); - } - } + private String uID; + private String latin; + private ArrayList species; + private IClassification parent; + private EnumClassLevel level; - @Override - public IClassification getParent() - { - return this.parent; - } + private BeeClassification(String name, String scientific) { + this.uID = "classification." + name.toLowerCase(); + this.latin = scientific; + this.level = EnumClassLevel.GENUS; + this.species = new ArrayList(); + this.parent = AlleleManager.alleleRegistry.getClassification("family.apidae"); + AlleleManager.alleleRegistry.registerClassification(this); + } - @Override - public void setParent(IClassification parent) - { - this.parent = parent; - } + @Override + public EnumClassLevel getLevel() { + return this.level; + } + @Override + public String getUID() { + return this.uID; + } + + @Override + public String getName() { + return LocalizationManager.getLocalizedString(getUID()); + } + + @Override + public String getScientific() { + return this.latin; + } + + @Override + public String getDescription() { + return LocalizationManager.getLocalizedString(getUID() + ".description"); + } + + @Override + public IClassification[] getMemberGroups() { + return null; + } + + @Override + public void addMemberGroup(IClassification group) {} + + @Override + public IAlleleSpecies[] getMemberSpecies() { + return this.species.toArray(new IAlleleSpecies[this.species.size()]); + } + + @Override + public void addMemberSpecies(IAlleleSpecies species) { + if (!this.species.contains(species)) { + this.species.add(species); + } + } + + @Override + public IClassification getParent() { + return this.parent; + } + + @Override + public void setParent(IClassification parent) { + this.parent = parent; + } } diff --git a/src/main/java/magicbees/bees/BeeGenomeManager.java b/src/main/java/magicbees/bees/BeeGenomeManager.java index 7da483e..9a4cb8d 100644 --- a/src/main/java/magicbees/bees/BeeGenomeManager.java +++ b/src/main/java/magicbees/bees/BeeGenomeManager.java @@ -1,14 +1,13 @@ package magicbees.bees; - +import forestry.api.apiculture.EnumBeeChromosome; +import forestry.api.apiculture.EnumBeeType; +import forestry.api.genetics.IAllele; import magicbees.main.utils.ItemInterface; import magicbees.main.utils.compat.ExtraBeesHelper; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import forestry.api.apiculture.EnumBeeChromosome; -import forestry.api.apiculture.EnumBeeType; -import forestry.api.genetics.IAllele; /** * Simply a class to hold all the functions to manage species' default genomes. @@ -16,1547 +15,1542 @@ import forestry.api.genetics.IAllele; * @author MysteriousAges */ public class BeeGenomeManager { - // Basic genome for All thaumic bees. - private static IAllele[] getTemplateModBase() { - IAllele[] genome = new IAllele[EnumBeeChromosome.values().length]; + // Basic genome for All thaumic bees. + private static IAllele[] getTemplateModBase() { + IAllele[] genome = new IAllele[EnumBeeChromosome.values().length]; - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MYSTICAL.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShorter"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolFalse"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolFalse"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolFalse"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersVanilla"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlowest"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryDefault"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectNone"); + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MYSTICAL.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShorter"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolFalse"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolFalse"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolFalse"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersVanilla"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlowest"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryDefault"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectNone"); - return genome; - } + return genome; + } - public static IAllele[] addRainResist(IAllele[] genome) { - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - - return genome; - } - - public static IAllele[] getTemplateMystical() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MYSTICAL.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateSorcerous() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SORCEROUS.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1"); - - return genome; - } - - public static IAllele[] getTemplateUnusual() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.UNUSUAL.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - - return genome; - } - - public static IAllele[] getTemplateAttuned() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ATTUNED.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - - return genome; - } - - public static IAllele[] getTemplateEldritch() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ELDRITCH.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlower"); - - return genome; - } - - // Basic genome for Arcane branch bees. - private static IAllele[] getTemplateBaseArcane() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlow"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - - return genome; - } + public static IAllele[] addRainResist(IAllele[] genome) { + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - // Specialization genome for Esoteric bees. - public static IAllele[] getTemplateEsoteric() { - IAllele[] genome = getTemplateBaseArcane(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ESOTERIC.getSpecies(); - - return genome; - } + return genome; + } - public static IAllele[] getTemplateMysterious() { - IAllele[] genome = getTemplateBaseArcane(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MYSTERIOUS.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - - return genome; - } + public static IAllele[] getTemplateMystical() { + IAllele[] genome = getTemplateModBase(); - public static IAllele[] getTemplateArcane() { - IAllele[] genome = getTemplateBaseArcane(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ARCANE.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringAverage"); - - return genome; - } + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MYSTICAL.getSpecies(); - private static IAllele[] getTemplateBaseSupernatural() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlowest"); - - return genome; - } + return genome; + } - public static IAllele[] getTemplateCharmed() { - IAllele[] genome = getTemplateBaseSupernatural(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CHARMED.getSpecies(); - - return genome; - } + public static IAllele[] getTemplateSorcerous() { + IAllele[] genome = getTemplateModBase(); - public static IAllele[] getTemplateEnchanted() { - IAllele[] genome = getTemplateBaseSupernatural(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ENCHANTED.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - - return genome; - } + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SORCEROUS.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1"); - public static IAllele[] getTemplateSupernatural() { - IAllele[] genome = getTemplateBaseSupernatural(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SUPERNATURAL.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - - return genome; - } - - public static IAllele[] getTemplateEthereal() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ETHEREAL.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortened"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringAverage"); - - return genome; - } - - private static IAllele[] getTemplateBaseElemental() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); - - return genome; - } - - public static IAllele[] getTemplateWatery() { - IAllele[] genome = getTemplateBaseElemental(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.WATERY.getSpecies(); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersSnow"); - - return genome; - } - - public static IAllele[] getTemplateFirey() { - IAllele[] genome = getTemplateBaseElemental(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.FIREY.getSpecies(); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown1"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersCacti"); - - return genome; - } - - public static IAllele[] getTemplateEarthy() { - IAllele[] genome = getTemplateBaseElemental(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.EARTHY.getSpecies(); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLong"); - - return genome; - } - - public static IAllele[] getTemplateWindy() { - IAllele[] genome = getTemplateBaseElemental(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.WINDY.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFaster"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster"); - - return genome; - } - - private static IAllele[] getTemplateBaseScholarly() { - IAllele[] genome = getTemplateModBase(); + return genome; + } - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerBookshelf; - - return genome; - } + public static IAllele[] getTemplateUnusual() { + IAllele[] genome = getTemplateModBase(); - public static IAllele[] getTemplatePupil() { - IAllele[] genome = getTemplateBaseScholarly(); + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.UNUSUAL.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.PUPIL.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlower"); - - return genome; - } + return genome; + } - public static IAllele[] getTemplateScholarly() { - IAllele[] genome = getTemplateBaseScholarly(); + public static IAllele[] getTemplateAttuned() { + IAllele[] genome = getTemplateModBase(); - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SCHOLARLY.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - - return genome; - } + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ATTUNED.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - public static IAllele[] getTemplateSavant() { - IAllele[] genome = getTemplateBaseScholarly(); + return genome; + } - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SAVANT.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - - return genome; - } - - private static IAllele[] getTemplateBaseSoul() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - - return genome; - } - - public static IAllele[] getTemplateAware() { - IAllele[] genome = getTemplateBaseSoul(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AWARE.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateSpirit() { - IAllele[] genome = getTemplateBaseSoul(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SPIRIT.getSpecies(); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortened"); - - return genome; - } - - public static IAllele[] getTemplateSoul() { - IAllele[] genome = getTemplateBaseSoul(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SOUL.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); - - return genome; - } - - private static IAllele[] getTemplateBaseMalevolent() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); - - return genome; - } - - public static IAllele[] getTemplateSkulking() { - IAllele[] genome = getTemplateBaseMalevolent(); + public static IAllele[] getTemplateEldritch() { + IAllele[] genome = getTemplateModBase(); - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SKULKING.getSpecies(); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - - return genome; - } - - public static IAllele[] getTemplateBatty() { - IAllele[] genome = getTemplateBaseMalevolent(); + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ELDRITCH.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlower"); - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BATTY.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBats; - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarge"); - - return genome; - } - - public static IAllele[] getTemplateChicken() { - IAllele[] genome = getTemplateBaseMalevolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CHICKEN.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnChicken; - - return genome; - } - - public static IAllele[] getTemplateBeef() { - IAllele[] genome = getTemplateBaseMalevolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BEEF.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnCow; - - return genome; - } - - public static IAllele[] getTemplatePork() { - IAllele[] genome = getTemplateBaseMalevolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.PORK.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnPig; - - return genome; - } + return genome; + } + // Basic genome for Arcane branch bees. + private static IAllele[] getTemplateBaseArcane() { + IAllele[] genome = getTemplateModBase(); - public static IAllele[] getTemplateBigbad() { - IAllele[] genome = getTemplateBaseMalevolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BIGBAD.getSpecies(); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnWolf; - - return genome; - } + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlow"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - public static IAllele[] getTemplateSheepish() { - IAllele[] genome = getTemplateBaseMalevolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SHEEPISH.getSpecies(); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnSheep; - - return genome; - } + return genome; + } - public static IAllele[] getTemplateHorse() { - IAllele[] genome = getTemplateBaseMalevolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.HORSE.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFastest"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnHorse; - - return genome; - } + // Specialization genome for Esoteric bees. + public static IAllele[] getTemplateEsoteric() { + IAllele[] genome = getTemplateBaseArcane(); - public static IAllele[] getTemplateCatty() { - IAllele[] genome = getTemplateBaseMalevolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CATTY.getSpecies(); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth3"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnCat; - - return genome; - } - - public static IAllele[] getTemplateGhastly() { - IAllele[] genome = getTemplateBaseMalevolent(); + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ESOTERIC.getSpecies(); - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.GHASTLY.getSpecies(); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnGhast; - - return genome; - } - - public static IAllele[] getTemplateSpidery() { - IAllele[] genome = getTemplateBaseMalevolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SPIDERY.getSpecies(); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnSpider; - - return genome; - } - - public static IAllele[] getTemplateBrainy() { - IAllele[] genome = getTemplateBaseMalevolent(); + return genome; + } - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BRAINY.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBrainyZombie; - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - - return genome; - } - - public static IAllele[] getTemplateSmouldering() { - IAllele[] genome = getTemplateBaseMalevolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SMOULDERING.getSpecies(); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBlaze; - - return genome; - } - - private static IAllele[] getTemplateBaseTemporal() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - - return genome; - } - - public static IAllele[] getTemplateTimely() { - IAllele[] genome = getTemplateBaseTemporal(); + public static IAllele[] getTemplateMysterious() { + IAllele[] genome = getTemplateBaseArcane(); - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TIMELY.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectSlowSpeed; - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); - - return genome; - } + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MYSTERIOUS.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - public static IAllele[] getTemplateLordly() { - IAllele[] genome = getTemplateBaseTemporal(); + return genome; + } - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.LORDLY.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectSlowSpeed; - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLong"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectDrunkard"); - - return genome; - } + public static IAllele[] getTemplateArcane() { + IAllele[] genome = getTemplateBaseArcane(); - public static IAllele[] getTemplateDoctoral() { - IAllele[] genome = getTemplateBaseTemporal(); + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ARCANE.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringAverage"); - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.DOCTORAL.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectSlowSpeed; - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth3"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarge"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectHeroic"); - - return genome; - } - - private static IAllele[] getTemplateAbominableBase() { - IAllele[] genome = getTemplateModBase(); + return genome; + } - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.INFERNAL.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersNether"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectAggressive"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShort"); - - return genome; - } - - public static IAllele[] getTemplateInfernal() { - IAllele[] genome = getTemplateAbominableBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.INFERNAL.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - - return genome; - } - - public static IAllele[] getTemplateHateful() { - IAllele[] genome = getTemplateAbominableBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.HATEFUL.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectMisanthrope"); - - return genome; - } - - public static IAllele[] getTemplateSpiteful() { - IAllele[] genome = getTemplateAbominableBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SPITEFUL.getSpecies(); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLong"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectMisanthrope"); - - return genome; - } - - public static IAllele[] getTemplateWithering() { - IAllele[] genome = getTemplateAbominableBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.WITHERING.getSpecies(); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectWithering; - - return genome; - } - - private static IAllele[] getTemplateBaseExtrinsic() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectAggressive"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersEnd"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - - return genome; - } - - public static IAllele[] getTemplateOblivion() { - IAllele[] genome = getTemplateBaseExtrinsic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.OBLIVION.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityMaximum"); - - return genome; - } - - public static IAllele[] getTemplateNameless() { - IAllele[] genome = getTemplateBaseExtrinsic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.NAMELESS.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - - return genome; - } - - public static IAllele[] getTemplateAbandoned() { - IAllele[] genome = getTemplateBaseExtrinsic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ABANDONED.getSpecies(); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectRepulsion"); - - return genome; - } - - public static IAllele[] getTemplateForlorn() { - IAllele[] genome = getTemplateBaseExtrinsic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.FORLORN.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectRepulsion"); - - return genome; - } - - public static IAllele[] getTemplateDraconic() { - IAllele[] genome = getTemplateBaseExtrinsic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.DRACONIC.getSpecies(); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectMisanthrope"); - - return genome; - } - - private static IAllele[] getTemplateBaseMetallic() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - - return genome; - } - - public static IAllele[] getTemplateIron() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.IRON.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateGold() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.GOLD.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateCopper() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.COPPER.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTin() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TIN.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateSilver() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SILVER.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateLead() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.LEAD.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateAluminum() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ALUMINUM.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateArdite() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ARDITE.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateCobalt() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.COBALT.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateManyullyn() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MANYULLYN.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateOsmium() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.OSMIUM.getSpecies(); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLonger"); - - return genome; - } - - public static IAllele[] getTemplateDiamond() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.DIAMOND.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateEmerald() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.EMERALD.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateApatite() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.APATITE.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); - - return genome; - } - + private static IAllele[] getTemplateBaseSupernatural() { + IAllele[] genome = getTemplateModBase(); - public static IAllele[] getTemplateSilicon() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SILICON.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - - return genome; - } + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlowest"); - public static IAllele[] getTemplateCertus() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CERTUS.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlower"); - - return genome; - } - + return genome; + } - public static IAllele[] getTemplateFluix() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.FLUIX.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); - - return genome; - } - - public static IAllele[] getTemplateMutableBase() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortest"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); - - return genome; - } - - public static IAllele[] getTemplateMutable() { - IAllele[] genome = getTemplateMutableBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MUTABLE.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTransmuting() { - IAllele[] genome = getTemplateMutableBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TRANSMUTING.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectTransmuting; - - return genome; - } - - public static IAllele[] getTemplateCrumbling() { - IAllele[] genome = getTemplateMutableBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CRUMBLING.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectCrumbling; - - return genome; - } - - public static IAllele[] getTemplateInvisible() { - IAllele[] genome = getTemplateMutableBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.INVISIBLE.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectInvisibility; - - return genome; - } - - private static IAllele[] getTemplateTCBase() { - IAllele[] genome = getTemplateModBase(); + public static IAllele[] getTemplateCharmed() { + IAllele[] genome = getTemplateBaseSupernatural(); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerThaumcraft; - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - - return genome; - } + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CHARMED.getSpecies(); - public static IAllele[] getTemplateTCChaos() { - IAllele[] genome = getTemplateTCBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_CHAOS.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); - - return genome; - } + return genome; + } - public static IAllele[] getTemplateTCAir() { - IAllele[] genome = getTemplateTCBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_AIR.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFastest"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortened"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringMaximum"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectMoveSpeed; - - return genome; - } + public static IAllele[] getTemplateEnchanted() { + IAllele[] genome = getTemplateBaseSupernatural(); - public static IAllele[] getTemplateTCFire() { - IAllele[] genome = getTemplateTCBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_FIRE.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFaster"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown3"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); - - return genome; - } + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ENCHANTED.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - public static IAllele[] getTemplateTCWater() { - IAllele[] genome = getTemplateTCBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_WATER.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLong"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarge"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectCleansing; - - return genome; - } + return genome; + } - public static IAllele[] getTemplateTCEarth() { - IAllele[] genome = getTemplateTCBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_EARTH.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLonger"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown1"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFastest"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectDigSpeed; - - return genome; - } - - public static IAllele[] getTemplateTCOrder() { - IAllele[] genome = getTemplateTCBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_ORDER.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); - - return genome; - } - - private static IAllele[] getTemplateTCBaseVis() { - IAllele[] genome = getTemplateTCBase(); + public static IAllele[] getTemplateSupernatural() { + IAllele[] genome = getTemplateBaseSupernatural(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerAuraNode; - - return genome; - } - - public static IAllele[] getTemplateTCVis() { - IAllele[] genome = getTemplateTCBaseVis(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_VIS.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlower"); + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SUPERNATURAL.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - return genome; - } - - public static IAllele[] getTemplateTCRejuvinating() { - IAllele[] genome = getTemplateTCBaseVis(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_REJUVENATING.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectVisRecharge; - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); - - return genome; - } - - public static IAllele[] getTemplateTCEmpowering() { - IAllele[] genome = getTemplateTCBaseVis(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_EMPOWERING.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeEmpower; - - return genome; - } - - public static IAllele[] getTemplateTCNexus() { - IAllele[] genome = getTemplateTCBaseVis(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_NEXUS.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeRepair; - - return genome; - } - - public static IAllele[] getTemplateTCTaint() { - IAllele[] genome = getTemplateTCBaseVis(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_TAINT.getSpecies(); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeConversionTaint; - - return genome; - } - - public static IAllele[] getTemplateTCPure() { - IAllele[] genome = getTemplateTCBaseVis(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_PURE.getSpecies(); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringAverage"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeConversionPure; - - return genome; - } - - public static IAllele[] getTemplateTCHungry() { - IAllele[] genome = getTemplateTCBaseVis(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_HUNGRY.getSpecies(); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeConversionHungry; - - return genome; - } - - public static IAllele[] getTemplateTCWispy() { - IAllele[] genome = getTemplateBaseMalevolent(); + return genome; + } - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_WISPY.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnWisp; - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerThaumcraft; - - return genome; - } - - public static IAllele[] getTemplaceTCVoid() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_VOID.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectGlacial"); - - return genome; } - - private static IAllele[] getTemplateEEBase() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarge"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - - return genome; - } - - public static IAllele[] getTemplateEEMinium() { - IAllele[] genome = getTemplateEEBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.EE_MINIUM.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectTransmuting; - - return genome; - } - - private static IAllele[] getTemplateAMBase() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerArsMagica; - - return genome; - } + public static IAllele[] getTemplateEthereal() { + IAllele[] genome = getTemplateModBase(); - public static IAllele[] getTemplateAMEssence() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_ESSENCE.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlow"); - - return genome; - } + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ETHEREAL.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortened"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringAverage"); - public static IAllele[] getTemplateAMQuintessence() { - IAllele[] genome = getTemplateAMEssence(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_QUINTESSENCE.getSpecies(); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringAverage"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectMisanthrope"); - - return genome; - } + return genome; + } - public static IAllele[] getTemplateAMEarth() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_EARTH.getSpecies(); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - - return genome; - } + private static IAllele[] getTemplateBaseElemental() { + IAllele[] genome = getTemplateModBase(); - public static IAllele[] getTemplateAMAir() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_AIR.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - - return genome; - } + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); - public static IAllele[] getTemplateAMFire() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_FIRE.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFast"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); - - return genome; - } + return genome; + } - public static IAllele[] getTemplateAMWater() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_WATER.getSpecies(); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown1"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); - - return genome; - } + public static IAllele[] getTemplateWatery() { + IAllele[] genome = getTemplateBaseElemental(); - public static IAllele[] getTemplateAMLightning() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_LIGHTNING.getSpecies(); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortest"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.speedBlinding; - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - - if (ExtraBeesHelper.isActive()) - { - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getAllele("extrabees.effect.lightning"); - } - - return genome; - } + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.WATERY.getSpecies(); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersSnow"); - public static IAllele[] getTemplateAMPlant() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_PLANT.getSpecies(); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFastest"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - - return genome; - } + return genome; + } - public static IAllele[] getTemplateAMIce() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_ICE.getSpecies(); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectGlacial"); - - return genome; - } + public static IAllele[] getTemplateFirey() { + IAllele[] genome = getTemplateBaseElemental(); - public static IAllele[] getTemplateAMArcane() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_ARCANE.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - - return genome; - } - - public static IAllele[] getTemplateAMVortex() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_VORTEX.getSpecies(); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLonger"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnManaDrainer; - - return genome; - } - - public static IAllele[] getTemplateAMWight() { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_WIGHT.getSpecies(); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnWispOrHecate; - - return genome; - } - - private static IAllele[] getTemplateTEBase() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLonger"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersVanilla"); - - - return genome; - } - - private static IAllele[] getTemplateTEBaseNether() { - IAllele[] genome = getTemplateTEBase(); - - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersNether"); - - - return genome; - } - - private static IAllele[] getTemplateTEEnd() { - IAllele[] genome = getTemplateTEBase(); - - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFastest"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); - - return genome; - } - - public static IAllele[] getTemplateTEElectrum() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_ELECTRUM.getSpecies(); - - return genome; - } + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.FIREY.getSpecies(); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown1"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersCacti"); - public static IAllele[] getTemplateTEPlatinum() { - IAllele[] genome = getTemplateTEBaseNether(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_PLATINUM.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTENickel() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_NICKEL.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTEInvar() { - IAllele[] genome = getTemplateTEBaseNether(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_INVAR.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTEBronze() { - IAllele[] genome = getTemplateBaseMetallic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_BRONZE.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateRSAFluxed() { - IAllele[] genome = getTemplateTEBaseNether(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.RSA_FLUXED.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTEDestabilized() { - IAllele[] genome = getTemplateTEBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_DESTABILIZED.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTELux() { - IAllele[] genome = getTemplateTEBaseNether(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_LUX.getSpecies(); - - return genome; - } + return genome; + } - public static IAllele[] getTemplateTEWinsome() { - IAllele[] genome = getTemplateTEBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_WINSOME.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTEEndearing() { - IAllele[] genome = getTemplateTEEnd(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_ENDEARING.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTESignalus() { - IAllele[] genome = getTemplateTEBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_SIGNALUS.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTELumius() { - IAllele[] genome = getTemplateTEBaseNether(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_LUMIUS.getSpecies(); - - return genome; - } + public static IAllele[] getTemplateEarthy() { + IAllele[] genome = getTemplateBaseElemental(); - public static IAllele[] getTemplateTEDante() { - IAllele[] genome = getTemplateTEBaseNether(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_DANTE.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateTEPyro() { - IAllele[] genome = getTemplateTEEnd(); - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_PYRO.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.EARTHY.getSpecies(); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLong"); - return genome; - } - - public static IAllele[] getTemplateTEBlizzy() { - IAllele[] genome = getTemplateTEEnd(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_BLIZZY.getSpecies(); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersSnow"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectGlacial"); - - return genome; - } - - public static IAllele[] getTemplateTEGelid() { - IAllele[] genome = getTemplateTEBlizzy(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_GELID.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBlizz; - - return genome; - } - - public static IAllele[] getTemplateTEShocking() { - IAllele[] genome = getTemplateTEEnd(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_SHOCKING.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); - - return genome; - } - - public static IAllele[] getTemplateTEAmped() { - IAllele[] genome = getTemplateTEShocking(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_AMPED.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBlitz; - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.speedBlinding; - - return genome; - } - - public static IAllele[] getTemplateTEGrounded() { - IAllele[] genome = getTemplateTEEnd(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_GROUNDED.getSpecies(); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - - return genome; - } - - public static IAllele[] getTemplateTERocking() { - IAllele[] genome = getTemplateTEGrounded(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_ROCKING.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFaster"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBasalz; - - return genome; - } - - public static IAllele[] getTemplateTECoal() { - IAllele[] genome = getTemplateTEBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_COAL.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateBotaniaBase() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlower"); - - return genome; - } - - public static IAllele[] getTemplateBotRooted() { - IAllele[] genome = getTemplateBotaniaBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_ROOTED.getSpecies(); - - return genome; - } - - public static IAllele[] getTemplateBotBotanic() { - IAllele[] genome = getTemplateBotRooted(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_BOTANIC.getSpecies(); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerBotania; - - return genome; - } - - public static IAllele[] getTemplateBotBlossom() { - IAllele[] genome = getTemplateBotBotanic(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_BLOSSOM.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityMaximum"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster"); - - return genome; - } - - public static IAllele[] getTemplateBotFloral() { - IAllele[] genome = getTemplateBotBlossom(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_FLORAL.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); - genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringMaximum"); - - return genome; - } - - public static IAllele[] getTemplateBotVazbee() { - IAllele[] genome = getTemplateBotFloral(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_VAZBEE.getSpecies(); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - - return genome; - } - - public static IAllele[] getTemplateBotSomnolent() { - IAllele[] genome = getTemplateBotaniaBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_SOMNOLENT.getSpecies(); - genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerBotania; - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); - genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectSlowSpeed; - - return genome; - } - - public static IAllele[] getTemplateBotDreaming() { - IAllele[] genome = getTemplateBotSomnolent(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_DREAMING.getSpecies(); - genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); - genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); - - return genome; - } + return genome; + } - public static IAllele[] getTemplateBotAelfheim() { - IAllele[] genome = getTemplateBotDreaming(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_ALFHEIM.getSpecies(); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectDreaming; - - return genome; - } - - public static IAllele[] getTemplateAESkystone() { - IAllele[] genome = getTemplateModBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AE_SKYSTONE.getSpecies(); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); - - return genome; - } - - /*--------------------- Other Stuff ---------------------------------- */ - - public static ItemStack getBeeNBTForSpecies(BeeSpecies species, EnumBeeType beeType) { - ItemStack taggedBee; - switch (beeType) { - case PRINCESS: - taggedBee = ItemInterface.getItemStack("beePrincessGE"); - break; - case QUEEN: - taggedBee = ItemInterface.getItemStack("beeQueenGE"); - break; - case DRONE: - default: - taggedBee = ItemInterface.getItemStack("beeDroneGE"); - break; - } - - NBTTagCompound tags = new NBTTagCompound(); - - addGeneToCompound(EnumBeeChromosome.SPECIES, species.getSpecies(), tags); - - taggedBee.setTagCompound(tags); - - return taggedBee; - } - - private static void addGeneToCompound(EnumBeeChromosome gene, IAllele allele, NBTTagCompound compound) { - NBTTagCompound geneRoot = new NBTTagCompound(); - compound.setTag("Genome", geneRoot); - NBTTagList chromosomes = new NBTTagList(); - geneRoot.setTag("Chromosomes", chromosomes); - - NBTTagCompound selectedGene = new NBTTagCompound(); - chromosomes.appendTag(selectedGene); - - selectedGene.setByte("Slot", (byte)gene.ordinal()); - selectedGene.setString("UID0", allele.getUID()); - selectedGene.setString("UID1", allele.getUID()); - } + public static IAllele[] getTemplateWindy() { + IAllele[] genome = getTemplateBaseElemental(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.WINDY.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFaster"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster"); + + return genome; + } + + private static IAllele[] getTemplateBaseScholarly() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerBookshelf; + + return genome; + } + + public static IAllele[] getTemplatePupil() { + IAllele[] genome = getTemplateBaseScholarly(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.PUPIL.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlower"); + + return genome; + } + + public static IAllele[] getTemplateScholarly() { + IAllele[] genome = getTemplateBaseScholarly(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SCHOLARLY.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + + return genome; + } + + public static IAllele[] getTemplateSavant() { + IAllele[] genome = getTemplateBaseScholarly(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SAVANT.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + + return genome; + } + + private static IAllele[] getTemplateBaseSoul() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + + return genome; + } + + public static IAllele[] getTemplateAware() { + IAllele[] genome = getTemplateBaseSoul(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AWARE.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateSpirit() { + IAllele[] genome = getTemplateBaseSoul(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SPIRIT.getSpecies(); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortened"); + + return genome; + } + + public static IAllele[] getTemplateSoul() { + IAllele[] genome = getTemplateBaseSoul(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SOUL.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); + + return genome; + } + + private static IAllele[] getTemplateBaseMalevolent() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); + + return genome; + } + + public static IAllele[] getTemplateSkulking() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SKULKING.getSpecies(); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + + return genome; + } + + public static IAllele[] getTemplateBatty() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BATTY.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBats; + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarge"); + + return genome; + } + + public static IAllele[] getTemplateChicken() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CHICKEN.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnChicken; + + return genome; + } + + public static IAllele[] getTemplateBeef() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BEEF.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnCow; + + return genome; + } + + public static IAllele[] getTemplatePork() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.PORK.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnPig; + + return genome; + } + + public static IAllele[] getTemplateBigbad() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BIGBAD.getSpecies(); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnWolf; + + return genome; + } + + public static IAllele[] getTemplateSheepish() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SHEEPISH.getSpecies(); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnSheep; + + return genome; + } + + public static IAllele[] getTemplateHorse() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.HORSE.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFastest"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnHorse; + + return genome; + } + + public static IAllele[] getTemplateCatty() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CATTY.getSpecies(); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth3"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnCat; + + return genome; + } + + public static IAllele[] getTemplateGhastly() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.GHASTLY.getSpecies(); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnGhast; + + return genome; + } + + public static IAllele[] getTemplateSpidery() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SPIDERY.getSpecies(); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnSpider; + + return genome; + } + + public static IAllele[] getTemplateBrainy() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BRAINY.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBrainyZombie; + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + + return genome; + } + + public static IAllele[] getTemplateSmouldering() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SMOULDERING.getSpecies(); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBlaze; + + return genome; + } + + private static IAllele[] getTemplateBaseTemporal() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + + return genome; + } + + public static IAllele[] getTemplateTimely() { + IAllele[] genome = getTemplateBaseTemporal(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TIMELY.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectSlowSpeed; + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); + + return genome; + } + + public static IAllele[] getTemplateLordly() { + IAllele[] genome = getTemplateBaseTemporal(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.LORDLY.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectSlowSpeed; + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLong"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectDrunkard"); + + return genome; + } + + public static IAllele[] getTemplateDoctoral() { + IAllele[] genome = getTemplateBaseTemporal(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.DOCTORAL.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectSlowSpeed; + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth3"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarge"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectHeroic"); + + return genome; + } + + private static IAllele[] getTemplateAbominableBase() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.INFERNAL.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersNether"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectAggressive"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShort"); + + return genome; + } + + public static IAllele[] getTemplateInfernal() { + IAllele[] genome = getTemplateAbominableBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.INFERNAL.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + + return genome; + } + + public static IAllele[] getTemplateHateful() { + IAllele[] genome = getTemplateAbominableBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.HATEFUL.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectMisanthrope"); + + return genome; + } + + public static IAllele[] getTemplateSpiteful() { + IAllele[] genome = getTemplateAbominableBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SPITEFUL.getSpecies(); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLong"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectMisanthrope"); + + return genome; + } + + public static IAllele[] getTemplateWithering() { + IAllele[] genome = getTemplateAbominableBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.WITHERING.getSpecies(); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectWithering; + + return genome; + } + + private static IAllele[] getTemplateBaseExtrinsic() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectAggressive"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersEnd"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + + return genome; + } + + public static IAllele[] getTemplateOblivion() { + IAllele[] genome = getTemplateBaseExtrinsic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.OBLIVION.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityMaximum"); + + return genome; + } + + public static IAllele[] getTemplateNameless() { + IAllele[] genome = getTemplateBaseExtrinsic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.NAMELESS.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + + return genome; + } + + public static IAllele[] getTemplateAbandoned() { + IAllele[] genome = getTemplateBaseExtrinsic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ABANDONED.getSpecies(); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectRepulsion"); + + return genome; + } + + public static IAllele[] getTemplateForlorn() { + IAllele[] genome = getTemplateBaseExtrinsic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.FORLORN.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectRepulsion"); + + return genome; + } + + public static IAllele[] getTemplateDraconic() { + IAllele[] genome = getTemplateBaseExtrinsic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.DRACONIC.getSpecies(); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectMisanthrope"); + + return genome; + } + + private static IAllele[] getTemplateBaseMetallic() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + + return genome; + } + + public static IAllele[] getTemplateIron() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.IRON.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateGold() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.GOLD.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateCopper() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.COPPER.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTin() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TIN.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateSilver() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SILVER.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateLead() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.LEAD.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateAluminum() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ALUMINUM.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateArdite() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.ARDITE.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateCobalt() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.COBALT.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateManyullyn() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MANYULLYN.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateOsmium() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.OSMIUM.getSpecies(); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLonger"); + + return genome; + } + + public static IAllele[] getTemplateDiamond() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.DIAMOND.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateEmerald() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.EMERALD.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateApatite() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.APATITE.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); + + return genome; + } + + public static IAllele[] getTemplateSilicon() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.SILICON.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + + return genome; + } + + public static IAllele[] getTemplateCertus() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CERTUS.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlower"); + + return genome; + } + + public static IAllele[] getTemplateFluix() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.FLUIX.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); + + return genome; + } + + public static IAllele[] getTemplateMutableBase() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortest"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); + + return genome; + } + + public static IAllele[] getTemplateMutable() { + IAllele[] genome = getTemplateMutableBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.MUTABLE.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTransmuting() { + IAllele[] genome = getTemplateMutableBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TRANSMUTING.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectTransmuting; + + return genome; + } + + public static IAllele[] getTemplateCrumbling() { + IAllele[] genome = getTemplateMutableBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.CRUMBLING.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectCrumbling; + + return genome; + } + + public static IAllele[] getTemplateInvisible() { + IAllele[] genome = getTemplateMutableBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.INVISIBLE.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectInvisibility; + + return genome; + } + + private static IAllele[] getTemplateTCBase() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerThaumcraft; + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + + return genome; + } + + public static IAllele[] getTemplateTCChaos() { + IAllele[] genome = getTemplateTCBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_CHAOS.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityNormal"); + + return genome; + } + + public static IAllele[] getTemplateTCAir() { + IAllele[] genome = getTemplateTCBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_AIR.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFastest"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortened"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringMaximum"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectMoveSpeed; + + return genome; + } + + public static IAllele[] getTemplateTCFire() { + IAllele[] genome = getTemplateTCBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_FIRE.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFaster"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown3"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); + + return genome; + } + + public static IAllele[] getTemplateTCWater() { + IAllele[] genome = getTemplateTCBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_WATER.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLong"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarge"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectCleansing; + + return genome; + } + + public static IAllele[] getTemplateTCEarth() { + IAllele[] genome = getTemplateTCBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_EARTH.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLonger"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown1"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFastest"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectDigSpeed; + + return genome; + } + + public static IAllele[] getTemplateTCOrder() { + IAllele[] genome = getTemplateTCBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_ORDER.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanNormal"); + + return genome; + } + + private static IAllele[] getTemplateTCBaseVis() { + IAllele[] genome = getTemplateTCBase(); + + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerAuraNode; + + return genome; + } + + public static IAllele[] getTemplateTCVis() { + IAllele[] genome = getTemplateTCBaseVis(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_VIS.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlower"); + + return genome; + } + + public static IAllele[] getTemplateTCRejuvinating() { + IAllele[] genome = getTemplateTCBaseVis(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_REJUVENATING.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectVisRecharge; + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); + + return genome; + } + + public static IAllele[] getTemplateTCEmpowering() { + IAllele[] genome = getTemplateTCBaseVis(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_EMPOWERING.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeEmpower; + + return genome; + } + + public static IAllele[] getTemplateTCNexus() { + IAllele[] genome = getTemplateTCBaseVis(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_NEXUS.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeRepair; + + return genome; + } + + public static IAllele[] getTemplateTCTaint() { + IAllele[] genome = getTemplateTCBaseVis(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_TAINT.getSpecies(); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeConversionTaint; + + return genome; + } + + public static IAllele[] getTemplateTCPure() { + IAllele[] genome = getTemplateTCBaseVis(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_PURE.getSpecies(); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringAverage"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeConversionPure; + + return genome; + } + + public static IAllele[] getTemplateTCHungry() { + IAllele[] genome = getTemplateTCBaseVis(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_HUNGRY.getSpecies(); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceNone"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectNodeConversionHungry; + + return genome; + } + + public static IAllele[] getTemplateTCWispy() { + IAllele[] genome = getTemplateBaseMalevolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_WISPY.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnWisp; + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerThaumcraft; + + return genome; + } + + public static IAllele[] getTemplaceTCVoid() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TC_VOID.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp1"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectGlacial"); + + return genome; + } + + private static IAllele[] getTemplateEEBase() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarge"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + + return genome; + } + + public static IAllele[] getTemplateEEMinium() { + IAllele[] genome = getTemplateEEBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.EE_MINIUM.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectTransmuting; + + return genome; + } + + private static IAllele[] getTemplateAMBase() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerArsMagica; + + return genome; + } + + public static IAllele[] getTemplateAMEssence() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_ESSENCE.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringSlow"); + + return genome; + } + + public static IAllele[] getTemplateAMQuintessence() { + IAllele[] genome = getTemplateAMEssence(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_QUINTESSENCE.getSpecies(); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringAverage"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectMisanthrope"); + + return genome; + } + + public static IAllele[] getTemplateAMEarth() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_EARTH.getSpecies(); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + + return genome; + } + + public static IAllele[] getTemplateAMAir() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_AIR.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); + + return genome; + } + + public static IAllele[] getTemplateAMFire() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_FIRE.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFast"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); + + return genome; + } + + public static IAllele[] getTemplateAMWater() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_WATER.getSpecies(); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown1"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); + + return genome; + } + + public static IAllele[] getTemplateAMLightning() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_LIGHTNING.getSpecies(); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanShortest"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLargest"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.speedBlinding; + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + + if (ExtraBeesHelper.isActive()) { + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getAllele("extrabees.effect.lightning"); + } + + return genome; + } + + public static IAllele[] getTemplateAMPlant() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_PLANT.getSpecies(); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFastest"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + + return genome; + } + + public static IAllele[] getTemplateAMIce() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_ICE.getSpecies(); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectGlacial"); + + return genome; + } + + public static IAllele[] getTemplateAMArcane() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_ARCANE.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + + return genome; + } + + public static IAllele[] getTemplateAMVortex() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_VORTEX.getSpecies(); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLonger"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnManaDrainer; + + return genome; + } + + public static IAllele[] getTemplateAMWight() { + IAllele[] genome = getTemplateAMBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_WIGHT.getSpecies(); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnWispOrHecate; + + return genome; + } + + private static IAllele[] getTemplateTEBase() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLonger"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersVanilla"); + + return genome; + } + + private static IAllele[] getTemplateTEBaseNether() { + IAllele[] genome = getTemplateTEBase(); + + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlow"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersNether"); + + return genome; + } + + private static IAllele[] getTemplateTEEnd() { + IAllele[] genome = getTemplateTEBase(); + + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFastest"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth2"); + genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanLongest"); + + return genome; + } + + public static IAllele[] getTemplateTEElectrum() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_ELECTRUM.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTEPlatinum() { + IAllele[] genome = getTemplateTEBaseNether(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_PLATINUM.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTENickel() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_NICKEL.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTEInvar() { + IAllele[] genome = getTemplateTEBaseNether(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_INVAR.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTEBronze() { + IAllele[] genome = getTemplateBaseMetallic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_BRONZE.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateRSAFluxed() { + IAllele[] genome = getTemplateTEBaseNether(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.RSA_FLUXED.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTEDestabilized() { + IAllele[] genome = getTemplateTEBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_DESTABILIZED.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTELux() { + IAllele[] genome = getTemplateTEBaseNether(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_LUX.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTEWinsome() { + IAllele[] genome = getTemplateTEBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_WINSOME.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTEEndearing() { + IAllele[] genome = getTemplateTEEnd(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_ENDEARING.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTESignalus() { + IAllele[] genome = getTemplateTEBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_SIGNALUS.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTELumius() { + IAllele[] genome = getTemplateTEBaseNether(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_LUMIUS.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTEDante() { + IAllele[] genome = getTemplateTEBaseNether(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_DANTE.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateTEPyro() { + IAllele[] genome = getTemplateTEEnd(); + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_PYRO.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); + + return genome; + } + + public static IAllele[] getTemplateTEBlizzy() { + IAllele[] genome = getTemplateTEEnd(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_BLIZZY.getSpecies(); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.getBaseAllele("flowersSnow"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectGlacial"); + + return genome; + } + + public static IAllele[] getTemplateTEGelid() { + IAllele[] genome = getTemplateTEBlizzy(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_GELID.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBlizz; + + return genome; + } + + public static IAllele[] getTemplateTEShocking() { + IAllele[] genome = getTemplateTEEnd(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_SHOCKING.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFast"); + + return genome; + } + + public static IAllele[] getTemplateTEAmped() { + IAllele[] genome = getTemplateTEShocking(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_AMPED.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBlitz; + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.speedBlinding; + + return genome; + } + + public static IAllele[] getTemplateTEGrounded() { + IAllele[] genome = getTemplateTEEnd(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_GROUNDED.getSpecies(); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + + return genome; + } + + public static IAllele[] getTemplateTERocking() { + IAllele[] genome = getTemplateTEGrounded(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_ROCKING.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedFaster"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.spawnBasalz; + + return genome; + } + + public static IAllele[] getTemplateTECoal() { + IAllele[] genome = getTemplateTEBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.TE_COAL.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateBotaniaBase() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceBoth1"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlower"); + + return genome; + } + + public static IAllele[] getTemplateBotRooted() { + IAllele[] genome = getTemplateBotaniaBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_ROOTED.getSpecies(); + + return genome; + } + + public static IAllele[] getTemplateBotBotanic() { + IAllele[] genome = getTemplateBotRooted(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_BOTANIC.getSpecies(); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerBotania; + + return genome; + } + + public static IAllele[] getTemplateBotBlossom() { + IAllele[] genome = getTemplateBotBotanic(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_BLOSSOM.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityMaximum"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster"); + + return genome; + } + + public static IAllele[] getTemplateBotFloral() { + IAllele[] genome = getTemplateBotBlossom(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_FLORAL.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh"); + genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringMaximum"); + + return genome; + } + + public static IAllele[] getTemplateBotVazbee() { + IAllele[] genome = getTemplateBotFloral(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_VAZBEE.getSpecies(); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + + return genome; + } + + public static IAllele[] getTemplateBotSomnolent() { + IAllele[] genome = getTemplateBotaniaBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_SOMNOLENT.getSpecies(); + genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerBotania; + genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2"); + genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectSlowSpeed; + + return genome; + } + + public static IAllele[] getTemplateBotDreaming() { + IAllele[] genome = getTemplateBotSomnolent(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_DREAMING.getSpecies(); + genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNorm"); + genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger"); + + return genome; + } + + public static IAllele[] getTemplateBotAelfheim() { + IAllele[] genome = getTemplateBotDreaming(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_ALFHEIM.getSpecies(); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.effectDreaming; + + return genome; + } + + public static IAllele[] getTemplateAESkystone() { + IAllele[] genome = getTemplateModBase(); + + genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AE_SKYSTONE.getSpecies(); + genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); + genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow"); + genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); + + return genome; + } + + /*--------------------- Other Stuff ---------------------------------- */ + + public static ItemStack getBeeNBTForSpecies(BeeSpecies species, EnumBeeType beeType) { + ItemStack taggedBee; + switch (beeType) { + case PRINCESS: + taggedBee = ItemInterface.getItemStack("beePrincessGE"); + break; + case QUEEN: + taggedBee = ItemInterface.getItemStack("beeQueenGE"); + break; + case DRONE: + default: + taggedBee = ItemInterface.getItemStack("beeDroneGE"); + break; + } + + NBTTagCompound tags = new NBTTagCompound(); + + addGeneToCompound(EnumBeeChromosome.SPECIES, species.getSpecies(), tags); + + taggedBee.setTagCompound(tags); + + return taggedBee; + } + + private static void addGeneToCompound(EnumBeeChromosome gene, IAllele allele, NBTTagCompound compound) { + NBTTagCompound geneRoot = new NBTTagCompound(); + compound.setTag("Genome", geneRoot); + NBTTagList chromosomes = new NBTTagList(); + geneRoot.setTag("Chromosomes", chromosomes); + + NBTTagCompound selectedGene = new NBTTagCompound(); + chromosomes.appendTag(selectedGene); + + selectedGene.setByte("Slot", (byte) gene.ordinal()); + selectedGene.setString("UID0", allele.getUID()); + selectedGene.setString("UID1", allele.getUID()); + } } diff --git a/src/main/java/magicbees/bees/BeeIconColourProvider.java b/src/main/java/magicbees/bees/BeeIconColourProvider.java index 7333cff..76b3164 100644 --- a/src/main/java/magicbees/bees/BeeIconColourProvider.java +++ b/src/main/java/magicbees/bees/BeeIconColourProvider.java @@ -1,23 +1,22 @@ package magicbees.bees; +import forestry.api.apiculture.IBeeIconColourProvider; import java.awt.Color; -import forestry.api.apiculture.IBeeIconColourProvider; - public enum BeeIconColourProvider implements IBeeIconColourProvider { - RAINBOW { - @Override - public int getIconColour(int renderPass) { - if (renderPass == 0) { - int hue = (int) (System.currentTimeMillis() >> 2) % 360; - return Color.getHSBColor(hue / 360f, 0.75f, 0.80f).getRGB(); - } else if (renderPass == 1) { - int hue = (int) (System.currentTimeMillis() >> 3) % 360; - hue += 60; - hue = hue % 360; - return Color.getHSBColor(hue / 360f, 0.5f, 0.6f).getRGB(); - } - return 0xffffff; - } - } + RAINBOW { + @Override + public int getIconColour(int renderPass) { + if (renderPass == 0) { + int hue = (int) (System.currentTimeMillis() >> 2) % 360; + return Color.getHSBColor(hue / 360f, 0.75f, 0.80f).getRGB(); + } else if (renderPass == 1) { + int hue = (int) (System.currentTimeMillis() >> 3) % 360; + hue += 60; + hue = hue % 360; + return Color.getHSBColor(hue / 360f, 0.5f, 0.6f).getRGB(); + } + return 0xffffff; + } + } } diff --git a/src/main/java/magicbees/bees/BeeIconProvider.java b/src/main/java/magicbees/bees/BeeIconProvider.java index 0d669f6..548232d 100644 --- a/src/main/java/magicbees/bees/BeeIconProvider.java +++ b/src/main/java/magicbees/bees/BeeIconProvider.java @@ -1,51 +1,47 @@ package magicbees.bees; -import java.util.Locale; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IBeeIconProvider; - +import java.util.Locale; import magicbees.main.CommonProxy; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; public enum BeeIconProvider implements IBeeIconProvider { - SKULKING(CommonProxy.DOMAIN + ":bees/skulking/"), - DOCTORAL(CommonProxy.DOMAIN + ":bees/doctoral/"); + SKULKING(CommonProxy.DOMAIN + ":bees/skulking/"), + DOCTORAL(CommonProxy.DOMAIN + ":bees/doctoral/"); - @SideOnly(Side.CLIENT) - private IIcon[][] icons; - private final String iconPath; + @SideOnly(Side.CLIENT) + private IIcon[][] icons; - BeeIconProvider(String iconPath) { - this.iconPath = iconPath; - } + private final String iconPath; - @Override - public void registerIcons(IIconRegister itemMap) { - this.icons = new IIcon[EnumBeeType.VALUES.length][3]; + BeeIconProvider(String iconPath) { + this.iconPath = iconPath; + } - IIcon body1 = itemMap.registerIcon(iconPath + "body1"); + @Override + public void registerIcons(IIconRegister itemMap) { + this.icons = new IIcon[EnumBeeType.VALUES.length][3]; - for (int i = 0; i < EnumBeeType.VALUES.length; i++) { - EnumBeeType beeType = EnumBeeType.VALUES[i]; - if (beeType == EnumBeeType.NONE) - continue; + IIcon body1 = itemMap.registerIcon(iconPath + "body1"); - String beeTypeIconPath = iconPath + beeType.toString().toLowerCase(Locale.ENGLISH); + for (int i = 0; i < EnumBeeType.VALUES.length; i++) { + EnumBeeType beeType = EnumBeeType.VALUES[i]; + if (beeType == EnumBeeType.NONE) continue; - icons[i][0] = itemMap.registerIcon(beeTypeIconPath + ".outline"); - icons[i][1] = (beeType != EnumBeeType.LARVAE) ? body1 : itemMap.registerIcon(beeTypeIconPath + ".body"); - icons[i][2] = itemMap.registerIcon(beeTypeIconPath + ".body2"); - } - } + String beeTypeIconPath = iconPath + beeType.toString().toLowerCase(Locale.ENGLISH); - @Override - public IIcon getIcon(EnumBeeType type, int renderPass) { - return icons[type.ordinal()][Math.min(renderPass, 2)]; - } + icons[i][0] = itemMap.registerIcon(beeTypeIconPath + ".outline"); + icons[i][1] = (beeType != EnumBeeType.LARVAE) ? body1 : itemMap.registerIcon(beeTypeIconPath + ".body"); + icons[i][2] = itemMap.registerIcon(beeTypeIconPath + ".body2"); + } + } + + @Override + public IIcon getIcon(EnumBeeType type, int renderPass) { + return icons[type.ordinal()][Math.min(renderPass, 2)]; + } } diff --git a/src/main/java/magicbees/bees/BeeManager.java b/src/main/java/magicbees/bees/BeeManager.java index 1acb098..fc86f26 100644 --- a/src/main/java/magicbees/bees/BeeManager.java +++ b/src/main/java/magicbees/bees/BeeManager.java @@ -1,16 +1,5 @@ package magicbees.bees; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; - -import magicbees.block.types.HiveType; -import magicbees.item.types.DropType; -import magicbees.main.Config; -import magicbees.main.utils.Tuple; -import magicbees.main.utils.compat.ExtraBeesHelper; -import net.minecraft.item.ItemStack; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IBee; @@ -18,95 +7,104 @@ import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeRoot; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import magicbees.block.types.HiveType; +import magicbees.item.types.DropType; +import magicbees.main.Config; +import magicbees.main.utils.Tuple; +import magicbees.main.utils.compat.ExtraBeesHelper; +import net.minecraft.item.ItemStack; -public class BeeManager -{ - public static IBeeRoot beeRoot; +public class BeeManager { + public static IBeeRoot beeRoot; - private static List> worldgenSpeciesWeights = new ArrayList>(); - private static double worldgenSpeciesWeightsTotal = 0; - - public static void getBeeRoot() { - beeRoot = (IBeeRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootBees"); - } - - public static void setupAlleles() { - Allele.setupAdditionalAlleles(); - BeeSpecies.setupBeeSpecies(); - Allele.registerDeprecatedAlleleReplacements(); - } - - public static void lateBeeInit() - { - BeeMutation.setupMutations(); - BeeProductHelper.initBaseProducts(); - BeeProductHelper.initOreDictSProducts(); - - HiveType.initHiveData(); - - beeRoot.setResearchSuitability(Config.drops.getStackForType(DropType.INTELLECT), 0.5f); - } - - public static ItemStack getDefaultItemStackForSpecies(IAlleleBeeSpecies beeSpecies, EnumBeeType type) { - IBee bee = getBeeFromSpecies(beeSpecies, false); - return BeeManager.beeRoot.getMemberStack(bee, type.ordinal()); - } - - public static IBee getBeeFromSpecies(IAlleleBeeSpecies beeSpecies, boolean applyRainResist) { - IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(beeSpecies.getUID()); - - if (applyRainResist) { - speciesTemplate = BeeGenomeManager.addRainResist(speciesTemplate); - } - - IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(speciesTemplate); - return BeeManager.beeRoot.getBee(null, genome); - } - - public static IAlleleBeeSpecies getRandomWorldgenSpecies(Random r) { - Collections.shuffle(worldgenSpeciesWeights); - double value = r.nextDouble() * worldgenSpeciesWeightsTotal; - IAlleleBeeSpecies species = Allele.getBaseSpecies("Forest"); - - for (Tuple t : worldgenSpeciesWeights) { - value -= t.right.doubleValue(); - if (value <= 0.0) { - species = t.left; - break; - } - } - - return species; - } - - public static void addWorldgenSpeciesWeight(IAlleleBeeSpecies species, double d) { - worldgenSpeciesWeights.add(new Tuple(species, d)); - worldgenSpeciesWeightsTotal += d; - } - - public static void populateSpeciesListRarity() { - worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Forest"), 20.0)); - worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Meadows"), 20.0)); - worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Tropical"), 10.0)); - worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Modest"), 16.0)); - worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Wintry"), 10.0)); - worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Ended"), 0.5)); - - if (ExtraBeesHelper.isActive()) { - worldgenSpeciesWeights.add(new Tuple(Allele.getExtraSpecies("Water"), 12.0)); - worldgenSpeciesWeights.add(new Tuple(Allele.getExtraSpecies("Rock"), 16.0)); - worldgenSpeciesWeights.add(new Tuple(Allele.getExtraSpecies("Basalt"), 10.0)); - } + private static List> worldgenSpeciesWeights = + new ArrayList>(); + private static double worldgenSpeciesWeightsTotal = 0; - worldgenSpeciesWeights.add(new Tuple(BeeSpecies.MYSTICAL.getSpecies(), 20.0)); - worldgenSpeciesWeights.add(new Tuple(BeeSpecies.UNUSUAL.getSpecies(), 20.0)); - worldgenSpeciesWeights.add(new Tuple(BeeSpecies.SORCEROUS.getSpecies(), 13.0)); - worldgenSpeciesWeights.add(new Tuple(BeeSpecies.ATTUNED.getSpecies(), 6.0)); - worldgenSpeciesWeights.add(new Tuple(BeeSpecies.INFERNAL.getSpecies(), 10.0)); - worldgenSpeciesWeights.add(new Tuple(BeeSpecies.OBLIVION.getSpecies(), 1.0)); - - for (Tuple t : worldgenSpeciesWeights) { - worldgenSpeciesWeightsTotal += t.right.doubleValue(); - } - } + public static void getBeeRoot() { + beeRoot = (IBeeRoot) AlleleManager.alleleRegistry.getSpeciesRoot("rootBees"); + } + + public static void setupAlleles() { + Allele.setupAdditionalAlleles(); + BeeSpecies.setupBeeSpecies(); + Allele.registerDeprecatedAlleleReplacements(); + } + + public static void lateBeeInit() { + BeeMutation.setupMutations(); + BeeProductHelper.initBaseProducts(); + BeeProductHelper.initOreDictSProducts(); + + HiveType.initHiveData(); + + beeRoot.setResearchSuitability(Config.drops.getStackForType(DropType.INTELLECT), 0.5f); + } + + public static ItemStack getDefaultItemStackForSpecies(IAlleleBeeSpecies beeSpecies, EnumBeeType type) { + IBee bee = getBeeFromSpecies(beeSpecies, false); + return BeeManager.beeRoot.getMemberStack(bee, type.ordinal()); + } + + public static IBee getBeeFromSpecies(IAlleleBeeSpecies beeSpecies, boolean applyRainResist) { + IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(beeSpecies.getUID()); + + if (applyRainResist) { + speciesTemplate = BeeGenomeManager.addRainResist(speciesTemplate); + } + + IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(speciesTemplate); + return BeeManager.beeRoot.getBee(null, genome); + } + + public static IAlleleBeeSpecies getRandomWorldgenSpecies(Random r) { + Collections.shuffle(worldgenSpeciesWeights); + double value = r.nextDouble() * worldgenSpeciesWeightsTotal; + IAlleleBeeSpecies species = Allele.getBaseSpecies("Forest"); + + for (Tuple t : worldgenSpeciesWeights) { + value -= t.right.doubleValue(); + if (value <= 0.0) { + species = t.left; + break; + } + } + + return species; + } + + public static void addWorldgenSpeciesWeight(IAlleleBeeSpecies species, double d) { + worldgenSpeciesWeights.add(new Tuple(species, d)); + worldgenSpeciesWeightsTotal += d; + } + + public static void populateSpeciesListRarity() { + worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Forest"), 20.0)); + worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Meadows"), 20.0)); + worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Tropical"), 10.0)); + worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Modest"), 16.0)); + worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Wintry"), 10.0)); + worldgenSpeciesWeights.add(new Tuple(Allele.getBaseSpecies("Ended"), 0.5)); + + if (ExtraBeesHelper.isActive()) { + worldgenSpeciesWeights.add(new Tuple(Allele.getExtraSpecies("Water"), 12.0)); + worldgenSpeciesWeights.add(new Tuple(Allele.getExtraSpecies("Rock"), 16.0)); + worldgenSpeciesWeights.add(new Tuple(Allele.getExtraSpecies("Basalt"), 10.0)); + } + + worldgenSpeciesWeights.add(new Tuple(BeeSpecies.MYSTICAL.getSpecies(), 20.0)); + worldgenSpeciesWeights.add(new Tuple(BeeSpecies.UNUSUAL.getSpecies(), 20.0)); + worldgenSpeciesWeights.add(new Tuple(BeeSpecies.SORCEROUS.getSpecies(), 13.0)); + worldgenSpeciesWeights.add(new Tuple(BeeSpecies.ATTUNED.getSpecies(), 6.0)); + worldgenSpeciesWeights.add(new Tuple(BeeSpecies.INFERNAL.getSpecies(), 10.0)); + worldgenSpeciesWeights.add(new Tuple(BeeSpecies.OBLIVION.getSpecies(), 1.0)); + + for (Tuple t : worldgenSpeciesWeights) { + worldgenSpeciesWeightsTotal += t.right.doubleValue(); + } + } } diff --git a/src/main/java/magicbees/bees/BeeMutation.java b/src/main/java/magicbees/bees/BeeMutation.java index 066cedb..3eac22b 100644 --- a/src/main/java/magicbees/bees/BeeMutation.java +++ b/src/main/java/magicbees/bees/BeeMutation.java @@ -1,5 +1,8 @@ package magicbees.bees; +import forestry.api.apiculture.IAlleleBeeSpecies; +import forestry.api.apiculture.IBeeMutationCustom; +import forestry.api.apiculture.IBeeMutationFactory; import magicbees.main.utils.LogHelper; import magicbees.main.utils.MoonPhase; import magicbees.main.utils.compat.AppliedEnergisticsHelper; @@ -15,368 +18,852 @@ import net.minecraft.init.Blocks; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary.Type; import net.minecraftforge.oredict.OreDictionary; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBeeMutationCustom; -import forestry.api.apiculture.IBeeMutationFactory; public class BeeMutation { - private static IBeeMutationFactory beeMutationFactory = forestry.api.apiculture.BeeManager.beeMutationFactory; + private static IBeeMutationFactory beeMutationFactory = forestry.api.apiculture.BeeManager.beeMutationFactory; - public static void setupMutations() { - IAlleleBeeSpecies baseA, baseB; - IBeeMutationCustom mutation; - - // Forestry + These -> Common - - BeeSpecies[] magicMundane = new BeeSpecies[] { BeeSpecies.MYSTICAL, BeeSpecies.SORCEROUS, BeeSpecies.UNUSUAL, BeeSpecies.ATTUNED }; - String[] forestryMundane = new String[] { "Forest", "Meadows", "Modest", "Wintry", "Tropical", "Marshy" }; - String[] binnieMundane = new String[] { "marble", "rock", "water", "basalt" }; - - for (BeeSpecies species : magicMundane) { - for (String str : forestryMundane) { - beeMutationFactory.createMutation(species.getSpecies(), Allele.getBaseSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15); - } - if (ExtraBeesHelper.isActive()) { - for (String str : binnieMundane) { - LogHelper.info("Registering " + str); - try { - beeMutationFactory.createMutation(species.getSpecies(), Allele.getExtraSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15); - } - catch (Exception e) { - LogHelper.info("Unable to register! This mutation will not be available."); - } - } - } - beeMutationFactory.createMutation(species.getSpecies(), Allele.getBaseSpecies("Common"), ForestryHelper.getTemplateForestryForSpecies("Cultivated"), 12); - beeMutationFactory.createMutation(species.getSpecies(), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH.getGenome(), 12); - } - - beeMutationFactory.createMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.ESOTERIC.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.ESOTERIC.getSpecies(), BeeSpecies.MYSTERIOUS.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.ESOTERIC.getSpecies(), BeeSpecies.MYSTERIOUS.getSpecies(), BeeSpecies.ARCANE.getGenome(), 8) - .addMutationCondition(new MoonPhaseMutationBonus(MoonPhase.WAXING_CRESCENT, MoonPhase.WAXING_GIBBOUS, 1.2f)); - - beeMutationFactory.createMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.CHARMED.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.CHARMED.getSpecies(), BeeSpecies.ENCHANTED.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.CHARMED.getSpecies(), BeeSpecies.ENCHANTED.getSpecies(), BeeSpecies.SUPERNATURAL.getGenome(), 8) - .addMutationCondition(new MoonPhaseMutationBonus(MoonPhase.WANING_GIBBOUS, MoonPhase.WANING_CRESCENT, 1.2f)); - - beeMutationFactory.createMutation(BeeSpecies.ARCANE.getSpecies(), BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getGenome(), 7); - - beeMutationFactory.createMutation(BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.WINDY.getGenome(), 14) - .requireResource("treeLeaves"); - beeMutationFactory.createMutation(BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.WATERY.getGenome(), 14) - .requireResource(Blocks.water, 0); - beeMutationFactory.createMutation(BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.EARTHY.getGenome(), 14) - .requireResource(Blocks.brick_block, 0); - beeMutationFactory.createMutation(BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.FIREY.getGenome(), 14) - .requireResource(Blocks.lava, 0); - - beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.ATTUNED.getSpecies(), BeeSpecies.AWARE.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.AWARE.getSpecies(), BeeSpecies.SPIRIT.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.ATTUNED.getSpecies(), BeeSpecies.AWARE.getSpecies(), BeeSpecies.SPIRIT.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.AWARE.getSpecies(), BeeSpecies.SPIRIT.getSpecies(), BeeSpecies.SOUL.getGenome(), 7); - - beeMutationFactory.createMutation(Allele.getBaseSpecies("Monastic"), BeeSpecies.ARCANE.getSpecies(), BeeSpecies.PUPIL.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.ARCANE.getSpecies(), BeeSpecies.PUPIL.getSpecies(), BeeSpecies.SCHOLARLY.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.PUPIL.getSpecies(), BeeSpecies.SCHOLARLY.getSpecies(), BeeSpecies.SAVANT.getGenome(), 6); - - beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.TIMELY.getGenome(), 8); - beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.TIMELY.getSpecies(), BeeSpecies.LORDLY.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.TIMELY.getSpecies(), BeeSpecies.LORDLY.getSpecies(), BeeSpecies.DOCTORAL.getGenome(), 7); - - beeMutationFactory.createMutation(BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.HATEFUL.getGenome(), 9) - .restrictBiomeType(BiomeDictionary.Type.NETHER); - beeMutationFactory.createMutation(BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.HATEFUL.getSpecies(), BeeSpecies.SPITEFUL.getGenome(), 7) - .restrictBiomeType(BiomeDictionary.Type.NETHER); - beeMutationFactory.createMutation(Allele.getBaseSpecies("Demonic"), BeeSpecies.SPITEFUL.getSpecies(), BeeSpecies.WITHERING.getGenome(), 6) - .restrictBiomeType(BiomeDictionary.Type.NETHER); + public static void setupMutations() { + IAlleleBeeSpecies baseA, baseB; + IBeeMutationCustom mutation; - beeMutationFactory.createMutation(Allele.getBaseSpecies("Modest"), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.SKULKING.getGenome(), 12); - beeMutationFactory.createMutation(Allele.getBaseSpecies("Tropical"), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.SPIDERY.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.BATTY.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.GHASTLY.getGenome(), 9); - beeMutationFactory.createMutation(BeeSpecies.GHASTLY.getSpecies(), BeeSpecies.HATEFUL.getSpecies(), BeeSpecies.SMOULDERING.getGenome(), 7) - .restrictBiomeType(BiomeDictionary.Type.NETHER); - beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.MYSTERIOUS.getSpecies(), BeeSpecies.BIGBAD.getGenome(), 7) - .addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.FULL)); - beeMutationFactory.createMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.CHICKEN.getGenome(), 12) - .restrictBiomeType(Type.FOREST); - beeMutationFactory.createMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.BEEF.getGenome(), 12) - .restrictBiomeType(Type.PLAINS); - beeMutationFactory.createMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.PORK.getGenome(), 12) - .restrictBiomeType(Type.MOUNTAIN); - beeMutationFactory.createMutation(BeeSpecies.PORK.getSpecies(), BeeSpecies.SKULKING.getSpecies(), BeeSpecies.SHEEPISH.getGenome(), 13) - .restrictBiomeType(Type.PLAINS); - beeMutationFactory.createMutation(BeeSpecies.BEEF.getSpecies(), BeeSpecies.SHEEPISH.getSpecies(), BeeSpecies.HORSE.getGenome(), 12) - .restrictBiomeType(Type.PLAINS); - beeMutationFactory.createMutation(BeeSpecies.CHICKEN.getSpecies(), BeeSpecies.SPIDERY.getSpecies(), BeeSpecies.CATTY.getGenome(), 15) - .restrictBiomeType(Type.JUNGLE); - beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.BATTY.getGenome(), 9); - if (ThaumcraftHelper.isActive()) { - beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.PUPIL.getSpecies(), BeeSpecies.BRAINY.getGenome(), 9); - } - else { - beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.BRAINY.getGenome(), 14); - } - - beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.OBLIVION.getSpecies(), BeeSpecies.NAMELESS.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.OBLIVION.getSpecies(), BeeSpecies.NAMELESS.getSpecies(), BeeSpecies.ABANDONED.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.NAMELESS.getSpecies(), BeeSpecies.ABANDONED.getSpecies(), BeeSpecies.FORLORN.getGenome(), 6); - beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ABANDONED.getSpecies(), BeeSpecies.DRACONIC.getGenome(), 6) - .restrictBiomeType(BiomeDictionary.Type.END); - - beeMutationFactory.createMutation(BeeSpecies.UNUSUAL.getSpecies(), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.MUTABLE.getGenome(), 12); - beeMutationFactory.createMutation(BeeSpecies.UNUSUAL.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.TRANSMUTING.getGenome(), 9); - beeMutationFactory.createMutation(BeeSpecies.UNUSUAL.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.CRUMBLING.getGenome(), 9); - - beeMutationFactory.createMutation(BeeSpecies.MYSTICAL.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.INVISIBLE.getGenome(), 15); - - if (BeeSpecies.COPPER.isActive()) { - beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Meadows"), BeeSpecies.COPPER.getGenome(), 12) - .requireResource("blockCopper"); - } - - if (BeeSpecies.TIN.isActive()) { - beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Forest"), BeeSpecies.TIN.getGenome(), 12) - .requireResource("blockTin"); - } - - beeMutationFactory.createMutation(Allele.getBaseSpecies("Common"), Allele.getBaseSpecies("Industrious"), BeeSpecies.IRON.getGenome(), 12) - .requireResource(Blocks.iron_block, 0); - - if (BeeSpecies.LEAD.isActive()) { - baseA = (BeeSpecies.TIN.isActive()) ? BeeSpecies.TIN.getSpecies() : (BeeSpecies.COPPER.isActive()) ? BeeSpecies.COPPER.getSpecies() : BeeSpecies.IRON.getSpecies(); - mutation = beeMutationFactory.createMutation(baseA, Allele.getBaseSpecies("Common"), BeeSpecies.LEAD.getGenome(), 10); - if (OreDictionary.getOres("blockLead").size() > 0) { - mutation.requireResource("blockLead"); - } - } + // Forestry + These -> Common - if (BeeSpecies.SILVER.isActive()) { - mutation = beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), Allele.getBaseSpecies("Modest"), BeeSpecies.SILVER.getGenome(), 8); - if (OreDictionary.getOres("blockSilver").size() > 0) { - mutation.requireResource("blockSilver"); - } - } - - baseA = (BeeSpecies.EE_MINIUM.isActive()) ? BeeSpecies.EE_MINIUM.getSpecies() : Allele.getBaseSpecies("Imperial"); - baseB = (BeeSpecies.LEAD.isActive()) ? BeeSpecies.LEAD.getSpecies() : BeeSpecies.IRON.getSpecies(); - beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.GOLD.getGenome(), 8) - .requireResource(Blocks.gold_block, 0); - - if (BeeSpecies.ALUMINUM.isActive()) { - beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ALUMINUM.getGenome(), 10) - .requireResource("blockAluminum"); - } - - if (BeeSpecies.ARDITE.isActive()) { - beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.ARDITE.getGenome(), 9) - .requireResource("blockArdite"); - } - - if (BeeSpecies.COBALT.isActive()) { - boolean hasTConCobalt = OreDictionary.getOres("nuggetCobalt").size() > 0 && OreDictionary.getOres("blockCobalt").size() > 0; - boolean hasNaturalCobalt = OreDictionary.getOres("nuggetNaturalCobalt").size() > 0 && OreDictionary.getOres("blockNaturalCobalt").size() > 0; - if (hasTConCobalt) { - beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.COBALT.getGenome(), 11) - .requireResource("blockCobalt"); - } - if (hasNaturalCobalt) { - beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.COBALT.getGenome(), 11) - .requireResource("blockNaturalCobalt"); - } - if (!(hasTConCobalt || hasNaturalCobalt)) { - beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.COBALT.getGenome(), 7); - } - } - - if (BeeSpecies.MANYULLYN.isActive()) { - beeMutationFactory.createMutation(BeeSpecies.ARDITE.getSpecies(), BeeSpecies.COBALT.getSpecies(), BeeSpecies.MANYULLYN.getGenome(), 9) - .requireResource("blockManyullyn"); - } - - if (BeeSpecies.OSMIUM.isActive()) { - baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER.getSpecies() : Allele.getBaseSpecies("Imperial"); - baseB = (BeeSpecies.COBALT.isActive()) ? BeeSpecies.COBALT.getSpecies() : BeeSpecies.INFERNAL.getSpecies(); - mutation = beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.OSMIUM.getGenome(), 11); - if (OreDictionary.getOres("blockOsmium").size() > 0) { - mutation.requireResource("blockOsmium"); - } - } - - beeMutationFactory.createMutation(Allele.getBaseSpecies("Austere"), BeeSpecies.GOLD.getSpecies(), BeeSpecies.DIAMOND.getGenome(), 7) - .requireResource("blockDiamond"); - baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER.getSpecies() : Allele.getBaseSpecies("Imperial"); - beeMutationFactory.createMutation(Allele.getBaseSpecies("Austere"), baseA, BeeSpecies.EMERALD.getGenome(), 6) - .requireResource("blockEmerald"); - beeMutationFactory.createMutation(Allele.getBaseSpecies("Rural"), BeeSpecies.COPPER.getSpecies(), BeeSpecies.APATITE.getGenome(), 12) - .requireResource("blockApatite"); - - if (BeeSpecies.SILICON.isActive()) { - baseA = (BeeSpecies.AE_SKYSTONE.isActive()) ? BeeSpecies.AE_SKYSTONE.getSpecies() : BeeSpecies.EARTHY.getSpecies(); - beeMutationFactory.createMutation(baseA, BeeSpecies.IRON.getSpecies(), BeeSpecies.SILICON.getGenome(), 17); - } - - if (BeeSpecies.CERTUS.isActive()) { - baseA = (BeeSpecies.SILICON.isActive()) ? BeeSpecies.SILICON.getSpecies() : BeeSpecies.IRON.getSpecies(); - baseB = (BeeSpecies.AE_SKYSTONE.isActive()) ? BeeSpecies.AE_SKYSTONE.getSpecies() : BeeSpecies.EARTHY.getSpecies(); - beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.CERTUS.getGenome(), 13); - } - - if (BeeSpecies.FLUIX.isActive()) { - if (BeeSpecies.CERTUS.isActive()) { - baseA = BeeSpecies.CERTUS.getSpecies(); - } - else if (BeeSpecies.SILICON.isActive()) { - baseA = BeeSpecies.SILICON.getSpecies(); - } - else { - baseA = BeeSpecies.IRON.getSpecies(); - } - baseB = (BeeSpecies.AE_SKYSTONE.isActive()) ? BeeSpecies.AE_SKYSTONE.getSpecies() : BeeSpecies.EARTHY.getSpecies(); - beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.FLUIX.getGenome(), 17); - } - - if (ThaumcraftHelper.isActive()) { - beeMutationFactory.createMutation(BeeSpecies.WINDY.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.TC_AIR.getGenome(), 8) - .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.AIR.ordinal()); - beeMutationFactory.createMutation(BeeSpecies.FIREY.getSpecies(), BeeSpecies.FIREY.getSpecies(), BeeSpecies.TC_FIRE.getGenome(), 8) - .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.FIRE.ordinal()); - beeMutationFactory.createMutation(BeeSpecies.WATERY.getSpecies(), BeeSpecies.WATERY.getSpecies(), BeeSpecies.TC_WATER.getGenome(), 8) - .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.WATER.ordinal()); - beeMutationFactory.createMutation(BeeSpecies.EARTHY.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.TC_EARTH.getGenome(), 8) - .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.EARTH.ordinal()); - beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.ARCANE.getSpecies(), BeeSpecies.TC_ORDER.getGenome(), 8) - .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.ORDER.ordinal()); - beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.TC_CHAOS.getGenome(), 8) - .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.CHAOS.ordinal()); - - beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.TC_VIS.getGenome(), 9) - .addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.WAXING_HALF, MoonPhase.WANING_HALF)); - beeMutationFactory.createMutation(BeeSpecies.ATTUNED.getSpecies(), BeeSpecies.TC_VIS.getSpecies(), BeeSpecies.TC_REJUVENATING.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.TC_VIS.getSpecies(), BeeSpecies.TC_REJUVENATING.getSpecies(), BeeSpecies.TC_EMPOWERING.getGenome(), 6) - .addMutationCondition(new MoonPhaseMutationBonus(MoonPhase.FULL, 1.322f)); - beeMutationFactory.createMutation(BeeSpecies.TC_REJUVENATING.getSpecies(), BeeSpecies.TC_EMPOWERING.getSpecies(), BeeSpecies.TC_NEXUS.getGenome(), 10) - .restrictBiomeType(Type.MAGICAL) - .requireResource(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.NODE.ordinal()); - - beeMutationFactory.createMutation(BeeSpecies.TRANSMUTING.getSpecies(), BeeSpecies.TC_EMPOWERING.getSpecies(), BeeSpecies.TC_TAINT.getGenome(), 11) - .addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.NEW)); - beeMutationFactory.createMutation(BeeSpecies.TRANSMUTING.getSpecies(), BeeSpecies.TC_REJUVENATING.getSpecies(), BeeSpecies.TC_PURE.getGenome(), 8) - .restrictBiomeType(Type.MAGICAL) - .addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.NEW)); - beeMutationFactory.createMutation(BeeSpecies.BIGBAD.getSpecies(), BeeSpecies.TC_VIS.getSpecies(), BeeSpecies.TC_HUNGRY.getGenome(), 20); - - beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.GHASTLY.getSpecies(), BeeSpecies.TC_WISPY.getGenome(), 9) - .addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.WANING_CRESCENT, MoonPhase.WAXING_CRESCENT)); - - beeMutationFactory.createMutation(BeeSpecies.IRON.getSpecies(), BeeSpecies.TC_TAINT.getSpecies(), BeeSpecies.TC_VOID.getGenome(), 5) - .restrictBiomeType(Type.MAGICAL) - .requireNight(); - } - - if (ArsMagicaHelper.isActive()) { - beeMutationFactory.createMutation(BeeSpecies.ARCANE.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.AM_ESSENCE.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.ARCANE.getSpecies(), BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.AM_QUINTESSENCE.getGenome(), 7); - - beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.AM_AIR.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.AM_EARTH.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.FIREY.getSpecies(), BeeSpecies.AM_FIRE.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.WATERY.getSpecies(), BeeSpecies.AM_WATER.getGenome(), 10); - beeMutationFactory.createMutation(BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.AM_ARCANE.getGenome(), 10); - - beeMutationFactory.createMutation(BeeSpecies.WINDY.getSpecies(), BeeSpecies.AM_AIR.getSpecies(), BeeSpecies.AM_LIGHTNING.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.EARTHY.getSpecies(), BeeSpecies.AM_EARTH.getSpecies(), BeeSpecies.AM_PLANT.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.WATERY.getSpecies(), BeeSpecies.AM_WATER.getSpecies(), BeeSpecies.AM_ICE.getGenome(), 8); - - beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.AM_ESSENCE.getSpecies(), BeeSpecies.AM_VORTEX.getGenome(), 8); - beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.GHASTLY.getSpecies(), BeeSpecies.AM_WIGHT.getGenome(), 8); - } - - if (EquivalentExchangeHelper.isActive()) { - beeMutationFactory.createMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.EE_MINIUM.getGenome(), 8); - } - - if (RedstoneArsenalHelper.isActive()) { - beeMutationFactory.createMutation(BeeSpecies.TE_ELECTRUM.getSpecies(), BeeSpecies.TE_DESTABILIZED.getSpecies(), BeeSpecies.RSA_FLUXED.getGenome(), 10) - .requireResource("blockElectrumFlux"); - } - - if (ThermalModsHelper.isActive()) { - beeMutationFactory.createMutation(BeeSpecies.TIN.getSpecies(), BeeSpecies.COPPER.getSpecies(), BeeSpecies.TE_BRONZE.getGenome(), 12) - .requireResource("blockBronze"); - - beeMutationFactory.createMutation(BeeSpecies.GOLD.getSpecies(), BeeSpecies.SILVER.getSpecies(), BeeSpecies.TE_ELECTRUM.getGenome(), 10) - .requireResource("blockElectrum"); - - beeMutationFactory.createMutation(BeeSpecies.IRON.getSpecies(), BeeSpecies.ESOTERIC.getSpecies(), BeeSpecies.TE_NICKEL.getGenome(), 14) - .requireResource("blockNickel"); - - beeMutationFactory.createMutation(BeeSpecies.IRON.getSpecies(), BeeSpecies.TE_NICKEL.getSpecies(), BeeSpecies.TE_INVAR.getGenome(), 14) - .requireResource("blockInvar"); - - beeMutationFactory.createMutation(BeeSpecies.TE_NICKEL.getSpecies(), BeeSpecies.TE_INVAR.getSpecies(), BeeSpecies.TE_PLATINUM.getGenome(), 10) - .requireResource("blockPlatinum"); - - beeMutationFactory.createMutation(BeeSpecies.TIN.getSpecies(), BeeSpecies.COPPER.getSpecies(), BeeSpecies.TE_BRONZE.getGenome(), 12) - .requireResource("blockBronze"); - - beeMutationFactory.createMutation(BeeSpecies.SPITEFUL.getSpecies(), BeeSpecies.TIN.getSpecies(), BeeSpecies.TE_COAL.getGenome(), 12) - .requireResource(Blocks.coal_ore, 0); - - beeMutationFactory.createMutation(BeeSpecies.SPITEFUL.getSpecies(), Allele.getBaseSpecies("Industrious"), BeeSpecies.TE_DESTABILIZED.getGenome(), 12) - .requireResource(Blocks.redstone_ore, 0); - - beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.TE_LUX.getGenome(), 12) - .requireResource(Blocks.glowstone, 0); - - beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), Allele.getBaseSpecies("Austere"), BeeSpecies.TE_DANTE.getGenome(), 12) - .restrictBiomeType(BiomeDictionary.Type.NETHER); - - beeMutationFactory.createMutation(BeeSpecies.TE_DANTE.getSpecies(), BeeSpecies.TE_COAL.getSpecies(), BeeSpecies.TE_PYRO.getGenome(), 8) - .restrictBiomeType(BiomeDictionary.Type.NETHER); - - beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), Allele.getBaseSpecies("Wintry"), BeeSpecies.TE_BLIZZY.getGenome(), 12); - beeMutationFactory.createMutation(BeeSpecies.TE_BLIZZY.getSpecies(), Allele.getBaseSpecies("Icy"), BeeSpecies.TE_GELID.getGenome(), 8); - - beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.TE_SHOCKING.getGenome(), 13); - beeMutationFactory.createMutation(BeeSpecies.TE_SHOCKING.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.TE_AMPED.getGenome(), 8); - - beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.TE_GROUNDED.getGenome(), 12); - beeMutationFactory.createMutation(BeeSpecies.TE_GROUNDED.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.TE_ROCKING.getGenome(), 9); + BeeSpecies[] magicMundane = + new BeeSpecies[] {BeeSpecies.MYSTICAL, BeeSpecies.SORCEROUS, BeeSpecies.UNUSUAL, BeeSpecies.ATTUNED}; + String[] forestryMundane = new String[] {"Forest", "Meadows", "Modest", "Wintry", "Tropical", "Marshy"}; + String[] binnieMundane = new String[] {"marble", "rock", "water", "basalt"}; - beeMutationFactory.createMutation(BeeSpecies.TE_PLATINUM.getSpecies(), BeeSpecies.OBLIVION.getSpecies(), BeeSpecies.TE_WINSOME.getGenome(), 12); + for (BeeSpecies species : magicMundane) { + for (String str : forestryMundane) { + beeMutationFactory.createMutation( + species.getSpecies(), + Allele.getBaseSpecies(str), + ForestryHelper.getTemplateForestryForSpecies("Common"), + 15); + } + if (ExtraBeesHelper.isActive()) { + for (String str : binnieMundane) { + LogHelper.info("Registering " + str); + try { + beeMutationFactory.createMutation( + species.getSpecies(), + Allele.getExtraSpecies(str), + ForestryHelper.getTemplateForestryForSpecies("Common"), + 15); + } catch (Exception e) { + LogHelper.info("Unable to register! This mutation will not be available."); + } + } + } + beeMutationFactory.createMutation( + species.getSpecies(), + Allele.getBaseSpecies("Common"), + ForestryHelper.getTemplateForestryForSpecies("Cultivated"), + 12); + beeMutationFactory.createMutation( + species.getSpecies(), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH.getGenome(), 12); + } - beeMutationFactory.createMutation(BeeSpecies.TE_WINSOME.getSpecies(), BeeSpecies.TE_COAL.getSpecies(), BeeSpecies.TE_ENDEARING.getGenome(), 8) - .requireResource("blockEnderium"); - - beeMutationFactory.createMutation(BeeSpecies.COPPER.getSpecies(), BeeSpecies.TE_DESTABILIZED.getSpecies(), BeeSpecies.TE_SIGNALUS.getGenome(), 8) - .requireResource("blockSignalum"); - - beeMutationFactory.createMutation(BeeSpecies.TIN.getSpecies(), BeeSpecies.TE_LUX.getSpecies(), BeeSpecies.TE_LUMIUS.getGenome(), 8) - .requireResource("blockLumium"); - } - - if (BotaniaHelper.isActive()) { - beeMutationFactory.createMutation(BeeSpecies.ELDRITCH.getSpecies(), Allele.getBaseSpecies("Forest"), BeeSpecies.BOT_ROOTED.getGenome(), 15) - .requireResource(BotaniaHelper.blockLivingWood, 0); - - beeMutationFactory.createMutation(BeeSpecies.BOT_ROOTED.getSpecies(), BeeSpecies.WATERY.getSpecies(), BeeSpecies.BOT_SOMNOLENT.getGenome(), 16) - .requireNight(); - beeMutationFactory.createMutation(BeeSpecies.WINDY.getSpecies(), BeeSpecies.BOT_SOMNOLENT.getSpecies(), BeeSpecies.BOT_DREAMING.getGenome(), 8) - .requireNight(); - - beeMutationFactory.createMutation(BeeSpecies.BOT_BOTANIC.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.BOT_BLOSSOM.getGenome(), 12); - beeMutationFactory.createMutation(BeeSpecies.BOT_BOTANIC.getSpecies(), BeeSpecies.BOT_BLOSSOM.getSpecies(), BeeSpecies.BOT_FLORAL.getGenome(), 8); - } - - if (AppliedEnergisticsHelper.isActive()) { - if (BeeSpecies.AE_SKYSTONE.isActive()) { - beeMutationFactory.createMutation(BeeSpecies.EARTHY.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.AE_SKYSTONE.getGenome(), 20) - .requireResource(AppliedEnergisticsHelper.skystone, 0); - } - } - } + beeMutationFactory.createMutation( + Allele.getBaseSpecies("Cultivated"), + BeeSpecies.ELDRITCH.getSpecies(), + BeeSpecies.ESOTERIC.getGenome(), + 10); + beeMutationFactory.createMutation( + BeeSpecies.ELDRITCH.getSpecies(), + BeeSpecies.ESOTERIC.getSpecies(), + BeeSpecies.MYSTERIOUS.getGenome(), + 8); + beeMutationFactory + .createMutation( + BeeSpecies.ESOTERIC.getSpecies(), + BeeSpecies.MYSTERIOUS.getSpecies(), + BeeSpecies.ARCANE.getGenome(), + 8) + .addMutationCondition( + new MoonPhaseMutationBonus(MoonPhase.WAXING_CRESCENT, MoonPhase.WAXING_GIBBOUS, 1.2f)); - + beeMutationFactory.createMutation( + Allele.getBaseSpecies("Cultivated"), + BeeSpecies.ELDRITCH.getSpecies(), + BeeSpecies.CHARMED.getGenome(), + 10); + beeMutationFactory.createMutation( + BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.CHARMED.getSpecies(), BeeSpecies.ENCHANTED.getGenome(), 8); + beeMutationFactory + .createMutation( + BeeSpecies.CHARMED.getSpecies(), + BeeSpecies.ENCHANTED.getSpecies(), + BeeSpecies.SUPERNATURAL.getGenome(), + 8) + .addMutationCondition( + new MoonPhaseMutationBonus(MoonPhase.WANING_GIBBOUS, MoonPhase.WANING_CRESCENT, 1.2f)); + + beeMutationFactory.createMutation( + BeeSpecies.ARCANE.getSpecies(), + BeeSpecies.SUPERNATURAL.getSpecies(), + BeeSpecies.ETHEREAL.getGenome(), + 7); + + beeMutationFactory + .createMutation( + BeeSpecies.SUPERNATURAL.getSpecies(), + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.WINDY.getGenome(), + 14) + .requireResource("treeLeaves"); + beeMutationFactory + .createMutation( + BeeSpecies.SUPERNATURAL.getSpecies(), + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.WATERY.getGenome(), + 14) + .requireResource(Blocks.water, 0); + beeMutationFactory + .createMutation( + BeeSpecies.SUPERNATURAL.getSpecies(), + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.EARTHY.getGenome(), + 14) + .requireResource(Blocks.brick_block, 0); + beeMutationFactory + .createMutation( + BeeSpecies.SUPERNATURAL.getSpecies(), + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.FIREY.getGenome(), + 14) + .requireResource(Blocks.lava, 0); + + beeMutationFactory.createMutation( + BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.ATTUNED.getSpecies(), BeeSpecies.AWARE.getGenome(), 10); + beeMutationFactory.createMutation( + BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.AWARE.getSpecies(), BeeSpecies.SPIRIT.getGenome(), 8); + beeMutationFactory.createMutation( + BeeSpecies.ATTUNED.getSpecies(), BeeSpecies.AWARE.getSpecies(), BeeSpecies.SPIRIT.getGenome(), 8); + beeMutationFactory.createMutation( + BeeSpecies.AWARE.getSpecies(), BeeSpecies.SPIRIT.getSpecies(), BeeSpecies.SOUL.getGenome(), 7); + + beeMutationFactory.createMutation( + Allele.getBaseSpecies("Monastic"), BeeSpecies.ARCANE.getSpecies(), BeeSpecies.PUPIL.getGenome(), 10); + beeMutationFactory.createMutation( + BeeSpecies.ARCANE.getSpecies(), BeeSpecies.PUPIL.getSpecies(), BeeSpecies.SCHOLARLY.getGenome(), 8); + beeMutationFactory.createMutation( + BeeSpecies.PUPIL.getSpecies(), BeeSpecies.SCHOLARLY.getSpecies(), BeeSpecies.SAVANT.getGenome(), 6); + + beeMutationFactory.createMutation( + Allele.getBaseSpecies("Imperial"), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.TIMELY.getGenome(), 8); + beeMutationFactory.createMutation( + Allele.getBaseSpecies("Imperial"), BeeSpecies.TIMELY.getSpecies(), BeeSpecies.LORDLY.getGenome(), 8); + beeMutationFactory.createMutation( + BeeSpecies.TIMELY.getSpecies(), BeeSpecies.LORDLY.getSpecies(), BeeSpecies.DOCTORAL.getGenome(), 7); + + beeMutationFactory + .createMutation( + BeeSpecies.INFERNAL.getSpecies(), + BeeSpecies.ELDRITCH.getSpecies(), + BeeSpecies.HATEFUL.getGenome(), + 9) + .restrictBiomeType(BiomeDictionary.Type.NETHER); + beeMutationFactory + .createMutation( + BeeSpecies.INFERNAL.getSpecies(), + BeeSpecies.HATEFUL.getSpecies(), + BeeSpecies.SPITEFUL.getGenome(), + 7) + .restrictBiomeType(BiomeDictionary.Type.NETHER); + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Demonic"), + BeeSpecies.SPITEFUL.getSpecies(), + BeeSpecies.WITHERING.getGenome(), + 6) + .restrictBiomeType(BiomeDictionary.Type.NETHER); + + beeMutationFactory.createMutation( + Allele.getBaseSpecies("Modest"), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.SKULKING.getGenome(), 12); + beeMutationFactory.createMutation( + Allele.getBaseSpecies("Tropical"), + BeeSpecies.SKULKING.getSpecies(), + BeeSpecies.SPIDERY.getGenome(), + 10); + beeMutationFactory.createMutation( + BeeSpecies.BATTY.getSpecies(), BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.GHASTLY.getGenome(), 9); + beeMutationFactory + .createMutation( + BeeSpecies.GHASTLY.getSpecies(), + BeeSpecies.HATEFUL.getSpecies(), + BeeSpecies.SMOULDERING.getGenome(), + 7) + .restrictBiomeType(BiomeDictionary.Type.NETHER); + beeMutationFactory + .createMutation( + BeeSpecies.SKULKING.getSpecies(), + BeeSpecies.MYSTERIOUS.getSpecies(), + BeeSpecies.BIGBAD.getGenome(), + 7) + .addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.FULL)); + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Common"), + BeeSpecies.SKULKING.getSpecies(), + BeeSpecies.CHICKEN.getGenome(), + 12) + .restrictBiomeType(Type.FOREST); + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Common"), + BeeSpecies.SKULKING.getSpecies(), + BeeSpecies.BEEF.getGenome(), + 12) + .restrictBiomeType(Type.PLAINS); + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Common"), + BeeSpecies.SKULKING.getSpecies(), + BeeSpecies.PORK.getGenome(), + 12) + .restrictBiomeType(Type.MOUNTAIN); + beeMutationFactory + .createMutation( + BeeSpecies.PORK.getSpecies(), + BeeSpecies.SKULKING.getSpecies(), + BeeSpecies.SHEEPISH.getGenome(), + 13) + .restrictBiomeType(Type.PLAINS); + beeMutationFactory + .createMutation( + BeeSpecies.BEEF.getSpecies(), + BeeSpecies.SHEEPISH.getSpecies(), + BeeSpecies.HORSE.getGenome(), + 12) + .restrictBiomeType(Type.PLAINS); + beeMutationFactory + .createMutation( + BeeSpecies.CHICKEN.getSpecies(), + BeeSpecies.SPIDERY.getSpecies(), + BeeSpecies.CATTY.getGenome(), + 15) + .restrictBiomeType(Type.JUNGLE); + beeMutationFactory.createMutation( + BeeSpecies.SKULKING.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.BATTY.getGenome(), 9); + if (ThaumcraftHelper.isActive()) { + beeMutationFactory.createMutation( + BeeSpecies.SKULKING.getSpecies(), BeeSpecies.PUPIL.getSpecies(), BeeSpecies.BRAINY.getGenome(), 9); + } else { + beeMutationFactory.createMutation( + BeeSpecies.SKULKING.getSpecies(), + BeeSpecies.MUTABLE.getSpecies(), + BeeSpecies.BRAINY.getGenome(), + 14); + } + + beeMutationFactory.createMutation( + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.OBLIVION.getSpecies(), + BeeSpecies.NAMELESS.getGenome(), + 10); + beeMutationFactory.createMutation( + BeeSpecies.OBLIVION.getSpecies(), + BeeSpecies.NAMELESS.getSpecies(), + BeeSpecies.ABANDONED.getGenome(), + 8); + beeMutationFactory.createMutation( + BeeSpecies.NAMELESS.getSpecies(), BeeSpecies.ABANDONED.getSpecies(), BeeSpecies.FORLORN.getGenome(), 6); + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Imperial"), + BeeSpecies.ABANDONED.getSpecies(), + BeeSpecies.DRACONIC.getGenome(), + 6) + .restrictBiomeType(BiomeDictionary.Type.END); + + beeMutationFactory.createMutation( + BeeSpecies.UNUSUAL.getSpecies(), BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.MUTABLE.getGenome(), 12); + beeMutationFactory.createMutation( + BeeSpecies.UNUSUAL.getSpecies(), + BeeSpecies.MUTABLE.getSpecies(), + BeeSpecies.TRANSMUTING.getGenome(), + 9); + beeMutationFactory.createMutation( + BeeSpecies.UNUSUAL.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.CRUMBLING.getGenome(), 9); + + beeMutationFactory.createMutation( + BeeSpecies.MYSTICAL.getSpecies(), + BeeSpecies.MUTABLE.getSpecies(), + BeeSpecies.INVISIBLE.getGenome(), + 15); + + if (BeeSpecies.COPPER.isActive()) { + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Industrious"), + Allele.getBaseSpecies("Meadows"), + BeeSpecies.COPPER.getGenome(), + 12) + .requireResource("blockCopper"); + } + + if (BeeSpecies.TIN.isActive()) { + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Industrious"), + Allele.getBaseSpecies("Forest"), + BeeSpecies.TIN.getGenome(), + 12) + .requireResource("blockTin"); + } + + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Common"), + Allele.getBaseSpecies("Industrious"), + BeeSpecies.IRON.getGenome(), + 12) + .requireResource(Blocks.iron_block, 0); + + if (BeeSpecies.LEAD.isActive()) { + baseA = (BeeSpecies.TIN.isActive()) + ? BeeSpecies.TIN.getSpecies() + : (BeeSpecies.COPPER.isActive()) ? BeeSpecies.COPPER.getSpecies() : BeeSpecies.IRON.getSpecies(); + mutation = beeMutationFactory.createMutation( + baseA, Allele.getBaseSpecies("Common"), BeeSpecies.LEAD.getGenome(), 10); + if (OreDictionary.getOres("blockLead").size() > 0) { + mutation.requireResource("blockLead"); + } + } + + if (BeeSpecies.SILVER.isActive()) { + mutation = beeMutationFactory.createMutation( + Allele.getBaseSpecies("Imperial"), + Allele.getBaseSpecies("Modest"), + BeeSpecies.SILVER.getGenome(), + 8); + if (OreDictionary.getOres("blockSilver").size() > 0) { + mutation.requireResource("blockSilver"); + } + } + + baseA = (BeeSpecies.EE_MINIUM.isActive()) + ? BeeSpecies.EE_MINIUM.getSpecies() + : Allele.getBaseSpecies("Imperial"); + baseB = (BeeSpecies.LEAD.isActive()) ? BeeSpecies.LEAD.getSpecies() : BeeSpecies.IRON.getSpecies(); + beeMutationFactory + .createMutation(baseA, baseB, BeeSpecies.GOLD.getGenome(), 8) + .requireResource(Blocks.gold_block, 0); + + if (BeeSpecies.ALUMINUM.isActive()) { + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Industrious"), + Allele.getBaseSpecies("Cultivated"), + BeeSpecies.ALUMINUM.getGenome(), + 10) + .requireResource("blockAluminum"); + } + + if (BeeSpecies.ARDITE.isActive()) { + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Industrious"), + BeeSpecies.INFERNAL.getSpecies(), + BeeSpecies.ARDITE.getGenome(), + 9) + .requireResource("blockArdite"); + } + + if (BeeSpecies.COBALT.isActive()) { + boolean hasTConCobalt = OreDictionary.getOres("nuggetCobalt").size() > 0 + && OreDictionary.getOres("blockCobalt").size() > 0; + boolean hasNaturalCobalt = + OreDictionary.getOres("nuggetNaturalCobalt").size() > 0 + && OreDictionary.getOres("blockNaturalCobalt").size() > 0; + if (hasTConCobalt) { + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Imperial"), + BeeSpecies.INFERNAL.getSpecies(), + BeeSpecies.COBALT.getGenome(), + 11) + .requireResource("blockCobalt"); + } + if (hasNaturalCobalt) { + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Imperial"), + BeeSpecies.INFERNAL.getSpecies(), + BeeSpecies.COBALT.getGenome(), + 11) + .requireResource("blockNaturalCobalt"); + } + if (!(hasTConCobalt || hasNaturalCobalt)) { + beeMutationFactory.createMutation( + Allele.getBaseSpecies("Imperial"), + BeeSpecies.INFERNAL.getSpecies(), + BeeSpecies.COBALT.getGenome(), + 7); + } + } + + if (BeeSpecies.MANYULLYN.isActive()) { + beeMutationFactory + .createMutation( + BeeSpecies.ARDITE.getSpecies(), + BeeSpecies.COBALT.getSpecies(), + BeeSpecies.MANYULLYN.getGenome(), + 9) + .requireResource("blockManyullyn"); + } + + if (BeeSpecies.OSMIUM.isActive()) { + baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER.getSpecies() : Allele.getBaseSpecies("Imperial"); + baseB = (BeeSpecies.COBALT.isActive()) ? BeeSpecies.COBALT.getSpecies() : BeeSpecies.INFERNAL.getSpecies(); + mutation = beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.OSMIUM.getGenome(), 11); + if (OreDictionary.getOres("blockOsmium").size() > 0) { + mutation.requireResource("blockOsmium"); + } + } + + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Austere"), + BeeSpecies.GOLD.getSpecies(), + BeeSpecies.DIAMOND.getGenome(), + 7) + .requireResource("blockDiamond"); + baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER.getSpecies() : Allele.getBaseSpecies("Imperial"); + beeMutationFactory + .createMutation(Allele.getBaseSpecies("Austere"), baseA, BeeSpecies.EMERALD.getGenome(), 6) + .requireResource("blockEmerald"); + beeMutationFactory + .createMutation( + Allele.getBaseSpecies("Rural"), + BeeSpecies.COPPER.getSpecies(), + BeeSpecies.APATITE.getGenome(), + 12) + .requireResource("blockApatite"); + + if (BeeSpecies.SILICON.isActive()) { + baseA = (BeeSpecies.AE_SKYSTONE.isActive()) + ? BeeSpecies.AE_SKYSTONE.getSpecies() + : BeeSpecies.EARTHY.getSpecies(); + beeMutationFactory.createMutation(baseA, BeeSpecies.IRON.getSpecies(), BeeSpecies.SILICON.getGenome(), 17); + } + + if (BeeSpecies.CERTUS.isActive()) { + baseA = (BeeSpecies.SILICON.isActive()) ? BeeSpecies.SILICON.getSpecies() : BeeSpecies.IRON.getSpecies(); + baseB = (BeeSpecies.AE_SKYSTONE.isActive()) + ? BeeSpecies.AE_SKYSTONE.getSpecies() + : BeeSpecies.EARTHY.getSpecies(); + beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.CERTUS.getGenome(), 13); + } + + if (BeeSpecies.FLUIX.isActive()) { + if (BeeSpecies.CERTUS.isActive()) { + baseA = BeeSpecies.CERTUS.getSpecies(); + } else if (BeeSpecies.SILICON.isActive()) { + baseA = BeeSpecies.SILICON.getSpecies(); + } else { + baseA = BeeSpecies.IRON.getSpecies(); + } + baseB = (BeeSpecies.AE_SKYSTONE.isActive()) + ? BeeSpecies.AE_SKYSTONE.getSpecies() + : BeeSpecies.EARTHY.getSpecies(); + beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.FLUIX.getGenome(), 17); + } + + if (ThaumcraftHelper.isActive()) { + beeMutationFactory + .createMutation( + BeeSpecies.WINDY.getSpecies(), + BeeSpecies.WINDY.getSpecies(), + BeeSpecies.TC_AIR.getGenome(), + 8) + .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.AIR.ordinal()); + beeMutationFactory + .createMutation( + BeeSpecies.FIREY.getSpecies(), + BeeSpecies.FIREY.getSpecies(), + BeeSpecies.TC_FIRE.getGenome(), + 8) + .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.FIRE.ordinal()); + beeMutationFactory + .createMutation( + BeeSpecies.WATERY.getSpecies(), + BeeSpecies.WATERY.getSpecies(), + BeeSpecies.TC_WATER.getGenome(), + 8) + .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.WATER.ordinal()); + beeMutationFactory + .createMutation( + BeeSpecies.EARTHY.getSpecies(), + BeeSpecies.EARTHY.getSpecies(), + BeeSpecies.TC_EARTH.getGenome(), + 8) + .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.EARTH.ordinal()); + beeMutationFactory + .createMutation( + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.ARCANE.getSpecies(), + BeeSpecies.TC_ORDER.getGenome(), + 8) + .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.ORDER.ordinal()); + beeMutationFactory + .createMutation( + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.SUPERNATURAL.getSpecies(), + BeeSpecies.TC_CHAOS.getGenome(), + 8) + .requireResource(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.CHAOS.ordinal()); + + beeMutationFactory + .createMutation( + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.INFERNAL.getSpecies(), + BeeSpecies.TC_VIS.getGenome(), + 9) + .addMutationCondition( + new MoonPhaseMutationRestriction(MoonPhase.WAXING_HALF, MoonPhase.WANING_HALF)); + beeMutationFactory.createMutation( + BeeSpecies.ATTUNED.getSpecies(), + BeeSpecies.TC_VIS.getSpecies(), + BeeSpecies.TC_REJUVENATING.getGenome(), + 8); + beeMutationFactory + .createMutation( + BeeSpecies.TC_VIS.getSpecies(), + BeeSpecies.TC_REJUVENATING.getSpecies(), + BeeSpecies.TC_EMPOWERING.getGenome(), + 6) + .addMutationCondition(new MoonPhaseMutationBonus(MoonPhase.FULL, 1.322f)); + beeMutationFactory + .createMutation( + BeeSpecies.TC_REJUVENATING.getSpecies(), + BeeSpecies.TC_EMPOWERING.getSpecies(), + BeeSpecies.TC_NEXUS.getGenome(), + 10) + .restrictBiomeType(Type.MAGICAL) + .requireResource(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.NODE.ordinal()); + + beeMutationFactory + .createMutation( + BeeSpecies.TRANSMUTING.getSpecies(), + BeeSpecies.TC_EMPOWERING.getSpecies(), + BeeSpecies.TC_TAINT.getGenome(), + 11) + .addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.NEW)); + beeMutationFactory + .createMutation( + BeeSpecies.TRANSMUTING.getSpecies(), + BeeSpecies.TC_REJUVENATING.getSpecies(), + BeeSpecies.TC_PURE.getGenome(), + 8) + .restrictBiomeType(Type.MAGICAL) + .addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.NEW)); + beeMutationFactory.createMutation( + BeeSpecies.BIGBAD.getSpecies(), + BeeSpecies.TC_VIS.getSpecies(), + BeeSpecies.TC_HUNGRY.getGenome(), + 20); + + beeMutationFactory + .createMutation( + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.GHASTLY.getSpecies(), + BeeSpecies.TC_WISPY.getGenome(), + 9) + .addMutationCondition( + new MoonPhaseMutationRestriction(MoonPhase.WANING_CRESCENT, MoonPhase.WAXING_CRESCENT)); + + beeMutationFactory + .createMutation( + BeeSpecies.IRON.getSpecies(), + BeeSpecies.TC_TAINT.getSpecies(), + BeeSpecies.TC_VOID.getGenome(), + 5) + .restrictBiomeType(Type.MAGICAL) + .requireNight(); + } + + if (ArsMagicaHelper.isActive()) { + beeMutationFactory.createMutation( + BeeSpecies.ARCANE.getSpecies(), + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.AM_ESSENCE.getGenome(), + 10); + beeMutationFactory.createMutation( + BeeSpecies.ARCANE.getSpecies(), + BeeSpecies.AM_ESSENCE.getSpecies(), + BeeSpecies.AM_QUINTESSENCE.getGenome(), + 7); + + beeMutationFactory.createMutation( + BeeSpecies.AM_ESSENCE.getSpecies(), + BeeSpecies.WINDY.getSpecies(), + BeeSpecies.AM_AIR.getGenome(), + 10); + beeMutationFactory.createMutation( + BeeSpecies.AM_ESSENCE.getSpecies(), + BeeSpecies.EARTHY.getSpecies(), + BeeSpecies.AM_EARTH.getGenome(), + 10); + beeMutationFactory.createMutation( + BeeSpecies.AM_ESSENCE.getSpecies(), + BeeSpecies.FIREY.getSpecies(), + BeeSpecies.AM_FIRE.getGenome(), + 10); + beeMutationFactory.createMutation( + BeeSpecies.AM_ESSENCE.getSpecies(), + BeeSpecies.WATERY.getSpecies(), + BeeSpecies.AM_WATER.getGenome(), + 10); + beeMutationFactory.createMutation( + BeeSpecies.AM_ESSENCE.getSpecies(), + BeeSpecies.ETHEREAL.getSpecies(), + BeeSpecies.AM_ARCANE.getGenome(), + 10); + + beeMutationFactory.createMutation( + BeeSpecies.WINDY.getSpecies(), + BeeSpecies.AM_AIR.getSpecies(), + BeeSpecies.AM_LIGHTNING.getGenome(), + 8); + beeMutationFactory.createMutation( + BeeSpecies.EARTHY.getSpecies(), + BeeSpecies.AM_EARTH.getSpecies(), + BeeSpecies.AM_PLANT.getGenome(), + 8); + beeMutationFactory.createMutation( + BeeSpecies.WATERY.getSpecies(), BeeSpecies.AM_WATER.getSpecies(), BeeSpecies.AM_ICE.getGenome(), 8); + + beeMutationFactory.createMutation( + BeeSpecies.SKULKING.getSpecies(), + BeeSpecies.AM_ESSENCE.getSpecies(), + BeeSpecies.AM_VORTEX.getGenome(), + 8); + beeMutationFactory.createMutation( + BeeSpecies.SKULKING.getSpecies(), + BeeSpecies.GHASTLY.getSpecies(), + BeeSpecies.AM_WIGHT.getGenome(), + 8); + } + + if (EquivalentExchangeHelper.isActive()) { + beeMutationFactory.createMutation( + Allele.getBaseSpecies("Frugal"), + BeeSpecies.MUTABLE.getSpecies(), + BeeSpecies.EE_MINIUM.getGenome(), + 8); + } + + if (RedstoneArsenalHelper.isActive()) { + beeMutationFactory + .createMutation( + BeeSpecies.TE_ELECTRUM.getSpecies(), + BeeSpecies.TE_DESTABILIZED.getSpecies(), + BeeSpecies.RSA_FLUXED.getGenome(), + 10) + .requireResource("blockElectrumFlux"); + } + + if (ThermalModsHelper.isActive()) { + beeMutationFactory + .createMutation( + BeeSpecies.TIN.getSpecies(), + BeeSpecies.COPPER.getSpecies(), + BeeSpecies.TE_BRONZE.getGenome(), + 12) + .requireResource("blockBronze"); + + beeMutationFactory + .createMutation( + BeeSpecies.GOLD.getSpecies(), + BeeSpecies.SILVER.getSpecies(), + BeeSpecies.TE_ELECTRUM.getGenome(), + 10) + .requireResource("blockElectrum"); + + beeMutationFactory + .createMutation( + BeeSpecies.IRON.getSpecies(), + BeeSpecies.ESOTERIC.getSpecies(), + BeeSpecies.TE_NICKEL.getGenome(), + 14) + .requireResource("blockNickel"); + + beeMutationFactory + .createMutation( + BeeSpecies.IRON.getSpecies(), + BeeSpecies.TE_NICKEL.getSpecies(), + BeeSpecies.TE_INVAR.getGenome(), + 14) + .requireResource("blockInvar"); + + beeMutationFactory + .createMutation( + BeeSpecies.TE_NICKEL.getSpecies(), + BeeSpecies.TE_INVAR.getSpecies(), + BeeSpecies.TE_PLATINUM.getGenome(), + 10) + .requireResource("blockPlatinum"); + + beeMutationFactory + .createMutation( + BeeSpecies.TIN.getSpecies(), + BeeSpecies.COPPER.getSpecies(), + BeeSpecies.TE_BRONZE.getGenome(), + 12) + .requireResource("blockBronze"); + + beeMutationFactory + .createMutation( + BeeSpecies.SPITEFUL.getSpecies(), + BeeSpecies.TIN.getSpecies(), + BeeSpecies.TE_COAL.getGenome(), + 12) + .requireResource(Blocks.coal_ore, 0); + + beeMutationFactory + .createMutation( + BeeSpecies.SPITEFUL.getSpecies(), + Allele.getBaseSpecies("Industrious"), + BeeSpecies.TE_DESTABILIZED.getGenome(), + 12) + .requireResource(Blocks.redstone_ore, 0); + + beeMutationFactory + .createMutation( + BeeSpecies.SMOULDERING.getSpecies(), + BeeSpecies.INFERNAL.getSpecies(), + BeeSpecies.TE_LUX.getGenome(), + 12) + .requireResource(Blocks.glowstone, 0); + + beeMutationFactory + .createMutation( + BeeSpecies.SMOULDERING.getSpecies(), + Allele.getBaseSpecies("Austere"), + BeeSpecies.TE_DANTE.getGenome(), + 12) + .restrictBiomeType(BiomeDictionary.Type.NETHER); + + beeMutationFactory + .createMutation( + BeeSpecies.TE_DANTE.getSpecies(), + BeeSpecies.TE_COAL.getSpecies(), + BeeSpecies.TE_PYRO.getGenome(), + 8) + .restrictBiomeType(BiomeDictionary.Type.NETHER); + + beeMutationFactory.createMutation( + BeeSpecies.SKULKING.getSpecies(), + Allele.getBaseSpecies("Wintry"), + BeeSpecies.TE_BLIZZY.getGenome(), + 12); + beeMutationFactory.createMutation( + BeeSpecies.TE_BLIZZY.getSpecies(), + Allele.getBaseSpecies("Icy"), + BeeSpecies.TE_GELID.getGenome(), + 8); + + beeMutationFactory.createMutation( + BeeSpecies.SMOULDERING.getSpecies(), + BeeSpecies.WINDY.getSpecies(), + BeeSpecies.TE_SHOCKING.getGenome(), + 13); + beeMutationFactory.createMutation( + BeeSpecies.TE_SHOCKING.getSpecies(), + BeeSpecies.WINDY.getSpecies(), + BeeSpecies.TE_AMPED.getGenome(), + 8); + + beeMutationFactory.createMutation( + BeeSpecies.SMOULDERING.getSpecies(), + BeeSpecies.EARTHY.getSpecies(), + BeeSpecies.TE_GROUNDED.getGenome(), + 12); + beeMutationFactory.createMutation( + BeeSpecies.TE_GROUNDED.getSpecies(), + BeeSpecies.EARTHY.getSpecies(), + BeeSpecies.TE_ROCKING.getGenome(), + 9); + + beeMutationFactory.createMutation( + BeeSpecies.TE_PLATINUM.getSpecies(), + BeeSpecies.OBLIVION.getSpecies(), + BeeSpecies.TE_WINSOME.getGenome(), + 12); + + beeMutationFactory + .createMutation( + BeeSpecies.TE_WINSOME.getSpecies(), + BeeSpecies.TE_COAL.getSpecies(), + BeeSpecies.TE_ENDEARING.getGenome(), + 8) + .requireResource("blockEnderium"); + + beeMutationFactory + .createMutation( + BeeSpecies.COPPER.getSpecies(), + BeeSpecies.TE_DESTABILIZED.getSpecies(), + BeeSpecies.TE_SIGNALUS.getGenome(), + 8) + .requireResource("blockSignalum"); + + beeMutationFactory + .createMutation( + BeeSpecies.TIN.getSpecies(), + BeeSpecies.TE_LUX.getSpecies(), + BeeSpecies.TE_LUMIUS.getGenome(), + 8) + .requireResource("blockLumium"); + } + + if (BotaniaHelper.isActive()) { + beeMutationFactory + .createMutation( + BeeSpecies.ELDRITCH.getSpecies(), + Allele.getBaseSpecies("Forest"), + BeeSpecies.BOT_ROOTED.getGenome(), + 15) + .requireResource(BotaniaHelper.blockLivingWood, 0); + + beeMutationFactory + .createMutation( + BeeSpecies.BOT_ROOTED.getSpecies(), + BeeSpecies.WATERY.getSpecies(), + BeeSpecies.BOT_SOMNOLENT.getGenome(), + 16) + .requireNight(); + beeMutationFactory + .createMutation( + BeeSpecies.WINDY.getSpecies(), + BeeSpecies.BOT_SOMNOLENT.getSpecies(), + BeeSpecies.BOT_DREAMING.getGenome(), + 8) + .requireNight(); + + beeMutationFactory.createMutation( + BeeSpecies.BOT_BOTANIC.getSpecies(), + BeeSpecies.EARTHY.getSpecies(), + BeeSpecies.BOT_BLOSSOM.getGenome(), + 12); + beeMutationFactory.createMutation( + BeeSpecies.BOT_BOTANIC.getSpecies(), + BeeSpecies.BOT_BLOSSOM.getSpecies(), + BeeSpecies.BOT_FLORAL.getGenome(), + 8); + } + + if (AppliedEnergisticsHelper.isActive()) { + if (BeeSpecies.AE_SKYSTONE.isActive()) { + beeMutationFactory + .createMutation( + BeeSpecies.EARTHY.getSpecies(), + BeeSpecies.WINDY.getSpecies(), + BeeSpecies.AE_SKYSTONE.getGenome(), + 20) + .requireResource(AppliedEnergisticsHelper.skystone, 0); + } + } + } } diff --git a/src/main/java/magicbees/bees/BeeProductHelper.java b/src/main/java/magicbees/bees/BeeProductHelper.java index 0bd6ef0..f59e1f3 100644 --- a/src/main/java/magicbees/bees/BeeProductHelper.java +++ b/src/main/java/magicbees/bees/BeeProductHelper.java @@ -1,5 +1,7 @@ package magicbees.bees; +import static magicbees.bees.BeeSpecies.*; + import magicbees.item.types.CombType; import magicbees.item.types.DropType; import magicbees.item.types.NuggetType; @@ -11,433 +13,468 @@ import magicbees.main.utils.LogHelper; import magicbees.main.utils.compat.AppliedEnergisticsHelper; import magicbees.main.utils.compat.ArsMagicaHelper; import magicbees.main.utils.compat.BotaniaHelper; +import magicbees.main.utils.compat.BotaniaHelper.PastureSeed; import magicbees.main.utils.compat.EquivalentExchangeHelper; import magicbees.main.utils.compat.ForestryHelper; import magicbees.main.utils.compat.RedstoneArsenalHelper; import magicbees.main.utils.compat.ThaumcraftHelper; import magicbees.main.utils.compat.ThermalModsHelper; -import magicbees.main.utils.compat.BotaniaHelper.PastureSeed; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -import static magicbees.bees.BeeSpecies.*; public class BeeProductHelper { - - public static void initBaseProducts() { - MYSTICAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); - SORCEROUS.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); - UNUSUAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); - ATTUNED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); - ELDRITCH.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); - ESOTERIC.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.18f); - MYSTERIOUS.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.20f); - ARCANE.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.25f) - .addSpecialty(Config.drops.getStackForType(DropType.ENCHANTED, 1), 0.09f); + public static void initBaseProducts() { + MYSTICAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); + SORCEROUS.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); + UNUSUAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); + ATTUNED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); + ELDRITCH.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.15f); - CHARMED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.18f); - ENCHANTED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.20f); - SUPERNATURAL.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.25f) - .addSpecialty(Config.pollen.getStackForType(PollenType.UNUSUAL), 0.08f); + ESOTERIC.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.18f); + MYSTERIOUS.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.20f); + ARCANE.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.25f) + .addSpecialty(Config.drops.getStackForType(DropType.ENCHANTED, 1), 0.09f); - ETHEREAL.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.10f); + CHARMED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.18f); + ENCHANTED.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.20f); + SUPERNATURAL + .addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.25f) + .addSpecialty(Config.pollen.getStackForType(PollenType.UNUSUAL), 0.08f); - WINDY.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.25f); - FIREY.addProduct(Config.combs.getStackForType(CombType.FIREY), 0.25f); - EARTHY.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.25f); - WATERY.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.25f) - .addSpecialty(new ItemStack(Blocks.ice), 0.025f); + ETHEREAL.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.10f); - PUPIL.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.20f); - SCHOLARLY.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.25f); - SAVANT.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.40f); + WINDY.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.25f); + FIREY.addProduct(Config.combs.getStackForType(CombType.FIREY), 0.25f); + EARTHY.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.25f); + WATERY.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.25f) + .addSpecialty(new ItemStack(Blocks.ice), 0.025f); - AWARE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f); - SPIRIT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.22f) - .addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.16f); - SOUL.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f) - .addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.20f); + PUPIL.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.20f); + SCHOLARLY.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.25f); + SAVANT.addProduct(Config.combs.getStackForType(CombType.PAPERY), 0.40f); - SKULKING.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f); - GHASTLY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.08f) - .addSpecialty(new ItemStack(Items.ghast_tear), 0.099f); - SPIDERY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.13f) - .addProduct(new ItemStack(Items.string), 0.08f) - .addSpecialty(new ItemStack(Items.spider_eye), 0.08f); - SMOULDERING.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f) - .addSpecialty(new ItemStack(Items.blaze_rod), 0.05f); - BRAINY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) - .addProduct(new ItemStack(Items.rotten_flesh), 0.06f); - BIGBAD.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.18f) - .addProduct(new ItemStack(Items.beef), 0.12f) - .addProduct(new ItemStack(Items.chicken), 0.12f) - .addSpecialty(new ItemStack(Items.melon), 0.20f); - BATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) - .addSpecialty(new ItemStack(Items.string), 0.20f); - CHICKEN.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.23f) - .addSpecialty(new ItemStack(Items.feather), 0.08f) - .addSpecialty(new ItemStack(Items.egg), 0.08f); - BEEF.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) - .addSpecialty(new ItemStack(Items.leather), 0.165f); - PORK.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) - .addSpecialty(new ItemStack(Items.carrot), 0.165f); - SHEEPISH.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) - .addSpecialty(new ItemStack(Blocks.wool), 0.16f) - .addSpecialty(new ItemStack(Items.wheat), 0.24f); - HORSE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) - .addSpecialty(new ItemStack(Items.leather), 0.24f) - .addSpecialty(new ItemStack(Items.apple), 0.38f); - CATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) - .addSpecialty(new ItemStack(Items.fish), 0.24f); + AWARE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f); + SPIRIT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.22f) + .addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.16f); + SOUL.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f) + .addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.20f); - TIMELY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.16f); - LORDLY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.19f); - DOCTORAL.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.24f) - .addSpecialty(new ItemStack(Config.jellyBaby), 0.078f); + SKULKING.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f); + GHASTLY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.08f) + .addSpecialty(new ItemStack(Items.ghast_tear), 0.099f); + SPIDERY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.13f) + .addProduct(new ItemStack(Items.string), 0.08f) + .addSpecialty(new ItemStack(Items.spider_eye), 0.08f); + SMOULDERING + .addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f) + .addSpecialty(new ItemStack(Items.blaze_rod), 0.05f); + BRAINY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) + .addProduct(new ItemStack(Items.rotten_flesh), 0.06f); + BIGBAD.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.18f) + .addProduct(new ItemStack(Items.beef), 0.12f) + .addProduct(new ItemStack(Items.chicken), 0.12f) + .addSpecialty(new ItemStack(Items.melon), 0.20f); + BATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) + .addSpecialty(new ItemStack(Items.string), 0.20f); + CHICKEN.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.23f) + .addSpecialty(new ItemStack(Items.feather), 0.08f) + .addSpecialty(new ItemStack(Items.egg), 0.08f); + BEEF.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) + .addSpecialty(new ItemStack(Items.leather), 0.165f); + PORK.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) + .addSpecialty(new ItemStack(Items.carrot), 0.165f); + SHEEPISH.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) + .addSpecialty(new ItemStack(Blocks.wool), 0.16f) + .addSpecialty(new ItemStack(Items.wheat), 0.24f); + HORSE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) + .addSpecialty(new ItemStack(Items.leather), 0.24f) + .addSpecialty(new ItemStack(Items.apple), 0.38f); + CATTY.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.25f) + .addSpecialty(new ItemStack(Items.fish), 0.24f); - INFERNAL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.12f); - HATEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.18f); - SPITEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.24f); - WITHERING.addSpecialty(Config.miscResources.getStackForType(ResourceType.SKULL_CHIP), 0.15f); + TIMELY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.16f); + LORDLY.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.19f); + DOCTORAL.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.24f) + .addSpecialty(new ItemStack(Config.jellyBaby), 0.078f); - OBLIVION.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.14f); - NAMELESS.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.19f); - ABANDONED.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.24f); - FORLORN.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.30f); - DRACONIC.addSpecialty(Config.miscResources.getStackForType(ResourceType.DRAGON_DUST), 0.15f); + INFERNAL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.12f); + HATEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.18f); + SPITEFUL.addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.24f); + WITHERING.addSpecialty(Config.miscResources.getStackForType(ResourceType.SKULL_CHIP), 0.15f); - IRON.addProduct(ForestryHelper.itemHoneycomb, 0.10f) - .addSpecialty(Config.nuggets.getStackForType(NuggetType.IRON), 0.18f); - GOLD.addProduct(ForestryHelper.itemHoneycomb, 0.10f) - .addSpecialty(new ItemStack(Items.gold_nugget, 1), 0.16f); - DIAMOND.addProduct(ForestryHelper.itemHoneycomb, 0.10f) - .addSpecialty(Config.nuggets.getStackForType(NuggetType.DIAMOND), 0.06f); - EMERALD.addProduct(ForestryHelper.itemHoneycomb, 0.10f) - .addSpecialty(Config.nuggets.getStackForType(NuggetType.EMERALD), 0.04f); - COPPER.addProduct(ForestryHelper.itemHoneycomb, 0.10f) - .addSpecialty(Config.nuggets.getStackForType(NuggetType.COPPER), 0.20f); - TIN.addProduct(ForestryHelper.itemHoneycomb, 0.10f) - .addSpecialty(Config.nuggets.getStackForType(NuggetType.TIN), 0.20f); - APATITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f) - .addSpecialty(Config.nuggets.getStackForType(NuggetType.APATITE), 0.10f); - - MUTABLE.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.30f) - .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.10f); - TRANSMUTING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f) - .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.05f) - .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SIMMERING.ordinal()), 0.05f); - CRUMBLING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f) - .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.POWDERY.ordinal()), 0.10f) - .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.COCOA.ordinal()), 0.15f); - - INVISIBLE.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.35f); + OBLIVION.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.14f); + NAMELESS.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.19f); + ABANDONED.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.24f); + FORLORN.addProduct(Config.combs.getStackForType(CombType.FORGOTTEN), 0.30f); + DRACONIC.addSpecialty(Config.miscResources.getStackForType(ResourceType.DRAGON_DUST), 0.15f); - } + IRON.addProduct(ForestryHelper.itemHoneycomb, 0.10f) + .addSpecialty(Config.nuggets.getStackForType(NuggetType.IRON), 0.18f); + GOLD.addProduct(ForestryHelper.itemHoneycomb, 0.10f).addSpecialty(new ItemStack(Items.gold_nugget, 1), 0.16f); + DIAMOND.addProduct(ForestryHelper.itemHoneycomb, 0.10f) + .addSpecialty(Config.nuggets.getStackForType(NuggetType.DIAMOND), 0.06f); + EMERALD.addProduct(ForestryHelper.itemHoneycomb, 0.10f) + .addSpecialty(Config.nuggets.getStackForType(NuggetType.EMERALD), 0.04f); + COPPER.addProduct(ForestryHelper.itemHoneycomb, 0.10f) + .addSpecialty(Config.nuggets.getStackForType(NuggetType.COPPER), 0.20f); + TIN.addProduct(ForestryHelper.itemHoneycomb, 0.10f) + .addSpecialty(Config.nuggets.getStackForType(NuggetType.TIN), 0.20f); + APATITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f) + .addSpecialty(Config.nuggets.getStackForType(NuggetType.APATITE), 0.10f); - public static void initOreDictSProducts() { - SILVER.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("ingotSilver").size() > 0) { - SILVER.addSpecialty(Config.nuggets.getStackForType(NuggetType.SILVER), 0.16f); - } - else { - SILVER.setInactive(); - } - - LEAD.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("ingotLead").size() > 0) { - LEAD.addSpecialty(Config.nuggets.getStackForType(NuggetType.LEAD), 0.17f); - } - else { - LEAD.setInactive(); - } - - ALUMINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("nuggetAluminum").size() > 0) { - ALUMINUM.addSpecialty(OreDictionary.getOres("nuggetAluminum").get(0), 0.20f); - } else { - ALUMINUM.setInactive(); - } + MUTABLE.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.30f) + .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.10f); + TRANSMUTING + .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f) + .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.05f) + .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SIMMERING.ordinal()), 0.05f); + CRUMBLING + .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.PARCHED.ordinal()), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.30f) + .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.POWDERY.ordinal()), 0.10f) + .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.COCOA.ordinal()), 0.15f); - TE_PLATINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("nuggetPlatinum").size() > 0&& OreDictionary.getOres("ingotPlatinum").size() > 0) { - TE_PLATINUM.addSpecialty(OreDictionary.getOres("nuggetPlatinum").get(0), 0.18f); - } else { - TE_PLATINUM.setInactive(); - } + INVISIBLE.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.35f); + } - TE_NICKEL.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("nuggetNickel").size() > 0 && OreDictionary.getOres("ingotNickel").size() > 0) { - TE_NICKEL.addSpecialty(OreDictionary.getOres("nuggetNickel").get(0), 0.18f); - } else { - TE_NICKEL.setInactive(); - } + public static void initOreDictSProducts() { + SILVER.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("ingotSilver").size() > 0) { + SILVER.addSpecialty(Config.nuggets.getStackForType(NuggetType.SILVER), 0.16f); + } else { + SILVER.setInactive(); + } - ARDITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("nuggetArdite").size() > 0) { - ARDITE.addSpecialty(OreDictionary.getOres("nuggetArdite").get(0), 0.18f); - } else { - ARDITE.setInactive(); - } + LEAD.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("ingotLead").size() > 0) { + LEAD.addSpecialty(Config.nuggets.getStackForType(NuggetType.LEAD), 0.17f); + } else { + LEAD.setInactive(); + } - COBALT.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("nuggetCobalt").size() > 0) { - COBALT.addSpecialty(OreDictionary.getOres("nuggetCobalt").get(0), 0.18f); - } - if (OreDictionary.getOres("nuggetNaturalCobalt").size() > 0) { - COBALT.addSpecialty(OreDictionary.getOres("nuggetNaturalCobalt").get(0), 0.24f); - } - if (COBALT.getSpecies().getSpecialtyChances().size() <= 0) { - COBALT.setInactive(); - } + ALUMINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("nuggetAluminum").size() > 0) { + ALUMINUM.addSpecialty(OreDictionary.getOres("nuggetAluminum").get(0), 0.20f); + } else { + ALUMINUM.setInactive(); + } - TE_BRONZE.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("nuggetBronze").size() > 0 && OreDictionary.getOres("ingotBronze").size() > 0) { - TE_BRONZE.addSpecialty(OreDictionary.getOres("nuggetBronze").get(0), 0.18f); - } else { - TE_BRONZE.setInactive(); - } + TE_PLATINUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("nuggetPlatinum").size() > 0 + && OreDictionary.getOres("ingotPlatinum").size() > 0) { + TE_PLATINUM.addSpecialty(OreDictionary.getOres("nuggetPlatinum").get(0), 0.18f); + } else { + TE_PLATINUM.setInactive(); + } - TE_INVAR.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("nuggetInvar").size() > 0 && OreDictionary.getOres("ingotInvar").size() > 0) { - TE_INVAR.addSpecialty(OreDictionary.getOres("nuggetInvar").get(0), 0.18f); - } else { - TE_INVAR.setInactive(); - } + TE_NICKEL.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("nuggetNickel").size() > 0 + && OreDictionary.getOres("ingotNickel").size() > 0) { + TE_NICKEL.addSpecialty(OreDictionary.getOres("nuggetNickel").get(0), 0.18f); + } else { + TE_NICKEL.setInactive(); + } - TE_ELECTRUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("nuggetElectrum").size() > 0 && OreDictionary.getOres("ingotElectrum").size() > 0) { - TE_ELECTRUM.addSpecialty(OreDictionary.getOres("nuggetElectrum").get(0), 0.18f); - } else { - TE_ELECTRUM.setInactive(); - } + ARDITE.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("nuggetArdite").size() > 0) { + ARDITE.addSpecialty(OreDictionary.getOres("nuggetArdite").get(0), 0.18f); + } else { + ARDITE.setInactive(); + } - MANYULLYN.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("nuggetManyullyn").size() > 0) { - MANYULLYN.addSpecialty(OreDictionary.getOres("nuggetManyullyn").get(0), 0.16f); - } else { - MANYULLYN.setInactive(); - } - - OSMIUM.addProduct(ForestryHelper.itemHoneycomb, 0.15f); - if (OreDictionary.getOres("nuggetOsmium").size() > 0) { - OSMIUM.addSpecialty(OreDictionary.getOres("nuggetOsmium").get(0), 0.16f); - } - else { - OSMIUM.setInactive(); - } - - CERTUS.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("crystalCertusQuartz").size() > 0) { - CERTUS.addSpecialty(OreDictionary.getOres("crystalCertusQuartz").get(0), 0.08f); - } - else { - CERTUS.setInactive(); - } - - SILICON.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("itemSilicon").size() > 0) { - SILICON.addSpecialty(OreDictionary.getOres("itemSilicon").get(0), 0.16f); - } - else { - SILICON.setInactive(); - } - - FLUIX.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - if (OreDictionary.getOres("crystalFluix").size() > 0) { - FLUIX.addSpecialty(OreDictionary.getOres("crystalFluix").get(0), 0.06f); - } - else { - FLUIX.setInactive(); - } - } - - public static void initThaumcraftProducts() { - TC_AIR.addProduct(Config.combs.getStackForType(CombType.TC_AIR), 0.20f); - TC_FIRE.addProduct(Config.combs.getStackForType(CombType.TC_FIRE), 0.20f); - TC_WATER.addProduct(Config.combs.getStackForType(CombType.TC_WATER), 0.20f); - TC_EARTH.addProduct(Config.combs.getStackForType(CombType.TC_EARTH), 0.20f); - TC_ORDER.addProduct(Config.combs.getStackForType(CombType.TC_ORDER), 0.20f); - TC_CHAOS.addProduct(Config.combs.getStackForType(CombType.TC_CHAOS), 0.20f); + COBALT.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("nuggetCobalt").size() > 0) { + COBALT.addSpecialty(OreDictionary.getOres("nuggetCobalt").get(0), 0.18f); + } + if (OreDictionary.getOres("nuggetNaturalCobalt").size() > 0) { + COBALT.addSpecialty(OreDictionary.getOres("nuggetNaturalCobalt").get(0), 0.24f); + } + if (COBALT.getSpecies().getSpecialtyChances().size() <= 0) { + COBALT.setInactive(); + } - TC_VIS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.10f); - TC_REJUVENATING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f); - TC_EMPOWERING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.14f); - TC_EMPOWERING.addSpecialty(new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), 0.02f); - TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.25f); - TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.12f); - TC_NEXUS.addSpecialty(new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), 0.02f); - TC_TAINT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f); - TC_TAINT.addProduct(new ItemStack(ForestryHelper.craftingResource, 1 , ForestryHelper.Propolis.STICKY.ordinal()), 0.213f); - TC_PURE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.16f); - TC_PURE.addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.19f); - TC_HUNGRY.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f); - TC_HUNGRY.addSpecialty(Config.combs.getStackForType(CombType.TEMPORAL), 0.195f); - TC_WISPY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.22f) - .addSpecialty(new ItemStack(ForestryHelper.craftingResource, 1, ForestryHelper.CraftingMaterial.SILK_WISP.ordinal()), 0.04f); - TC_VOID.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - - if (ThaumcraftHelper.isActive()) { - SCHOLARLY.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.02f); - SAVANT.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.05f); + TE_BRONZE.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("nuggetBronze").size() > 0 + && OreDictionary.getOres("ingotBronze").size() > 0) { + TE_BRONZE.addSpecialty(OreDictionary.getOres("nuggetBronze").get(0), 0.18f); + } else { + TE_BRONZE.setInactive(); + } - TC_AIR.addSpecialty(Config.propolis.getStackForType(PropolisType.AIR), 0.18f); - TC_FIRE.addSpecialty(Config.propolis.getStackForType(PropolisType.FIRE), 0.18f); - TC_WATER.addSpecialty(Config.propolis.getStackForType(PropolisType.WATER), 0.18f); - TC_EARTH.addSpecialty(Config.propolis.getStackForType(PropolisType.EARTH), 0.18f); - TC_ORDER.addSpecialty(Config.propolis.getStackForType(PropolisType.ORDER), 0.18f); - TC_CHAOS.addSpecialty(Config.propolis.getStackForType(PropolisType.CHAOS), 0.18f); + TE_INVAR.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("nuggetInvar").size() > 0 + && OreDictionary.getOres("ingotInvar").size() > 0) { + TE_INVAR.addSpecialty(OreDictionary.getOres("nuggetInvar").get(0), 0.18f); + } else { + TE_INVAR.setInactive(); + } - BATTY.addSpecialty(new ItemStack(Items.gunpowder), 0.04f); - BRAINY.addSpecialty(new ItemStack(ThaumcraftHelper.zombieBrain, 1), 0.02f); - CHICKEN.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetChicken, 1), 0.09f); - BEEF.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetBeef, 1), 0.09f); - PORK.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetPork, 1), 0.09f); - TC_VOID.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetMetal, 1, ThaumcraftHelper.NuggetType.VOID_METAL.ordinal()), 0.155f); - } - } - - public static void initEquivalentExchange3Species() { - EE_MINIUM.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.16f); - - if (EquivalentExchangeHelper.isActive()) { - EE_MINIUM.addSpecialty(new ItemStack(EquivalentExchangeHelper.minuimShard), 0.06f); - } - } - - public static void initArsMagicaSpecies() { - AM_ESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.12f); - AM_QUINTESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.23f); - AM_EARTH.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); - AM_AIR.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); - AM_FIRE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); - AM_WATER.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); - AM_LIGHTNING.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); - AM_PLANT.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); - AM_ICE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); - AM_ARCANE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.19f); - AM_VORTEX.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.10f); - AM_WIGHT.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.30f) - .addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f); - - if (ArsMagicaHelper.isActive()) { - AM_QUINTESSENCE.addSpecialty(new ItemStack(ArsMagicaHelper.itemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), 0.05f); - AM_EARTH.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 0.07f); - AM_AIR.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.AIR.ordinal()), 0.07f); - AM_FIRE.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.FIRE.ordinal()), 0.07f); - AM_WATER.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.WATER.ordinal()), 0.07f); - AM_LIGHTNING.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.LIGHTNING.ordinal()), 0.07f); - AM_PLANT.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.PLANT.ordinal()), 0.07f); - AM_ICE.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ICE.ordinal()), 0.07f); - AM_ARCANE.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ARCANE.ordinal()), 0.11f); - AM_VORTEX.addSpecialty(new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 0.15f); - AM_WIGHT.addSpecialty(new ItemStack(ArsMagicaHelper.itemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), 0.11f); - } - } - - public static void initThermalExpansionProducts() { - TE_DANTE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f) - .addSpecialty(new ItemStack(Items.blaze_powder), 0.05f); - TE_PYRO.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f) - .addSpecialty(new ItemStack(Items.blaze_powder), 0.05f); - TE_DESTABILIZED.addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f) - .addSpecialty(new ItemStack(Items.redstone), 0.05f); - TE_LUX.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f) - .addSpecialty(new ItemStack(Items.glowstone_dust), 0.05f); - TE_WINSOME.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f) - .addSpecialty(new ItemStack(Items.ender_pearl), 0.05f); - TE_ENDEARING.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f); - TE_COAL.addProduct(ForestryHelper.itemHoneycomb, 0.10f) - .addProduct(Config.combs.getStackForType(CombType.TE_CARBON), 0.05f) - .addSpecialty(new ItemStack(Items.coal), 0.05f); - TE_BLIZZY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f); - TE_GELID.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f); - TE_SHOCKING.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.16f); - TE_AMPED.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.29f); - TE_GROUNDED.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.16f); - TE_ROCKING.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.29f); - - TE_SIGNALUS.addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f); - TE_LUMIUS.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f); - - if (ThermalModsHelper.isActive()) { - LogHelper.info("Thermal Expansion bees active"); - TE_BLIZZY.addSpecialty(ThermalModsHelper.dustBlizz, 0.09f); - TE_GELID.addSpecialty(ThermalModsHelper.dustCryotheum, 0.09f); - TE_DANTE.addSpecialty(ThermalModsHelper.dustSulfur, 0.09f); - TE_PYRO.addSpecialty(ThermalModsHelper.dustPyrotheum, 0.09f); - TE_SHOCKING.addSpecialty(ThermalModsHelper.dustBlitz, 0.09f); - TE_AMPED.addSpecialty(ThermalModsHelper.dustAerotheum, 0.09f); - TE_GROUNDED.addSpecialty(ThermalModsHelper.dustBasalz, 0.09f); - TE_ROCKING.addSpecialty(ThermalModsHelper.dustPetrotheum, 0.09f); - TE_WINSOME.addSpecialty(ThermalModsHelper.dustPlatinum, 0.09f); - TE_ENDEARING.addSpecialty(ThermalModsHelper.enderiumNugget, 0.09f); - TE_SIGNALUS.addSpecialty(ThermalModsHelper.signalumNugget, 0.09f); - TE_LUMIUS.addSpecialty(ThermalModsHelper.lumiumNugget, 0.09f); - } - } - - public static void initRedstoneArsenelProducts() { - RSA_FLUXED.addProduct(ForestryHelper.itemHoneycomb, 0.10f); - - if (RedstoneArsenalHelper.isActive()) { - RSA_FLUXED.addSpecialty(RedstoneArsenalHelper.fluxNugget, 0.09f); - } - } - - public static void initBotaniaProducts() { - BOT_ROOTED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f); - BOT_BOTANIC.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f) - .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f); - BOT_BLOSSOM.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.20f) - .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f); - BOT_FLORAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.25f) - .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f); - BOT_VAZBEE.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.05f) - .addProduct(new ItemStack(Items.dye, 1, 9), 0.20f) - .addProduct(new ItemStack(Blocks.wool, 1, 9), 0.02f) - .addProduct(new ItemStack(Blocks.red_flower, 1, 7), 0.06f) - .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.15f); - BOT_SOMNOLENT.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.08f) - .addProduct(Config.combs.getStackForType(CombType.SOUL), 0.15f); - BOT_DREAMING.addProduct(Config.combs.getStackForType(CombType.WATERY), 0.16f) - .addProduct(Config.combs.getStackForType(CombType.SOUL), 0.33f); - BOT_ALFHEIM.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.28f); - - if (BotaniaHelper.isActive()) { - for (int i = 0; i < 16; ++i) { - ItemStack petal = new ItemStack(BotaniaHelper.itemPetal, 1, i); - BOT_BOTANIC.addSpecialty(petal, 0.01f); - BOT_BLOSSOM.addSpecialty(petal, 0.04f); - BOT_FLORAL.addSpecialty(petal, 0.16f); - } + TE_ELECTRUM.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("nuggetElectrum").size() > 0 + && OreDictionary.getOres("ingotElectrum").size() > 0) { + TE_ELECTRUM.addSpecialty(OreDictionary.getOres("nuggetElectrum").get(0), 0.18f); + } else { + TE_ELECTRUM.setInactive(); + } - for (PastureSeed type : PastureSeed.values()) { - BOT_VAZBEE.addSpecialty(new ItemStack(BotaniaHelper.itemPastureSeed, 1, type.ordinal()), 0.04f); - } - } - } - - public static void initAppEngProducts() { - AE_SKYSTONE.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.19f); - if (AppliedEnergisticsHelper.skystone != null) { - AE_SKYSTONE.addSpecialty(new ItemStack(AppliedEnergisticsHelper.skystone), 0.02f); - } - else { - AE_SKYSTONE.setInactive(); - } - } + MANYULLYN.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("nuggetManyullyn").size() > 0) { + MANYULLYN.addSpecialty(OreDictionary.getOres("nuggetManyullyn").get(0), 0.16f); + } else { + MANYULLYN.setInactive(); + } + + OSMIUM.addProduct(ForestryHelper.itemHoneycomb, 0.15f); + if (OreDictionary.getOres("nuggetOsmium").size() > 0) { + OSMIUM.addSpecialty(OreDictionary.getOres("nuggetOsmium").get(0), 0.16f); + } else { + OSMIUM.setInactive(); + } + + CERTUS.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("crystalCertusQuartz").size() > 0) { + CERTUS.addSpecialty(OreDictionary.getOres("crystalCertusQuartz").get(0), 0.08f); + } else { + CERTUS.setInactive(); + } + + SILICON.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("itemSilicon").size() > 0) { + SILICON.addSpecialty(OreDictionary.getOres("itemSilicon").get(0), 0.16f); + } else { + SILICON.setInactive(); + } + + FLUIX.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + if (OreDictionary.getOres("crystalFluix").size() > 0) { + FLUIX.addSpecialty(OreDictionary.getOres("crystalFluix").get(0), 0.06f); + } else { + FLUIX.setInactive(); + } + } + + public static void initThaumcraftProducts() { + TC_AIR.addProduct(Config.combs.getStackForType(CombType.TC_AIR), 0.20f); + TC_FIRE.addProduct(Config.combs.getStackForType(CombType.TC_FIRE), 0.20f); + TC_WATER.addProduct(Config.combs.getStackForType(CombType.TC_WATER), 0.20f); + TC_EARTH.addProduct(Config.combs.getStackForType(CombType.TC_EARTH), 0.20f); + TC_ORDER.addProduct(Config.combs.getStackForType(CombType.TC_ORDER), 0.20f); + TC_CHAOS.addProduct(Config.combs.getStackForType(CombType.TC_CHAOS), 0.20f); + + TC_VIS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.10f); + TC_REJUVENATING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f); + TC_EMPOWERING.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.14f); + TC_EMPOWERING.addSpecialty( + new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), 0.02f); + TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.25f); + TC_NEXUS.addProduct(Config.combs.getStackForType(CombType.TEMPORAL), 0.12f); + TC_NEXUS.addSpecialty( + new ItemStack(ForestryHelper.pollen, 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), 0.02f); + TC_TAINT.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.18f); + TC_TAINT.addProduct( + new ItemStack(ForestryHelper.craftingResource, 1, ForestryHelper.Propolis.STICKY.ordinal()), 0.213f); + TC_PURE.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.16f); + TC_PURE.addSpecialty(Config.combs.getStackForType(CombType.SOUL), 0.19f); + TC_HUNGRY.addProduct(Config.combs.getStackForType(CombType.INTELLECT), 0.28f); + TC_HUNGRY.addSpecialty(Config.combs.getStackForType(CombType.TEMPORAL), 0.195f); + TC_WISPY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.SILKY.ordinal()), 0.22f) + .addSpecialty( + new ItemStack( + ForestryHelper.craftingResource, + 1, + ForestryHelper.CraftingMaterial.SILK_WISP.ordinal()), + 0.04f); + TC_VOID.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + + if (ThaumcraftHelper.isActive()) { + SCHOLARLY.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.02f); + SAVANT.addSpecialty(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT), 0.05f); + + TC_AIR.addSpecialty(Config.propolis.getStackForType(PropolisType.AIR), 0.18f); + TC_FIRE.addSpecialty(Config.propolis.getStackForType(PropolisType.FIRE), 0.18f); + TC_WATER.addSpecialty(Config.propolis.getStackForType(PropolisType.WATER), 0.18f); + TC_EARTH.addSpecialty(Config.propolis.getStackForType(PropolisType.EARTH), 0.18f); + TC_ORDER.addSpecialty(Config.propolis.getStackForType(PropolisType.ORDER), 0.18f); + TC_CHAOS.addSpecialty(Config.propolis.getStackForType(PropolisType.CHAOS), 0.18f); + + BATTY.addSpecialty(new ItemStack(Items.gunpowder), 0.04f); + BRAINY.addSpecialty(new ItemStack(ThaumcraftHelper.zombieBrain, 1), 0.02f); + CHICKEN.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetChicken, 1), 0.09f); + BEEF.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetBeef, 1), 0.09f); + PORK.addSpecialty(new ItemStack(ThaumcraftHelper.nuggetPork, 1), 0.09f); + TC_VOID.addSpecialty( + new ItemStack(ThaumcraftHelper.nuggetMetal, 1, ThaumcraftHelper.NuggetType.VOID_METAL.ordinal()), + 0.155f); + } + } + + public static void initEquivalentExchange3Species() { + EE_MINIUM.addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.16f); + + if (EquivalentExchangeHelper.isActive()) { + EE_MINIUM.addSpecialty(new ItemStack(EquivalentExchangeHelper.minuimShard), 0.06f); + } + } + + public static void initArsMagicaSpecies() { + AM_ESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.12f); + AM_QUINTESSENCE.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.23f); + AM_EARTH.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); + AM_AIR.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); + AM_FIRE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); + AM_WATER.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); + AM_LIGHTNING.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); + AM_PLANT.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); + AM_ICE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.12f); + AM_ARCANE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 0.19f); + AM_VORTEX.addProduct(Config.combs.getStackForType(CombType.AM_ESSENCE), 0.10f); + AM_WIGHT.addProduct(Config.combs.getStackForType(CombType.SOUL), 0.30f) + .addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f); + + if (ArsMagicaHelper.isActive()) { + AM_QUINTESSENCE.addSpecialty( + new ItemStack( + ArsMagicaHelper.itemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), + 0.05f); + AM_EARTH.addSpecialty( + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 0.07f); + AM_AIR.addSpecialty( + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.AIR.ordinal()), 0.07f); + AM_FIRE.addSpecialty( + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.FIRE.ordinal()), 0.07f); + AM_WATER.addSpecialty( + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.WATER.ordinal()), 0.07f); + AM_LIGHTNING.addSpecialty( + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.LIGHTNING.ordinal()), 0.07f); + AM_PLANT.addSpecialty( + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.PLANT.ordinal()), 0.07f); + AM_ICE.addSpecialty( + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ICE.ordinal()), 0.07f); + AM_ARCANE.addSpecialty( + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.ARCANE.ordinal()), 0.11f); + AM_VORTEX.addSpecialty( + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 0.15f); + AM_WIGHT.addSpecialty( + new ItemStack( + ArsMagicaHelper.itemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), + 0.11f); + } + } + + public static void initThermalExpansionProducts() { + TE_DANTE.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f) + .addSpecialty(new ItemStack(Items.blaze_powder), 0.05f); + TE_PYRO.addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.MOLTEN), 0.10f) + .addSpecialty(new ItemStack(Items.blaze_powder), 0.05f); + TE_DESTABILIZED + .addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f) + .addSpecialty(new ItemStack(Items.redstone), 0.05f); + TE_LUX.addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f) + .addSpecialty(new ItemStack(Items.glowstone_dust), 0.05f); + TE_WINSOME + .addProduct(Config.combs.getStackForType(CombType.FURTIVE), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f) + .addSpecialty(new ItemStack(Items.ender_pearl), 0.05f); + TE_ENDEARING + .addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.TE_ENDEARING), 0.05f); + TE_COAL.addProduct(ForestryHelper.itemHoneycomb, 0.10f) + .addProduct(Config.combs.getStackForType(CombType.TE_CARBON), 0.05f) + .addSpecialty(new ItemStack(Items.coal), 0.05f); + TE_BLIZZY.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f); + TE_GELID.addProduct(new ItemStack(ForestryHelper.beeComb, 1, ForestryHelper.Comb.FROZEN.ordinal()), 0.10f); + TE_SHOCKING.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.16f); + TE_AMPED.addProduct(Config.combs.getStackForType(CombType.AIRY), 0.29f); + TE_GROUNDED.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.16f); + TE_ROCKING.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.29f); + + TE_SIGNALUS + .addProduct(Config.combs.getStackForType(CombType.TE_DESTABILIZED), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f); + TE_LUMIUS + .addProduct(Config.combs.getStackForType(CombType.TE_LUX), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.OCCULT), 0.10f); + + if (ThermalModsHelper.isActive()) { + LogHelper.info("Thermal Expansion bees active"); + TE_BLIZZY.addSpecialty(ThermalModsHelper.dustBlizz, 0.09f); + TE_GELID.addSpecialty(ThermalModsHelper.dustCryotheum, 0.09f); + TE_DANTE.addSpecialty(ThermalModsHelper.dustSulfur, 0.09f); + TE_PYRO.addSpecialty(ThermalModsHelper.dustPyrotheum, 0.09f); + TE_SHOCKING.addSpecialty(ThermalModsHelper.dustBlitz, 0.09f); + TE_AMPED.addSpecialty(ThermalModsHelper.dustAerotheum, 0.09f); + TE_GROUNDED.addSpecialty(ThermalModsHelper.dustBasalz, 0.09f); + TE_ROCKING.addSpecialty(ThermalModsHelper.dustPetrotheum, 0.09f); + TE_WINSOME.addSpecialty(ThermalModsHelper.dustPlatinum, 0.09f); + TE_ENDEARING.addSpecialty(ThermalModsHelper.enderiumNugget, 0.09f); + TE_SIGNALUS.addSpecialty(ThermalModsHelper.signalumNugget, 0.09f); + TE_LUMIUS.addSpecialty(ThermalModsHelper.lumiumNugget, 0.09f); + } + } + + public static void initRedstoneArsenelProducts() { + RSA_FLUXED.addProduct(ForestryHelper.itemHoneycomb, 0.10f); + + if (RedstoneArsenalHelper.isActive()) { + RSA_FLUXED.addSpecialty(RedstoneArsenalHelper.fluxNugget, 0.09f); + } + } + + public static void initBotaniaProducts() { + BOT_ROOTED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f); + BOT_BOTANIC + .addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.10f) + .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f); + BOT_BLOSSOM + .addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.20f) + .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f); + BOT_FLORAL + .addProduct(Config.combs.getStackForType(CombType.MUNDANE), 0.25f) + .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.05f); + BOT_VAZBEE + .addProduct(Config.combs.getStackForType(CombType.SOUL), 0.05f) + .addProduct(new ItemStack(Items.dye, 1, 9), 0.20f) + .addProduct(new ItemStack(Blocks.wool, 1, 9), 0.02f) + .addProduct(new ItemStack(Blocks.red_flower, 1, 7), 0.06f) + .addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 0.15f); + BOT_SOMNOLENT + .addProduct(Config.combs.getStackForType(CombType.WATERY), 0.08f) + .addProduct(Config.combs.getStackForType(CombType.SOUL), 0.15f); + BOT_DREAMING + .addProduct(Config.combs.getStackForType(CombType.WATERY), 0.16f) + .addProduct(Config.combs.getStackForType(CombType.SOUL), 0.33f); + BOT_ALFHEIM.addProduct(Config.combs.getStackForType(CombType.OTHERWORLDLY), 0.28f); + + if (BotaniaHelper.isActive()) { + for (int i = 0; i < 16; ++i) { + ItemStack petal = new ItemStack(BotaniaHelper.itemPetal, 1, i); + BOT_BOTANIC.addSpecialty(petal, 0.01f); + BOT_BLOSSOM.addSpecialty(petal, 0.04f); + BOT_FLORAL.addSpecialty(petal, 0.16f); + } + + for (PastureSeed type : PastureSeed.values()) { + BOT_VAZBEE.addSpecialty(new ItemStack(BotaniaHelper.itemPastureSeed, 1, type.ordinal()), 0.04f); + } + } + } + + public static void initAppEngProducts() { + AE_SKYSTONE.addProduct(Config.combs.getStackForType(CombType.EARTHY), 0.19f); + if (AppliedEnergisticsHelper.skystone != null) { + AE_SKYSTONE.addSpecialty(new ItemStack(AppliedEnergisticsHelper.skystone), 0.02f); + } else { + AE_SKYSTONE.setInactive(); + } + } } diff --git a/src/main/java/magicbees/bees/BeeSpecies.java b/src/main/java/magicbees/bees/BeeSpecies.java index 7c963da..ce17eaf 100644 --- a/src/main/java/magicbees/bees/BeeSpecies.java +++ b/src/main/java/magicbees/bees/BeeSpecies.java @@ -1,13 +1,5 @@ package magicbees.bees; -import magicbees.main.utils.compat.AppliedEnergisticsHelper; -import magicbees.main.utils.compat.ArsMagicaHelper; -import magicbees.main.utils.compat.BotaniaHelper; -import magicbees.main.utils.compat.EquivalentExchangeHelper; -import magicbees.main.utils.compat.RedstoneArsenalHelper; -import magicbees.main.utils.compat.ThaumcraftHelper; -import magicbees.main.utils.compat.ThermalModsHelper; -import net.minecraft.item.ItemStack; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IAlleleBeeSpecies; @@ -22,699 +14,1780 @@ import forestry.api.genetics.EnumTolerance; import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleTolerance; import forestry.api.genetics.IClassification; - -public enum BeeSpecies -{ - MYSTICAL("Mystical", "mysticum", BeeClassification.VEILED, - 0xAFFFB7, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true), - SORCEROUS("Sorcerous", "fascinatio", BeeClassification.VEILED, - 0xEA9A9A, EnumTemperature.HOT, EnumHumidity.ARID, false, false, true), - UNUSUAL("Unusual", "inusitatus", BeeClassification.VEILED, - 0x72D361, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true), - ATTUNED("Attuned", "similis", BeeClassification.VEILED, - 0x0086A8, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true), - - ELDRITCH("Eldritch", "prodigiosus", BeeClassification.VEILED, - 0x8D75A0, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - - ESOTERIC("Esoteric", "secretiore", BeeClassification.ARCANE, - 0x001099, BodyColours.ARCANE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - MYSTERIOUS("Mysterious", "mysticus", BeeClassification.ARCANE, - 0x762bc2, BodyColours.ARCANE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - ARCANE("Arcane", "arcanus", BeeClassification.ARCANE, - 0xd242df, BodyColours.ARCANE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true), - - CHARMED("Charmed", "larvatus", BeeClassification.SUPERNATURAL, - 0x48EEEC, BodyColours.ARCANE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - ENCHANTED("Enchanted", "cantatus", BeeClassification.SUPERNATURAL, - 0x18e726, BodyColours.ARCANE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - SUPERNATURAL("Supernatural", "coeleste", BeeClassification.SUPERNATURAL, - 0x005614, BodyColours.ARCANE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true), - - ETHEREAL("Ethereal", "diaphanum",BeeClassification.MAGICAL, - 0xBA3B3B, 0xEFF8FF, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - - WATERY("Watery", "aquatilis", BeeClassification.MAGICAL, - 0x313C5E, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - EARTHY("Earthen", "fictili", BeeClassification.MAGICAL, - 0x78822D, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - FIREY("Firey", "ardens", BeeClassification.MAGICAL, - 0xD35119, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - WINDY("Windy", "ventosum", BeeClassification.MAGICAL, - 0xFFFDBA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - - PUPIL("Pupil", "disciplina", BeeClassification.SCHOLARLY, - 0xFFFF00, EnumTemperature.NORMAL, EnumHumidity.ARID, false, true), - SCHOLARLY("Scholarly", "studiosis", BeeClassification.SCHOLARLY, - 0x6E0000, EnumTemperature.NORMAL, EnumHumidity.ARID, false, false), - SAVANT("Savant", "philologus", BeeClassification.SCHOLARLY, - 0xFFA042, EnumTemperature.NORMAL, EnumHumidity.ARID, true, false), - - AWARE("Aware", "sensibilis", BeeClassification.MAGICAL, - 0x5E95B5, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - SPIRIT("Spirit", "larva", BeeClassification.SOUL, - 0xb2964b, EnumTemperature.WARM, EnumHumidity.NORMAL, false, true), - SOUL("Soul", "anima", BeeClassification.SOUL, - 0x7d591b, EnumTemperature.HELLISH, EnumHumidity.NORMAL, true, false), - - SKULKING("Skulking", "malevolens", BeeClassification.SKULKING, - 0x524827, BodyColours.SKULKING, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - GHASTLY("Ghastly", "pallens", BeeClassification.SKULKING, - 0xccccee, 0xbf877c, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - SPIDERY("Spidery", "araneolus", BeeClassification.SKULKING, - 0x0888888, 0x222222, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - SMOULDERING("Smouldering", "flagrantia", BeeClassification.SKULKING, - 0xFFC747, 0xEA8344, EnumTemperature.HELLISH, EnumHumidity.NORMAL, false, false), - BRAINY("TCBrainy", "cerebrum", BeeClassification.SKULKING, - 0x83FF70, BodyColours.SKULKING, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - BIGBAD("BigBad", "magnumalum", BeeClassification.SKULKING, - 0xA9344B, 0x453536, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true, true, true), - CHICKEN("TCChicken", "pullus", BeeClassification.FLESHY, - 0xFF0000, 0xD3D3D3, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - BEEF("TCBeef", "bubulae", BeeClassification.FLESHY, - 0xB7B7B7, 0x3F3024, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - PORK("TCPork", "porcina", BeeClassification.FLESHY, - 0xF1AEAC, 0xDF847B, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - BATTY("TCBatty", "chiroptera", BeeClassification.FLESHY, - 0x5B482B, 0x271B0F, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - SHEEPISH("Sheepish", "balans", BeeClassification.FLESHY, - 0xF7F7F7, 0xCACACA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - HORSE("Horse", "equus", BeeClassification.FLESHY, - 0x906330, 0x7B4E1B, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - CATTY("Catty", "feline", BeeClassification.FLESHY, - 0xECE684, 0x563C24, EnumTemperature.HOT, EnumHumidity.NORMAL, false, true), - - TIMELY("Timely", "gallifreis", BeeClassification.TIME, - 0xC6AF86, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - LORDLY("Lordly", "rassilonis", BeeClassification.TIME, - 0xC6AF86, 0x8E0213, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - DOCTORAL("Doctoral", "medicus qui", BeeClassification.TIME, - 0xDDE5FC, 0x4B6E8C, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - - INFERNAL("Infernal", "infernales", BeeClassification.ABOMINABLE, - 0xFF1C1C, BodyColours.ABOMINABLE, EnumTemperature.HELLISH, EnumHumidity.ARID, false, true), - HATEFUL("Hateful", "odibilis", BeeClassification.ABOMINABLE, - 0xDB00DB, BodyColours.ABOMINABLE, EnumTemperature.HELLISH, EnumHumidity.ARID, false, false), - SPITEFUL("Spiteful", "maligna", BeeClassification.ABOMINABLE, - 0x5FCC00, BodyColours.ABOMINABLE, EnumTemperature.HELLISH, EnumHumidity.ARID, true, false), - WITHERING("Withering", "vietus", BeeClassification.ABOMINABLE, - 0x5B5B5B, BodyColours.ABOMINABLE, EnumTemperature.HELLISH, EnumHumidity.ARID, true, false), - - OBLIVION("Oblivion", "oblivioni", BeeClassification.EXTRINSIC, - 0xD5C3E5, BodyColours.EXTRINSIC, EnumTemperature.COLD, EnumHumidity.NORMAL, false, false), - NAMELESS("Nameless", "sine nomine", BeeClassification.EXTRINSIC, - 0x8ca7cb, BodyColours.EXTRINSIC, EnumTemperature.COLD, EnumHumidity.NORMAL, false, true), - ABANDONED("Abandoned", "reliquit", BeeClassification.EXTRINSIC, - 0xc5cb8c, BodyColours.EXTRINSIC, EnumTemperature.COLD, EnumHumidity.NORMAL, false, true), - FORLORN("Forlorn", "perditus", BeeClassification.EXTRINSIC, - 0xcba88c, BodyColours.EXTRINSIC, EnumTemperature.COLD, EnumHumidity.NORMAL, true, false), - DRACONIC("Draconic", "draconic", BeeClassification.EXTRINSIC, - 0x9f56ad, 0x5a3b62, EnumTemperature.COLD, EnumHumidity.NORMAL, true, false), - - IRON("Iron", "ferrus", BeeClassification.METALLIC, - 0x686868, 0xE9E9E9, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - GOLD("Gold", "aurum", BeeClassification.METALLIC, - 0x684B01, 0xFFFF0B, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false), - COPPER("Copper", "aercus", BeeClassification.METALLIC, - 0x684B01, 0xFFC81A, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - TIN("Tin", "stannum", BeeClassification.METALLIC, - 0x3E596D, 0xA6BACB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - SILVER("Silver", "argenteus", BeeClassification.METALLIC, - 0x747C81, 0x96BFC4, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - LEAD("Lead", "plumbeus", BeeClassification.METALLIC, - 0x96BFC4, 0x91A9F3, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - ALUMINUM("Aluminum", "aluminium", BeeClassification.METALLIC, - 0xEDEDED, 0x767676, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - ARDITE("Ardite", "aurantiaco", BeeClassification.METALLIC, - 0x720000, 0xFF9E00, EnumTemperature.HOT, EnumHumidity.ARID, false, false), - COBALT("Cobalt", "caeruleo", BeeClassification.METALLIC, - 0x03265F, 0x59AAEF, EnumTemperature.HOT, EnumHumidity.ARID, false, false), - MANYULLYN("Manyullyn", "manahmanah", BeeClassification.METALLIC, - 0x481D6D, 0xBD92F1, EnumTemperature.HOT, EnumHumidity.ARID, true, false), - OSMIUM("Osmium", "hyacintho", BeeClassification.METALLIC, - 0x374B5B, 0x6C7B89, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - - DIAMOND("Diamond", "diamond", BeeClassification.GEM, - 0x209581, 0x8DF5E3, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false), - EMERALD("Emerald", "prasinus", BeeClassification.GEM, - 0x005300, 0x17DD62, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false), - APATITE("Apatite", "apatite", BeeClassification.GEM, - 0x2EA7EC, 0x001D51, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - SILICON("Silicon", "siliconisque", BeeClassification.GEM, - 0xADA2A7, 0x736675, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - CERTUS("Certus", "alia cristallum", BeeClassification.GEM, - 0x93C7FF, 0xA6B8C7, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - FLUIX("Fluix", "alien cristallum", BeeClassification.GEM, - 0xFC639E, 0x534797, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - - MUTABLE("Mutable", "mutable", BeeClassification.TRANSMUTING, - 0xDBB24C, 0xE0D5A6, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TRANSMUTING("Transmuting", "transmuting", BeeClassification.TRANSMUTING, - 0xDBB24C, 0xA2D2D8, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - CRUMBLING("Crumbling", "crumbling", BeeClassification.TRANSMUTING, - 0xDBB24C, 0xDBA4A4, EnumTemperature.HOT, EnumHumidity.ARID, false, false), - - INVISIBLE("Invisible", "invisible", BeeClassification.VEILED, - 0xffccff, 0xffffff, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - - // --------- Thaumcraft Bees --------------------------------------------------------------------------------------- - TC_AIR("TCAir", "aether", BeeClassification.THAUMIC, - 0xD9D636, BodyColours.THAUMCRAFT_SHARD, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true), - TC_FIRE("TCFire", "praefervidus", BeeClassification.THAUMIC, - 0xE50B0B, BodyColours.THAUMCRAFT_SHARD, EnumTemperature.HOT, EnumHumidity.ARID, true, true), - TC_WATER("TCWater", "umidus", BeeClassification.THAUMIC, - 0x36CFD9, BodyColours.THAUMCRAFT_SHARD, EnumTemperature.NORMAL, EnumHumidity.DAMP, true, true), - TC_EARTH("TCEarth", "sordida", BeeClassification.THAUMIC, - 0x005100, BodyColours.THAUMCRAFT_SHARD, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true), - TC_ORDER("TCOrder", "ordinatus", BeeClassification.THAUMIC, - 0xaa32fc, BodyColours.THAUMCRAFT_SHARD, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true), - TC_CHAOS("TCChaos", "tenebrarum", BeeClassification.THAUMIC, - 0xCCCCCC, BodyColours.THAUMCRAFT_SHARD, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false), - - TC_VIS("TCVis", "arcanus saecula", BeeClassification.THAUMIC, - 0x004c99, BodyColours.THAUMCRAFT_NODE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TC_REJUVENATING("TCRejuvenating", "arcanus vitae", BeeClassification.THAUMIC, - 0x91D0D9, BodyColours.THAUMCRAFT_NODE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TC_EMPOWERING("TCEmpowering", "tractus", BeeClassification.THAUMIC, - 0x96FFBC, BodyColours.THAUMCRAFT_NODE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - TC_NEXUS("TCNexus", "nexi", BeeClassification.THAUMIC, - 0x15AFAF, BodyColours.THAUMCRAFT_NODE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false), - TC_TAINT("TCFlux", "arcanus labe", BeeClassification.THAUMIC, - 0x91376A, BodyColours.THAUMCRAFT_NODE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TC_PURE("TCPure", "arcanus puritatem", BeeClassification.THAUMIC, - 0xE23F65, BodyColours.THAUMCRAFT_NODE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TC_HUNGRY("TCHungry", "omnique", BeeClassification.THAUMIC, - 0xDCA5E2, BodyColours.THAUMCRAFT_NODE, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - - TC_WISPY("TCWispy", "umbrabilis", BeeClassification.THAUMIC, - 0x9cb8d5, BodyColours.SKULKING, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TC_VOID("TCVoid", "obscurus", BeeClassification.METALLIC, - 0x180A29, 0x4B2A74, EnumTemperature.ICY, EnumHumidity.NORMAL, false, false), - - // --------- Equivalent Exchange Bees ----------------------------------------------------------------------------- - EE_MINIUM("EEMinium", "mutabilis", BeeClassification.ALCHEMICAL, - 0xac0921, 0x3a030b, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - - // --------- Ars Magica Bees -------------------------------------------------------------------------------------- - AM_ESSENCE("AMEssence", "essentia", BeeClassification.ESSENTIAL, - 0x86BBC5, BodyColours.ARSMAGICA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - AM_QUINTESSENCE("AMQuintessence", "cor essentia", BeeClassification.ESSENTIAL, - 0xE3A45B, BodyColours.ARSMAGICA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true), - - AM_EARTH("AMEarth", "magica terra", BeeClassification.ESSENTIAL, - 0xAA875E, BodyColours.ARSMAGICA, EnumTemperature.WARM, EnumHumidity.ARID, false, false), - AM_AIR("AMAir", "magica aer", BeeClassification.ESSENTIAL, - 0xD5EB9D, BodyColours.ARSMAGICA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - AM_FIRE("AMFire", "magica ignis", BeeClassification.ESSENTIAL, - 0x93451E, BodyColours.ARSMAGICA, EnumTemperature.HOT, EnumHumidity.ARID, false, false), - AM_WATER("AMWater", "magica aqua", BeeClassification.ESSENTIAL, - 0x3B7D8C, BodyColours.ARSMAGICA, EnumTemperature.NORMAL, EnumHumidity.DAMP, false, false), - AM_LIGHTNING("AMLightning", "magica fulgur", BeeClassification.ESSENTIAL, - 0xEBEFA1, BodyColours.ARSMAGICA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - AM_PLANT("AMPlant", "magica herba", BeeClassification.ESSENTIAL, - 0x49B549, BodyColours.ARSMAGICA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - AM_ICE("AMIce", "magica glacium", BeeClassification.ESSENTIAL, - 0x86BAC6, BodyColours.ARSMAGICA, EnumTemperature.COLD, EnumHumidity.NORMAL, false, false), - AM_ARCANE("AMArcane", "magica arcanum", BeeClassification.ESSENTIAL, - 0x76184D, BodyColours.ARSMAGICA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false), - - AM_VORTEX("AMVortex", "gurges", BeeClassification.ESSENTIAL, - 0x71BBE2, 0x0B35A8, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - AM_WIGHT("AMWight", "vectem", BeeClassification.ESSENTIAL, - 0xB50000, 0x4C4837, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - - // ---------------------Thermal Expansion Bees--------------------------- - TE_BLIZZY("TEBlizzy", "blizzard", BeeClassification.ABOMINABLE, - 0x0073C4, EnumTemperature.COLD, EnumHumidity.NORMAL, false, false), - TE_GELID("TEGelid", "cyro", BeeClassification.ABOMINABLE, - 0x4AAFF7, EnumTemperature.COLD, EnumHumidity.NORMAL, true, true), - TE_DANTE("TEDante", "inferno", BeeClassification.ABOMINABLE, - 0xF7AC4A, EnumTemperature.HELLISH, EnumHumidity.ARID, false, false), - TE_PYRO("TEPyro", "pyromania", BeeClassification.ABOMINABLE, - 0xFA930C, EnumTemperature.HELLISH, EnumHumidity.ARID, true, true), - TE_SHOCKING("TEShocking", "horrendum", BeeClassification.ABOMINABLE, - 0xC5FF26, 0xF8EE00, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TE_AMPED("TEAmped", "concitatus", BeeClassification.ABOMINABLE, - 0x8AFFFF, 0xECE670, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false), - TE_GROUNDED("TEGrounded", "tellus", BeeClassification.ABOMINABLE, - 0xCEC1C1, 0x826767, EnumTemperature.HOT, EnumHumidity.ARID, false, true), - TE_ROCKING("TERocking", "saxsous", BeeClassification.ABOMINABLE, - 0x980000, 0xAB9D9B, EnumTemperature.HOT, EnumHumidity.ARID, true, true), - - TE_ELECTRUM("TEElectrum", "electrum", BeeClassification.THERMAL, - 0xEAF79E, EnumTemperature.HOT,EnumHumidity.ARID, false, false), - TE_PLATINUM("TEPlatinum", "platina", BeeClassification.THERMAL, - 0x9EE7F7, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TE_NICKEL("TENickel", "nickel",BeeClassification.THERMAL, - 0xB4C989, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TE_INVAR("TEInvar", "invar", BeeClassification.THERMAL, - 0xCDE3A1, EnumTemperature.HOT, EnumHumidity.ARID, false, false), - TE_BRONZE("TEBronze", "pyropus", BeeClassification.THERMAL, - 0xB56D07, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TE_COAL("TECoal", "carbonis", BeeClassification.THERMAL, - 0x2E2D2D, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TE_DESTABILIZED("TEDestabilized", "electric", BeeClassification.THERMAL, - 0x5E0203, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TE_LUX("TELux", "lux", BeeClassification.THERMAL, - 0xF1FA89, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - TE_WINSOME("TEWinsome", "cuniculus", BeeClassification.ADORABLE, - 0x096B67, EnumTemperature.COLD, EnumHumidity.NORMAL, false, false), - TE_ENDEARING("TEEndearing", "cognito", BeeClassification.ADORABLE, - 0x069E97, EnumTemperature.COLD, EnumHumidity.NORMAL, true, true), - TE_SIGNALUS("TESignalus", "scelerisque", BeeClassification.THERMAL, - 0x5E0203, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true), - TE_LUMIUS("TELumius", "lucidum", BeeClassification.THERMAL, - 0xF1FA89, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true), - - // --------------------Redstone Arsenal Bees----------------------------- - RSA_FLUXED("RSAFluxed", "Thermametallic electroflux", BeeClassification.THERMAL, - 0x9E060D, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - - // ----------------------Botania Bees--------------------------------------- - BOT_ROOTED("BotRooted", "truncus", BeeClassification.BOTANICAL, - 0x00A800, BodyColours.BOTANIA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - - BOT_BOTANIC("BotBotanic", "botanica", BeeClassification.BOTANICAL, - 0x94C661, BodyColours.BOTANIA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - BOT_BLOSSOM("BotBlossom", "viridis", BeeClassification.BOTANICAL, - 0xA4C193, BodyColours.BOTANIA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - BOT_FLORAL("BotFloral", "florens", BeeClassification.BOTANICAL, - 0x29D81A, BodyColours.BOTANIA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true), - - BOT_VAZBEE("BotVazbee", "vazbii", BeeClassification.BOTANICAL, - 0xff6b9c, BodyColours.BOTANIA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - - BOT_SOMNOLENT("BotSomnolent", "soporatus", BeeClassification.BOTANICAL, - 0x2978C6, BodyColours.BOTANIA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true, true, true), - BOT_DREAMING("BotDreaming", "somnior", BeeClassification.BOTANICAL, - 0x123456, BodyColours.BOTANIA, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true, true, true), - - BOT_ALFHEIM("BotAlfheim", "alfheimis", BeeClassification.BOTANICAL, - -1, -1, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), - - // -------------------Applied Energistics 2 Bees--------------------------- - AE_SKYSTONE("AESkystone", "terra astris", BeeClassification.TRANSMUTING, - 0x4B8381, 0x252929, EnumTemperature.HOT, EnumHumidity.ARID, false, true), - - ; - - // For body colours used by more than one bee. - private class BodyColours { - static final int DEFAULT = 0xFF7C26; - static final int ARCANE = 0xFF9D60; - static final int ABOMINABLE = 0x960F00; - static final int EXTRINSIC = 0xF696FF; - static final int SKULKING = 0xe15236; - static final int THAUMCRAFT_SHARD = 0x999999; - static final int THAUMCRAFT_NODE = 0x675ED1; - static final int ARSMAGICA = 0xE3A55B; - static final int BOTANIA = 0xFFB2BB; - } - - public static void setupBeeSpecies() { - MYSTICAL.registerGenomeTemplate(BeeGenomeManager.getTemplateMystical()); - SORCEROUS.registerGenomeTemplate(BeeGenomeManager.getTemplateSorcerous()); - UNUSUAL.registerGenomeTemplate(BeeGenomeManager.getTemplateUnusual()); - ATTUNED.registerGenomeTemplate(BeeGenomeManager.getTemplateAttuned()); - ELDRITCH.registerGenomeTemplate(BeeGenomeManager.getTemplateEldritch()); - ESOTERIC.registerGenomeTemplate(BeeGenomeManager.getTemplateEsoteric()); - MYSTERIOUS.registerGenomeTemplate(BeeGenomeManager.getTemplateMysterious()); - ARCANE.registerGenomeTemplate(BeeGenomeManager.getTemplateArcane()); - CHARMED.registerGenomeTemplate(BeeGenomeManager.getTemplateCharmed()); - ENCHANTED.registerGenomeTemplate(BeeGenomeManager.getTemplateEnchanted()); - SUPERNATURAL.registerGenomeTemplate(BeeGenomeManager.getTemplateSupernatural()); - ETHEREAL.registerGenomeTemplate(BeeGenomeManager.getTemplateEthereal()); - WATERY.registerGenomeTemplate(BeeGenomeManager.getTemplateWatery()); - EARTHY.registerGenomeTemplate(BeeGenomeManager.getTemplateEarthy()); - FIREY.registerGenomeTemplate(BeeGenomeManager.getTemplateFirey()); - WINDY.registerGenomeTemplate(BeeGenomeManager.getTemplateWindy()); - PUPIL.registerGenomeTemplate(BeeGenomeManager.getTemplatePupil()); - SCHOLARLY.registerGenomeTemplate(BeeGenomeManager.getTemplateScholarly()); - SAVANT.registerGenomeTemplate(BeeGenomeManager.getTemplateSavant()); - AWARE.registerGenomeTemplate(BeeGenomeManager.getTemplateAware()); - SPIRIT.registerGenomeTemplate(BeeGenomeManager.getTemplateSpirit()); - SOUL.registerGenomeTemplate(BeeGenomeManager.getTemplateSoul()); - SKULKING.registerGenomeTemplate(BeeGenomeManager.getTemplateSkulking()); - GHASTLY.registerGenomeTemplate(BeeGenomeManager.getTemplateGhastly()); - SPIDERY.registerGenomeTemplate(BeeGenomeManager.getTemplateSpidery()); - SMOULDERING.registerGenomeTemplate(BeeGenomeManager.getTemplateSmouldering()); - BIGBAD.registerGenomeTemplate(BeeGenomeManager.getTemplateBigbad()); - CHICKEN.registerGenomeTemplate(BeeGenomeManager.getTemplateChicken()); - BEEF.registerGenomeTemplate(BeeGenomeManager.getTemplateBeef()); - PORK.registerGenomeTemplate(BeeGenomeManager.getTemplatePork()); - SHEEPISH.registerGenomeTemplate(BeeGenomeManager.getTemplateSheepish()); - HORSE.registerGenomeTemplate(BeeGenomeManager.getTemplateHorse()); - CATTY.registerGenomeTemplate(BeeGenomeManager.getTemplateCatty()); - TIMELY.registerGenomeTemplate(BeeGenomeManager.getTemplateTimely()); - LORDLY.registerGenomeTemplate(BeeGenomeManager.getTemplateLordly()); - DOCTORAL.registerGenomeTemplate(BeeGenomeManager.getTemplateDoctoral()); - INFERNAL.registerGenomeTemplate(BeeGenomeManager.getTemplateInfernal()); - HATEFUL.registerGenomeTemplate(BeeGenomeManager.getTemplateHateful()); - SPITEFUL.registerGenomeTemplate(BeeGenomeManager.getTemplateSpiteful()); - WITHERING.registerGenomeTemplate(BeeGenomeManager.getTemplateWithering()); - OBLIVION.registerGenomeTemplate(BeeGenomeManager.getTemplateOblivion()); - NAMELESS.registerGenomeTemplate(BeeGenomeManager.getTemplateNameless()); - ABANDONED.registerGenomeTemplate(BeeGenomeManager.getTemplateAbandoned()); - FORLORN.registerGenomeTemplate(BeeGenomeManager.getTemplateForlorn()); - DRACONIC.registerGenomeTemplate(BeeGenomeManager.getTemplateDraconic()); - IRON.registerGenomeTemplate(BeeGenomeManager.getTemplateIron()); - GOLD.registerGenomeTemplate(BeeGenomeManager.getTemplateGold()); - COPPER.registerGenomeTemplate(BeeGenomeManager.getTemplateCopper()); - TIN.registerGenomeTemplate(BeeGenomeManager.getTemplateTin()); - SILVER.registerGenomeTemplate(BeeGenomeManager.getTemplateSilver()); - LEAD.registerGenomeTemplate(BeeGenomeManager.getTemplateLead()); - ALUMINUM.registerGenomeTemplate(BeeGenomeManager.getTemplateAluminum()); - ARDITE.registerGenomeTemplate(BeeGenomeManager.getTemplateArdite()); - COBALT.registerGenomeTemplate(BeeGenomeManager.getTemplateCobalt()); - MANYULLYN.registerGenomeTemplate(BeeGenomeManager.getTemplateManyullyn()); - OSMIUM.registerGenomeTemplate(BeeGenomeManager.getTemplateOsmium()); - DIAMOND.registerGenomeTemplate(BeeGenomeManager.getTemplateDiamond()); - EMERALD.registerGenomeTemplate(BeeGenomeManager.getTemplateEmerald()); - APATITE.registerGenomeTemplate(BeeGenomeManager.getTemplateApatite()); - SILICON.registerGenomeTemplate(BeeGenomeManager.getTemplateSilicon()); - FLUIX.registerGenomeTemplate(BeeGenomeManager.getTemplateFluix()); - CERTUS.registerGenomeTemplate(BeeGenomeManager.getTemplateCertus()); - MUTABLE.registerGenomeTemplate(BeeGenomeManager.getTemplateMutable()); - TRANSMUTING.registerGenomeTemplate(BeeGenomeManager.getTemplateTransmuting()); - CRUMBLING.registerGenomeTemplate(BeeGenomeManager.getTemplateCrumbling()); - INVISIBLE.registerGenomeTemplate(BeeGenomeManager.getTemplateInvisible()); - TC_AIR.registerGenomeTemplate(BeeGenomeManager.getTemplateTCAir()); - TC_FIRE.registerGenomeTemplate(BeeGenomeManager.getTemplateTCFire()); - TC_WATER.registerGenomeTemplate(BeeGenomeManager.getTemplateTCWater()); - TC_EARTH.registerGenomeTemplate(BeeGenomeManager.getTemplateTCEarth()); - TC_ORDER.registerGenomeTemplate(BeeGenomeManager.getTemplateTCOrder()); - TC_CHAOS.registerGenomeTemplate(BeeGenomeManager.getTemplateTCChaos()); - TC_VIS.registerGenomeTemplate(BeeGenomeManager.getTemplateTCVis()); - TC_REJUVENATING.registerGenomeTemplate(BeeGenomeManager.getTemplateTCRejuvinating()); - TC_EMPOWERING.registerGenomeTemplate(BeeGenomeManager.getTemplateTCEmpowering()); - TC_NEXUS.registerGenomeTemplate(BeeGenomeManager.getTemplateTCNexus()); - TC_TAINT.registerGenomeTemplate(BeeGenomeManager.getTemplateTCTaint()); - TC_PURE.registerGenomeTemplate(BeeGenomeManager.getTemplateTCPure()); - TC_HUNGRY.registerGenomeTemplate(BeeGenomeManager.getTemplateTCHungry()); - BRAINY.registerGenomeTemplate(BeeGenomeManager.getTemplateBrainy()); - TC_WISPY.registerGenomeTemplate(BeeGenomeManager.getTemplateTCWispy()); - BATTY.registerGenomeTemplate(BeeGenomeManager.getTemplateBatty()); - TC_VOID.registerGenomeTemplate(BeeGenomeManager.getTemplaceTCVoid()); - EE_MINIUM.registerGenomeTemplate(BeeGenomeManager.getTemplateEEMinium()); - AM_ESSENCE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMEssence()); - AM_QUINTESSENCE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMQuintessence()); - AM_EARTH.registerGenomeTemplate(BeeGenomeManager.getTemplateAMEarth()); - AM_AIR.registerGenomeTemplate(BeeGenomeManager.getTemplateAMAir()); - AM_FIRE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMFire()); - AM_WATER.registerGenomeTemplate(BeeGenomeManager.getTemplateAMWater()); - AM_LIGHTNING.registerGenomeTemplate(BeeGenomeManager.getTemplateAMLightning()); - AM_PLANT.registerGenomeTemplate(BeeGenomeManager.getTemplateAMPlant()); - AM_ICE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMIce()); - AM_ARCANE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMArcane()); - AM_VORTEX.registerGenomeTemplate(BeeGenomeManager.getTemplateAMVortex()); - AM_WIGHT.registerGenomeTemplate(BeeGenomeManager.getTemplateAMWight()); - TE_BLIZZY.registerGenomeTemplate(BeeGenomeManager.getTemplateTEBlizzy()); - TE_GELID.registerGenomeTemplate(BeeGenomeManager.getTemplateTEGelid()); - TE_DANTE.registerGenomeTemplate(BeeGenomeManager.getTemplateTEDante()); - TE_PYRO.registerGenomeTemplate(BeeGenomeManager.getTemplateTEPyro()); - TE_SHOCKING.registerGenomeTemplate(BeeGenomeManager.getTemplateTEShocking()); - TE_AMPED.registerGenomeTemplate(BeeGenomeManager.getTemplateTEAmped()); - TE_GROUNDED.registerGenomeTemplate(BeeGenomeManager.getTemplateTEGrounded()); - TE_ROCKING.registerGenomeTemplate(BeeGenomeManager.getTemplateTERocking()); - TE_ELECTRUM.registerGenomeTemplate(BeeGenomeManager.getTemplateTEElectrum()); - TE_PLATINUM.registerGenomeTemplate(BeeGenomeManager.getTemplateTEPlatinum()); - TE_NICKEL.registerGenomeTemplate(BeeGenomeManager.getTemplateTENickel()); - TE_INVAR.registerGenomeTemplate(BeeGenomeManager.getTemplateTEInvar()); - TE_BRONZE.registerGenomeTemplate(BeeGenomeManager.getTemplateTEBronze()); - TE_COAL.registerGenomeTemplate(BeeGenomeManager.getTemplateTECoal()); - TE_DESTABILIZED.registerGenomeTemplate(BeeGenomeManager.getTemplateTEDestabilized()); - TE_LUX.registerGenomeTemplate(BeeGenomeManager.getTemplateTELux()); - TE_WINSOME.registerGenomeTemplate(BeeGenomeManager.getTemplateTEWinsome()); - TE_ENDEARING.registerGenomeTemplate(BeeGenomeManager.getTemplateTEEndearing()); - TE_SIGNALUS.registerGenomeTemplate(BeeGenomeManager.getTemplateTESignalus()); - TE_LUMIUS.registerGenomeTemplate(BeeGenomeManager.getTemplateTELumius()); - RSA_FLUXED.registerGenomeTemplate(BeeGenomeManager.getTemplateRSAFluxed()); - BOT_ROOTED.registerGenomeTemplate(BeeGenomeManager.getTemplateBotRooted()); - BOT_BOTANIC.registerGenomeTemplate(BeeGenomeManager.getTemplateBotBotanic()); - BOT_BLOSSOM.registerGenomeTemplate(BeeGenomeManager.getTemplateBotBlossom()); - BOT_FLORAL.registerGenomeTemplate(BeeGenomeManager.getTemplateBotFloral()); - BOT_VAZBEE.registerGenomeTemplate(BeeGenomeManager.getTemplateBotVazbee()); - BOT_SOMNOLENT.registerGenomeTemplate(BeeGenomeManager.getTemplateBotSomnolent()); - BOT_DREAMING.registerGenomeTemplate(BeeGenomeManager.getTemplateBotDreaming()); - BOT_ALFHEIM.registerGenomeTemplate(BeeGenomeManager.getTemplateBotAelfheim()); - AE_SKYSTONE.registerGenomeTemplate(BeeGenomeManager.getTemplateAESkystone()); - - BeeProductHelper.initThaumcraftProducts(); - if (!ThaumcraftHelper.isActive()) { - TC_CHAOS.setInactive(); - TC_AIR.setInactive(); - TC_FIRE.setInactive(); - TC_WATER.setInactive(); - TC_EARTH.setInactive(); - TC_ORDER.setInactive(); - - TC_VIS.setInactive(); - TC_REJUVENATING.setInactive(); - TC_EMPOWERING.setInactive(); - TC_NEXUS.setInactive(); - TC_TAINT.setInactive(); - TC_PURE.setInactive(); - TC_HUNGRY.setInactive(); - - BRAINY.setInactive(); - - TC_WISPY.setInactive(); - TC_VOID.setInactive(); - } - - BeeProductHelper.initEquivalentExchange3Species(); - if (!EquivalentExchangeHelper.isActive()) { - EE_MINIUM.setInactive(); - } - - BeeProductHelper.initArsMagicaSpecies(); - if (!ArsMagicaHelper.isActive()) { - AM_ESSENCE.setInactive(); - AM_QUINTESSENCE.setInactive(); - AM_EARTH.setInactive(); - AM_AIR.setInactive(); - AM_FIRE.setInactive(); - AM_WATER.setInactive(); - AM_LIGHTNING.setInactive(); - AM_PLANT.setInactive(); - AM_ICE.setInactive(); - AM_ARCANE.setInactive(); - AM_VORTEX.setInactive(); - AM_WIGHT.setInactive(); - } - - BeeProductHelper.initThermalExpansionProducts(); - if (!ThermalModsHelper.isActive()) { - TE_BLIZZY.setInactive(); - TE_GELID.setInactive(); - TE_DANTE.setInactive(); - TE_PYRO.setInactive(); - TE_SHOCKING.setInactive(); - TE_AMPED.setInactive(); - TE_GROUNDED.setInactive(); - TE_ROCKING.setInactive(); - TE_DESTABILIZED.setInactive(); - TE_COAL.setInactive(); - TE_LUX.setInactive(); - TE_WINSOME.setInactive(); - TE_ENDEARING.setInactive(); - TE_SIGNALUS.setInactive(); - TE_LUMIUS.setInactive(); - } - - BeeProductHelper.initRedstoneArsenelProducts(); - if (!RedstoneArsenalHelper.isActive()) { - RSA_FLUXED.setInactive(); - } - - BeeProductHelper.initBotaniaProducts(); - if (!BotaniaHelper.isActive()) { - BOT_ROOTED.setInactive(); - BOT_BLOSSOM.setInactive(); - BOT_BOTANIC.setInactive(); - BOT_FLORAL.setInactive(); - BOT_VAZBEE.setInactive(); - BOT_SOMNOLENT.setInactive(); - BOT_DREAMING.setInactive(); - BOT_ALFHEIM.setInactive(); - } - - BeeProductHelper.initAppEngProducts(); - if (!AppliedEnergisticsHelper.isActive()) { - AE_SKYSTONE.setInactive(); - } - - for (BeeSpecies beeSpecies : BeeSpecies.values()) { - if (beeSpecies.isActive()) { - beeSpecies.setupCustomIconProvider(); - } - } - } - - private static final String authority = "MysteriousAges"; - - private final IAlleleBeeSpeciesCustom species; - private final EnumTemperature temperature; - private final EnumHumidity humidity; - - private boolean active = true; - - private IAllele genomeTemplate[]; - - BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, - EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesDominant) { - this(speciesName, genusName, classification, firstColour, BodyColours.DEFAULT, - preferredTemp, preferredHumidity, hasGlowEffect, true, true, isSpeciesDominant, false); - } - - BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, int secondColour, - EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesDominant) { - this(speciesName, genusName, classification, firstColour, secondColour, - preferredTemp, preferredHumidity, hasGlowEffect, true, true, isSpeciesDominant, false); - } - - BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, int secondColour, - EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean isSecret, boolean hasGlowEffect, boolean isSpeciesDominant) { - this(speciesName, genusName, classification, firstColour, secondColour, - preferredTemp, preferredHumidity, hasGlowEffect, isSecret, true, isSpeciesDominant, false); - } - - BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, - EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean isSecret, boolean hasGlowEffect, boolean isSpeciesDominant) { - this(speciesName, genusName, classification, firstColour, BodyColours.DEFAULT, - preferredTemp, preferredHumidity, hasGlowEffect, isSecret, true, isSpeciesDominant, false); - } - - BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, int secondColour, - EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesSecret, boolean isSpeciesCounted, - boolean isSpeciesDominant, boolean isSpeciesNocturnal) { - - String uid = "magicbees.species" + speciesName; - - this.temperature = preferredTemp; - this.humidity = preferredHumidity; - - IBeeFactory beeFactory = forestry.api.apiculture.BeeManager.beeFactory; - this.species = beeFactory.createSpecies(uid, isSpeciesDominant, authority, uid, uid + ".description", classification, genusName, firstColour, secondColour); - - this.species.setTemperature(preferredTemp); - this.species.setHumidity(preferredHumidity); - - if (isSpeciesNocturnal) { - this.species.setNocturnal(); - } - if (hasGlowEffect) { - this.species.setHasEffect(); - } - if (isSpeciesSecret) { - this.species.setIsSecret(); - } - if (!isSpeciesCounted) { - this.species.setIsNotCounted(); - } - - classification.addMemberSpecies(species); - } - - public IAllele[] getGenome() { - return genomeTemplate; - } - - public IAlleleBeeSpecies getSpecies() { - return species; - } - - public BeeSpecies addProduct(ItemStack produce, float chance) { - species.addProduct(produce, chance); - return this; - } - - public BeeSpecies addSpecialty(ItemStack produce, float chance) { - species.addSpecialty(produce, chance); - return this; - } - - public ItemStack getBeeItem(EnumBeeType beeType) { - return BeeManager.beeRoot.getMemberStack(BeeManager.beeRoot.getBee(null, BeeManager.beeRoot.templateAsGenome(genomeTemplate)), beeType.ordinal()); - } - - public BeeSpecies setInactive() { - this.active = false; - AlleleManager.alleleRegistry.blacklistAllele(species.getUID()); - return this; - } - - public boolean isActive() { - return active; - } - - public void registerGenomeTemplate(IAllele[] genome) { - genomeTemplate = genome; - BeeManager.beeRoot.registerTemplate(species.getUID(), genome); - } - - private void setupCustomIconProvider() { - IBeeIconProvider iconProvider = getCustomIconProvider(); - if (iconProvider != null) { - this.species.setCustomBeeIconProvider(iconProvider); - } - - IBeeIconColourProvider iconColourProvider = getCustomIconColourProvider(); - if (iconColourProvider != null) { - this.species.setCustomBeeIconColourProvider(iconColourProvider); - } - } - - private IBeeIconProvider getCustomIconProvider() { - switch (this) { - case SKULKING: - case GHASTLY: - case SPIDERY: - case SMOULDERING: - case BIGBAD: - case BATTY: - case SHEEPISH: - case HORSE: - case CATTY: - case BRAINY: - case TC_WISPY: - case AM_VORTEX: - case AM_WIGHT: - case TE_BLIZZY: - case TE_GELID: - case TE_DANTE: - case TE_PYRO: - case TE_SHOCKING: - case TE_AMPED: - case TE_GROUNDED: - case TE_ROCKING: - return BeeIconProvider.SKULKING; - - case DOCTORAL: - return BeeIconProvider.DOCTORAL; - - default: - return null; - } - } - - private IBeeIconColourProvider getCustomIconColourProvider() { - switch (this) { - case BOT_ALFHEIM: - return BeeIconColourProvider.RAINBOW; - } - return null; - } - - public boolean canWorkInTemperature(EnumTemperature temp) { - IAlleleTolerance tolerance = (IAlleleTolerance) genomeTemplate[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()]; - return AlleleManager.climateHelper - .isWithinLimits(temp, EnumHumidity.NORMAL, temperature, tolerance.getValue(), EnumHumidity.NORMAL, EnumTolerance.NONE); - } - - public boolean canWorkInHumidity(EnumHumidity humid) { - IAlleleTolerance tolerance = (IAlleleTolerance) genomeTemplate[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()]; - return AlleleManager.climateHelper.isWithinLimits(EnumTemperature.NORMAL, humid, EnumTemperature.NORMAL, EnumTolerance.NONE, humidity, - tolerance.getValue()); - } +import magicbees.main.utils.compat.AppliedEnergisticsHelper; +import magicbees.main.utils.compat.ArsMagicaHelper; +import magicbees.main.utils.compat.BotaniaHelper; +import magicbees.main.utils.compat.EquivalentExchangeHelper; +import magicbees.main.utils.compat.RedstoneArsenalHelper; +import magicbees.main.utils.compat.ThaumcraftHelper; +import magicbees.main.utils.compat.ThermalModsHelper; +import net.minecraft.item.ItemStack; + +public enum BeeSpecies { + MYSTICAL( + "Mystical", + "mysticum", + BeeClassification.VEILED, + 0xAFFFB7, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false, + true), + SORCEROUS( + "Sorcerous", + "fascinatio", + BeeClassification.VEILED, + 0xEA9A9A, + EnumTemperature.HOT, + EnumHumidity.ARID, + false, + false, + true), + UNUSUAL( + "Unusual", + "inusitatus", + BeeClassification.VEILED, + 0x72D361, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false, + true), + ATTUNED( + "Attuned", + "similis", + BeeClassification.VEILED, + 0x0086A8, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false, + true), + + ELDRITCH( + "Eldritch", + "prodigiosus", + BeeClassification.VEILED, + 0x8D75A0, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + + ESOTERIC( + "Esoteric", + "secretiore", + BeeClassification.ARCANE, + 0x001099, + BodyColours.ARCANE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + MYSTERIOUS( + "Mysterious", + "mysticus", + BeeClassification.ARCANE, + 0x762bc2, + BodyColours.ARCANE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + ARCANE( + "Arcane", + "arcanus", + BeeClassification.ARCANE, + 0xd242df, + BodyColours.ARCANE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + true), + + CHARMED( + "Charmed", + "larvatus", + BeeClassification.SUPERNATURAL, + 0x48EEEC, + BodyColours.ARCANE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + ENCHANTED( + "Enchanted", + "cantatus", + BeeClassification.SUPERNATURAL, + 0x18e726, + BodyColours.ARCANE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + SUPERNATURAL( + "Supernatural", + "coeleste", + BeeClassification.SUPERNATURAL, + 0x005614, + BodyColours.ARCANE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + true), + + ETHEREAL( + "Ethereal", + "diaphanum", + BeeClassification.MAGICAL, + 0xBA3B3B, + 0xEFF8FF, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + + WATERY( + "Watery", + "aquatilis", + BeeClassification.MAGICAL, + 0x313C5E, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + EARTHY( + "Earthen", + "fictili", + BeeClassification.MAGICAL, + 0x78822D, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + FIREY( + "Firey", + "ardens", + BeeClassification.MAGICAL, + 0xD35119, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + WINDY( + "Windy", + "ventosum", + BeeClassification.MAGICAL, + 0xFFFDBA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + + PUPIL( + "Pupil", + "disciplina", + BeeClassification.SCHOLARLY, + 0xFFFF00, + EnumTemperature.NORMAL, + EnumHumidity.ARID, + false, + true), + SCHOLARLY( + "Scholarly", + "studiosis", + BeeClassification.SCHOLARLY, + 0x6E0000, + EnumTemperature.NORMAL, + EnumHumidity.ARID, + false, + false), + SAVANT( + "Savant", + "philologus", + BeeClassification.SCHOLARLY, + 0xFFA042, + EnumTemperature.NORMAL, + EnumHumidity.ARID, + true, + false), + + AWARE( + "Aware", + "sensibilis", + BeeClassification.MAGICAL, + 0x5E95B5, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + SPIRIT("Spirit", "larva", BeeClassification.SOUL, 0xb2964b, EnumTemperature.WARM, EnumHumidity.NORMAL, false, true), + SOUL("Soul", "anima", BeeClassification.SOUL, 0x7d591b, EnumTemperature.HELLISH, EnumHumidity.NORMAL, true, false), + + SKULKING( + "Skulking", + "malevolens", + BeeClassification.SKULKING, + 0x524827, + BodyColours.SKULKING, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + GHASTLY( + "Ghastly", + "pallens", + BeeClassification.SKULKING, + 0xccccee, + 0xbf877c, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + SPIDERY( + "Spidery", + "araneolus", + BeeClassification.SKULKING, + 0x0888888, + 0x222222, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + SMOULDERING( + "Smouldering", + "flagrantia", + BeeClassification.SKULKING, + 0xFFC747, + 0xEA8344, + EnumTemperature.HELLISH, + EnumHumidity.NORMAL, + false, + false), + BRAINY( + "TCBrainy", + "cerebrum", + BeeClassification.SKULKING, + 0x83FF70, + BodyColours.SKULKING, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + BIGBAD( + "BigBad", + "magnumalum", + BeeClassification.SKULKING, + 0xA9344B, + 0x453536, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false, + true, + true, + true), + CHICKEN( + "TCChicken", + "pullus", + BeeClassification.FLESHY, + 0xFF0000, + 0xD3D3D3, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + BEEF( + "TCBeef", + "bubulae", + BeeClassification.FLESHY, + 0xB7B7B7, + 0x3F3024, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + PORK( + "TCPork", + "porcina", + BeeClassification.FLESHY, + 0xF1AEAC, + 0xDF847B, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + BATTY( + "TCBatty", + "chiroptera", + BeeClassification.FLESHY, + 0x5B482B, + 0x271B0F, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + SHEEPISH( + "Sheepish", + "balans", + BeeClassification.FLESHY, + 0xF7F7F7, + 0xCACACA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + HORSE( + "Horse", + "equus", + BeeClassification.FLESHY, + 0x906330, + 0x7B4E1B, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + CATTY( + "Catty", + "feline", + BeeClassification.FLESHY, + 0xECE684, + 0x563C24, + EnumTemperature.HOT, + EnumHumidity.NORMAL, + false, + true), + + TIMELY( + "Timely", + "gallifreis", + BeeClassification.TIME, + 0xC6AF86, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + LORDLY( + "Lordly", + "rassilonis", + BeeClassification.TIME, + 0xC6AF86, + 0x8E0213, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + DOCTORAL( + "Doctoral", + "medicus qui", + BeeClassification.TIME, + 0xDDE5FC, + 0x4B6E8C, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + + INFERNAL( + "Infernal", + "infernales", + BeeClassification.ABOMINABLE, + 0xFF1C1C, + BodyColours.ABOMINABLE, + EnumTemperature.HELLISH, + EnumHumidity.ARID, + false, + true), + HATEFUL( + "Hateful", + "odibilis", + BeeClassification.ABOMINABLE, + 0xDB00DB, + BodyColours.ABOMINABLE, + EnumTemperature.HELLISH, + EnumHumidity.ARID, + false, + false), + SPITEFUL( + "Spiteful", + "maligna", + BeeClassification.ABOMINABLE, + 0x5FCC00, + BodyColours.ABOMINABLE, + EnumTemperature.HELLISH, + EnumHumidity.ARID, + true, + false), + WITHERING( + "Withering", + "vietus", + BeeClassification.ABOMINABLE, + 0x5B5B5B, + BodyColours.ABOMINABLE, + EnumTemperature.HELLISH, + EnumHumidity.ARID, + true, + false), + + OBLIVION( + "Oblivion", + "oblivioni", + BeeClassification.EXTRINSIC, + 0xD5C3E5, + BodyColours.EXTRINSIC, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + false, + false), + NAMELESS( + "Nameless", + "sine nomine", + BeeClassification.EXTRINSIC, + 0x8ca7cb, + BodyColours.EXTRINSIC, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + false, + true), + ABANDONED( + "Abandoned", + "reliquit", + BeeClassification.EXTRINSIC, + 0xc5cb8c, + BodyColours.EXTRINSIC, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + false, + true), + FORLORN( + "Forlorn", + "perditus", + BeeClassification.EXTRINSIC, + 0xcba88c, + BodyColours.EXTRINSIC, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + true, + false), + DRACONIC( + "Draconic", + "draconic", + BeeClassification.EXTRINSIC, + 0x9f56ad, + 0x5a3b62, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + true, + false), + + IRON( + "Iron", + "ferrus", + BeeClassification.METALLIC, + 0x686868, + 0xE9E9E9, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + GOLD( + "Gold", + "aurum", + BeeClassification.METALLIC, + 0x684B01, + 0xFFFF0B, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + false), + COPPER( + "Copper", + "aercus", + BeeClassification.METALLIC, + 0x684B01, + 0xFFC81A, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + TIN( + "Tin", + "stannum", + BeeClassification.METALLIC, + 0x3E596D, + 0xA6BACB, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + SILVER( + "Silver", + "argenteus", + BeeClassification.METALLIC, + 0x747C81, + 0x96BFC4, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + LEAD( + "Lead", + "plumbeus", + BeeClassification.METALLIC, + 0x96BFC4, + 0x91A9F3, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + ALUMINUM( + "Aluminum", + "aluminium", + BeeClassification.METALLIC, + 0xEDEDED, + 0x767676, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + ARDITE( + "Ardite", + "aurantiaco", + BeeClassification.METALLIC, + 0x720000, + 0xFF9E00, + EnumTemperature.HOT, + EnumHumidity.ARID, + false, + false), + COBALT( + "Cobalt", + "caeruleo", + BeeClassification.METALLIC, + 0x03265F, + 0x59AAEF, + EnumTemperature.HOT, + EnumHumidity.ARID, + false, + false), + MANYULLYN( + "Manyullyn", + "manahmanah", + BeeClassification.METALLIC, + 0x481D6D, + 0xBD92F1, + EnumTemperature.HOT, + EnumHumidity.ARID, + true, + false), + OSMIUM( + "Osmium", + "hyacintho", + BeeClassification.METALLIC, + 0x374B5B, + 0x6C7B89, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + + DIAMOND( + "Diamond", + "diamond", + BeeClassification.GEM, + 0x209581, + 0x8DF5E3, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + false), + EMERALD( + "Emerald", + "prasinus", + BeeClassification.GEM, + 0x005300, + 0x17DD62, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + false), + APATITE( + "Apatite", + "apatite", + BeeClassification.GEM, + 0x2EA7EC, + 0x001D51, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + SILICON( + "Silicon", + "siliconisque", + BeeClassification.GEM, + 0xADA2A7, + 0x736675, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + CERTUS( + "Certus", + "alia cristallum", + BeeClassification.GEM, + 0x93C7FF, + 0xA6B8C7, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + FLUIX( + "Fluix", + "alien cristallum", + BeeClassification.GEM, + 0xFC639E, + 0x534797, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + + MUTABLE( + "Mutable", + "mutable", + BeeClassification.TRANSMUTING, + 0xDBB24C, + 0xE0D5A6, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TRANSMUTING( + "Transmuting", + "transmuting", + BeeClassification.TRANSMUTING, + 0xDBB24C, + 0xA2D2D8, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + CRUMBLING( + "Crumbling", + "crumbling", + BeeClassification.TRANSMUTING, + 0xDBB24C, + 0xDBA4A4, + EnumTemperature.HOT, + EnumHumidity.ARID, + false, + false), + + INVISIBLE( + "Invisible", + "invisible", + BeeClassification.VEILED, + 0xffccff, + 0xffffff, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + + // --------- Thaumcraft Bees --------------------------------------------------------------------------------------- + TC_AIR( + "TCAir", + "aether", + BeeClassification.THAUMIC, + 0xD9D636, + BodyColours.THAUMCRAFT_SHARD, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + true), + TC_FIRE( + "TCFire", + "praefervidus", + BeeClassification.THAUMIC, + 0xE50B0B, + BodyColours.THAUMCRAFT_SHARD, + EnumTemperature.HOT, + EnumHumidity.ARID, + true, + true), + TC_WATER( + "TCWater", + "umidus", + BeeClassification.THAUMIC, + 0x36CFD9, + BodyColours.THAUMCRAFT_SHARD, + EnumTemperature.NORMAL, + EnumHumidity.DAMP, + true, + true), + TC_EARTH( + "TCEarth", + "sordida", + BeeClassification.THAUMIC, + 0x005100, + BodyColours.THAUMCRAFT_SHARD, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + true), + TC_ORDER( + "TCOrder", + "ordinatus", + BeeClassification.THAUMIC, + 0xaa32fc, + BodyColours.THAUMCRAFT_SHARD, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + true), + TC_CHAOS( + "TCChaos", + "tenebrarum", + BeeClassification.THAUMIC, + 0xCCCCCC, + BodyColours.THAUMCRAFT_SHARD, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + false), + + TC_VIS( + "TCVis", + "arcanus saecula", + BeeClassification.THAUMIC, + 0x004c99, + BodyColours.THAUMCRAFT_NODE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TC_REJUVENATING( + "TCRejuvenating", + "arcanus vitae", + BeeClassification.THAUMIC, + 0x91D0D9, + BodyColours.THAUMCRAFT_NODE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TC_EMPOWERING( + "TCEmpowering", + "tractus", + BeeClassification.THAUMIC, + 0x96FFBC, + BodyColours.THAUMCRAFT_NODE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + TC_NEXUS( + "TCNexus", + "nexi", + BeeClassification.THAUMIC, + 0x15AFAF, + BodyColours.THAUMCRAFT_NODE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + false), + TC_TAINT( + "TCFlux", + "arcanus labe", + BeeClassification.THAUMIC, + 0x91376A, + BodyColours.THAUMCRAFT_NODE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TC_PURE( + "TCPure", + "arcanus puritatem", + BeeClassification.THAUMIC, + 0xE23F65, + BodyColours.THAUMCRAFT_NODE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TC_HUNGRY( + "TCHungry", + "omnique", + BeeClassification.THAUMIC, + 0xDCA5E2, + BodyColours.THAUMCRAFT_NODE, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + + TC_WISPY( + "TCWispy", + "umbrabilis", + BeeClassification.THAUMIC, + 0x9cb8d5, + BodyColours.SKULKING, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TC_VOID( + "TCVoid", + "obscurus", + BeeClassification.METALLIC, + 0x180A29, + 0x4B2A74, + EnumTemperature.ICY, + EnumHumidity.NORMAL, + false, + false), + + // --------- Equivalent Exchange Bees ----------------------------------------------------------------------------- + EE_MINIUM( + "EEMinium", + "mutabilis", + BeeClassification.ALCHEMICAL, + 0xac0921, + 0x3a030b, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + + // --------- Ars Magica Bees -------------------------------------------------------------------------------------- + AM_ESSENCE( + "AMEssence", + "essentia", + BeeClassification.ESSENTIAL, + 0x86BBC5, + BodyColours.ARSMAGICA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + AM_QUINTESSENCE( + "AMQuintessence", + "cor essentia", + BeeClassification.ESSENTIAL, + 0xE3A45B, + BodyColours.ARSMAGICA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + true), + + AM_EARTH( + "AMEarth", + "magica terra", + BeeClassification.ESSENTIAL, + 0xAA875E, + BodyColours.ARSMAGICA, + EnumTemperature.WARM, + EnumHumidity.ARID, + false, + false), + AM_AIR( + "AMAir", + "magica aer", + BeeClassification.ESSENTIAL, + 0xD5EB9D, + BodyColours.ARSMAGICA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + AM_FIRE( + "AMFire", + "magica ignis", + BeeClassification.ESSENTIAL, + 0x93451E, + BodyColours.ARSMAGICA, + EnumTemperature.HOT, + EnumHumidity.ARID, + false, + false), + AM_WATER( + "AMWater", + "magica aqua", + BeeClassification.ESSENTIAL, + 0x3B7D8C, + BodyColours.ARSMAGICA, + EnumTemperature.NORMAL, + EnumHumidity.DAMP, + false, + false), + AM_LIGHTNING( + "AMLightning", + "magica fulgur", + BeeClassification.ESSENTIAL, + 0xEBEFA1, + BodyColours.ARSMAGICA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + AM_PLANT( + "AMPlant", + "magica herba", + BeeClassification.ESSENTIAL, + 0x49B549, + BodyColours.ARSMAGICA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + AM_ICE( + "AMIce", + "magica glacium", + BeeClassification.ESSENTIAL, + 0x86BAC6, + BodyColours.ARSMAGICA, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + false, + false), + AM_ARCANE( + "AMArcane", + "magica arcanum", + BeeClassification.ESSENTIAL, + 0x76184D, + BodyColours.ARSMAGICA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + false), + + AM_VORTEX( + "AMVortex", + "gurges", + BeeClassification.ESSENTIAL, + 0x71BBE2, + 0x0B35A8, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + AM_WIGHT( + "AMWight", + "vectem", + BeeClassification.ESSENTIAL, + 0xB50000, + 0x4C4837, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + + // ---------------------Thermal Expansion Bees--------------------------- + TE_BLIZZY( + "TEBlizzy", + "blizzard", + BeeClassification.ABOMINABLE, + 0x0073C4, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + false, + false), + TE_GELID( + "TEGelid", + "cyro", + BeeClassification.ABOMINABLE, + 0x4AAFF7, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + true, + true), + TE_DANTE( + "TEDante", + "inferno", + BeeClassification.ABOMINABLE, + 0xF7AC4A, + EnumTemperature.HELLISH, + EnumHumidity.ARID, + false, + false), + TE_PYRO( + "TEPyro", + "pyromania", + BeeClassification.ABOMINABLE, + 0xFA930C, + EnumTemperature.HELLISH, + EnumHumidity.ARID, + true, + true), + TE_SHOCKING( + "TEShocking", + "horrendum", + BeeClassification.ABOMINABLE, + 0xC5FF26, + 0xF8EE00, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TE_AMPED( + "TEAmped", + "concitatus", + BeeClassification.ABOMINABLE, + 0x8AFFFF, + 0xECE670, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + false), + TE_GROUNDED( + "TEGrounded", + "tellus", + BeeClassification.ABOMINABLE, + 0xCEC1C1, + 0x826767, + EnumTemperature.HOT, + EnumHumidity.ARID, + false, + true), + TE_ROCKING( + "TERocking", + "saxsous", + BeeClassification.ABOMINABLE, + 0x980000, + 0xAB9D9B, + EnumTemperature.HOT, + EnumHumidity.ARID, + true, + true), + + TE_ELECTRUM( + "TEElectrum", + "electrum", + BeeClassification.THERMAL, + 0xEAF79E, + EnumTemperature.HOT, + EnumHumidity.ARID, + false, + false), + TE_PLATINUM( + "TEPlatinum", + "platina", + BeeClassification.THERMAL, + 0x9EE7F7, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TE_NICKEL( + "TENickel", + "nickel", + BeeClassification.THERMAL, + 0xB4C989, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TE_INVAR( + "TEInvar", + "invar", + BeeClassification.THERMAL, + 0xCDE3A1, + EnumTemperature.HOT, + EnumHumidity.ARID, + false, + false), + TE_BRONZE( + "TEBronze", + "pyropus", + BeeClassification.THERMAL, + 0xB56D07, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TE_COAL( + "TECoal", + "carbonis", + BeeClassification.THERMAL, + 0x2E2D2D, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TE_DESTABILIZED( + "TEDestabilized", + "electric", + BeeClassification.THERMAL, + 0x5E0203, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TE_LUX( + "TELux", + "lux", + BeeClassification.THERMAL, + 0xF1FA89, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + TE_WINSOME( + "TEWinsome", + "cuniculus", + BeeClassification.ADORABLE, + 0x096B67, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + false, + false), + TE_ENDEARING( + "TEEndearing", + "cognito", + BeeClassification.ADORABLE, + 0x069E97, + EnumTemperature.COLD, + EnumHumidity.NORMAL, + true, + true), + TE_SIGNALUS( + "TESignalus", + "scelerisque", + BeeClassification.THERMAL, + 0x5E0203, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + true), + TE_LUMIUS( + "TELumius", + "lucidum", + BeeClassification.THERMAL, + 0xF1FA89, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + true, + true), + + // --------------------Redstone Arsenal Bees----------------------------- + RSA_FLUXED( + "RSAFluxed", + "Thermametallic electroflux", + BeeClassification.THERMAL, + 0x9E060D, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + + // ----------------------Botania Bees--------------------------------------- + BOT_ROOTED( + "BotRooted", + "truncus", + BeeClassification.BOTANICAL, + 0x00A800, + BodyColours.BOTANIA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + + BOT_BOTANIC( + "BotBotanic", + "botanica", + BeeClassification.BOTANICAL, + 0x94C661, + BodyColours.BOTANIA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + BOT_BLOSSOM( + "BotBlossom", + "viridis", + BeeClassification.BOTANICAL, + 0xA4C193, + BodyColours.BOTANIA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + BOT_FLORAL( + "BotFloral", + "florens", + BeeClassification.BOTANICAL, + 0x29D81A, + BodyColours.BOTANIA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + true), + + BOT_VAZBEE( + "BotVazbee", + "vazbii", + BeeClassification.BOTANICAL, + 0xff6b9c, + BodyColours.BOTANIA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + + BOT_SOMNOLENT( + "BotSomnolent", + "soporatus", + BeeClassification.BOTANICAL, + 0x2978C6, + BodyColours.BOTANIA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false, + true, + true, + true), + BOT_DREAMING( + "BotDreaming", + "somnior", + BeeClassification.BOTANICAL, + 0x123456, + BodyColours.BOTANIA, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false, + true, + true, + true), + + BOT_ALFHEIM( + "BotAlfheim", + "alfheimis", + BeeClassification.BOTANICAL, + -1, + -1, + EnumTemperature.NORMAL, + EnumHumidity.NORMAL, + false, + false), + + // -------------------Applied Energistics 2 Bees--------------------------- + AE_SKYSTONE( + "AESkystone", + "terra astris", + BeeClassification.TRANSMUTING, + 0x4B8381, + 0x252929, + EnumTemperature.HOT, + EnumHumidity.ARID, + false, + true), + ; + + // For body colours used by more than one bee. + private class BodyColours { + static final int DEFAULT = 0xFF7C26; + static final int ARCANE = 0xFF9D60; + static final int ABOMINABLE = 0x960F00; + static final int EXTRINSIC = 0xF696FF; + static final int SKULKING = 0xe15236; + static final int THAUMCRAFT_SHARD = 0x999999; + static final int THAUMCRAFT_NODE = 0x675ED1; + static final int ARSMAGICA = 0xE3A55B; + static final int BOTANIA = 0xFFB2BB; + } + + public static void setupBeeSpecies() { + MYSTICAL.registerGenomeTemplate(BeeGenomeManager.getTemplateMystical()); + SORCEROUS.registerGenomeTemplate(BeeGenomeManager.getTemplateSorcerous()); + UNUSUAL.registerGenomeTemplate(BeeGenomeManager.getTemplateUnusual()); + ATTUNED.registerGenomeTemplate(BeeGenomeManager.getTemplateAttuned()); + ELDRITCH.registerGenomeTemplate(BeeGenomeManager.getTemplateEldritch()); + ESOTERIC.registerGenomeTemplate(BeeGenomeManager.getTemplateEsoteric()); + MYSTERIOUS.registerGenomeTemplate(BeeGenomeManager.getTemplateMysterious()); + ARCANE.registerGenomeTemplate(BeeGenomeManager.getTemplateArcane()); + CHARMED.registerGenomeTemplate(BeeGenomeManager.getTemplateCharmed()); + ENCHANTED.registerGenomeTemplate(BeeGenomeManager.getTemplateEnchanted()); + SUPERNATURAL.registerGenomeTemplate(BeeGenomeManager.getTemplateSupernatural()); + ETHEREAL.registerGenomeTemplate(BeeGenomeManager.getTemplateEthereal()); + WATERY.registerGenomeTemplate(BeeGenomeManager.getTemplateWatery()); + EARTHY.registerGenomeTemplate(BeeGenomeManager.getTemplateEarthy()); + FIREY.registerGenomeTemplate(BeeGenomeManager.getTemplateFirey()); + WINDY.registerGenomeTemplate(BeeGenomeManager.getTemplateWindy()); + PUPIL.registerGenomeTemplate(BeeGenomeManager.getTemplatePupil()); + SCHOLARLY.registerGenomeTemplate(BeeGenomeManager.getTemplateScholarly()); + SAVANT.registerGenomeTemplate(BeeGenomeManager.getTemplateSavant()); + AWARE.registerGenomeTemplate(BeeGenomeManager.getTemplateAware()); + SPIRIT.registerGenomeTemplate(BeeGenomeManager.getTemplateSpirit()); + SOUL.registerGenomeTemplate(BeeGenomeManager.getTemplateSoul()); + SKULKING.registerGenomeTemplate(BeeGenomeManager.getTemplateSkulking()); + GHASTLY.registerGenomeTemplate(BeeGenomeManager.getTemplateGhastly()); + SPIDERY.registerGenomeTemplate(BeeGenomeManager.getTemplateSpidery()); + SMOULDERING.registerGenomeTemplate(BeeGenomeManager.getTemplateSmouldering()); + BIGBAD.registerGenomeTemplate(BeeGenomeManager.getTemplateBigbad()); + CHICKEN.registerGenomeTemplate(BeeGenomeManager.getTemplateChicken()); + BEEF.registerGenomeTemplate(BeeGenomeManager.getTemplateBeef()); + PORK.registerGenomeTemplate(BeeGenomeManager.getTemplatePork()); + SHEEPISH.registerGenomeTemplate(BeeGenomeManager.getTemplateSheepish()); + HORSE.registerGenomeTemplate(BeeGenomeManager.getTemplateHorse()); + CATTY.registerGenomeTemplate(BeeGenomeManager.getTemplateCatty()); + TIMELY.registerGenomeTemplate(BeeGenomeManager.getTemplateTimely()); + LORDLY.registerGenomeTemplate(BeeGenomeManager.getTemplateLordly()); + DOCTORAL.registerGenomeTemplate(BeeGenomeManager.getTemplateDoctoral()); + INFERNAL.registerGenomeTemplate(BeeGenomeManager.getTemplateInfernal()); + HATEFUL.registerGenomeTemplate(BeeGenomeManager.getTemplateHateful()); + SPITEFUL.registerGenomeTemplate(BeeGenomeManager.getTemplateSpiteful()); + WITHERING.registerGenomeTemplate(BeeGenomeManager.getTemplateWithering()); + OBLIVION.registerGenomeTemplate(BeeGenomeManager.getTemplateOblivion()); + NAMELESS.registerGenomeTemplate(BeeGenomeManager.getTemplateNameless()); + ABANDONED.registerGenomeTemplate(BeeGenomeManager.getTemplateAbandoned()); + FORLORN.registerGenomeTemplate(BeeGenomeManager.getTemplateForlorn()); + DRACONIC.registerGenomeTemplate(BeeGenomeManager.getTemplateDraconic()); + IRON.registerGenomeTemplate(BeeGenomeManager.getTemplateIron()); + GOLD.registerGenomeTemplate(BeeGenomeManager.getTemplateGold()); + COPPER.registerGenomeTemplate(BeeGenomeManager.getTemplateCopper()); + TIN.registerGenomeTemplate(BeeGenomeManager.getTemplateTin()); + SILVER.registerGenomeTemplate(BeeGenomeManager.getTemplateSilver()); + LEAD.registerGenomeTemplate(BeeGenomeManager.getTemplateLead()); + ALUMINUM.registerGenomeTemplate(BeeGenomeManager.getTemplateAluminum()); + ARDITE.registerGenomeTemplate(BeeGenomeManager.getTemplateArdite()); + COBALT.registerGenomeTemplate(BeeGenomeManager.getTemplateCobalt()); + MANYULLYN.registerGenomeTemplate(BeeGenomeManager.getTemplateManyullyn()); + OSMIUM.registerGenomeTemplate(BeeGenomeManager.getTemplateOsmium()); + DIAMOND.registerGenomeTemplate(BeeGenomeManager.getTemplateDiamond()); + EMERALD.registerGenomeTemplate(BeeGenomeManager.getTemplateEmerald()); + APATITE.registerGenomeTemplate(BeeGenomeManager.getTemplateApatite()); + SILICON.registerGenomeTemplate(BeeGenomeManager.getTemplateSilicon()); + FLUIX.registerGenomeTemplate(BeeGenomeManager.getTemplateFluix()); + CERTUS.registerGenomeTemplate(BeeGenomeManager.getTemplateCertus()); + MUTABLE.registerGenomeTemplate(BeeGenomeManager.getTemplateMutable()); + TRANSMUTING.registerGenomeTemplate(BeeGenomeManager.getTemplateTransmuting()); + CRUMBLING.registerGenomeTemplate(BeeGenomeManager.getTemplateCrumbling()); + INVISIBLE.registerGenomeTemplate(BeeGenomeManager.getTemplateInvisible()); + TC_AIR.registerGenomeTemplate(BeeGenomeManager.getTemplateTCAir()); + TC_FIRE.registerGenomeTemplate(BeeGenomeManager.getTemplateTCFire()); + TC_WATER.registerGenomeTemplate(BeeGenomeManager.getTemplateTCWater()); + TC_EARTH.registerGenomeTemplate(BeeGenomeManager.getTemplateTCEarth()); + TC_ORDER.registerGenomeTemplate(BeeGenomeManager.getTemplateTCOrder()); + TC_CHAOS.registerGenomeTemplate(BeeGenomeManager.getTemplateTCChaos()); + TC_VIS.registerGenomeTemplate(BeeGenomeManager.getTemplateTCVis()); + TC_REJUVENATING.registerGenomeTemplate(BeeGenomeManager.getTemplateTCRejuvinating()); + TC_EMPOWERING.registerGenomeTemplate(BeeGenomeManager.getTemplateTCEmpowering()); + TC_NEXUS.registerGenomeTemplate(BeeGenomeManager.getTemplateTCNexus()); + TC_TAINT.registerGenomeTemplate(BeeGenomeManager.getTemplateTCTaint()); + TC_PURE.registerGenomeTemplate(BeeGenomeManager.getTemplateTCPure()); + TC_HUNGRY.registerGenomeTemplate(BeeGenomeManager.getTemplateTCHungry()); + BRAINY.registerGenomeTemplate(BeeGenomeManager.getTemplateBrainy()); + TC_WISPY.registerGenomeTemplate(BeeGenomeManager.getTemplateTCWispy()); + BATTY.registerGenomeTemplate(BeeGenomeManager.getTemplateBatty()); + TC_VOID.registerGenomeTemplate(BeeGenomeManager.getTemplaceTCVoid()); + EE_MINIUM.registerGenomeTemplate(BeeGenomeManager.getTemplateEEMinium()); + AM_ESSENCE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMEssence()); + AM_QUINTESSENCE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMQuintessence()); + AM_EARTH.registerGenomeTemplate(BeeGenomeManager.getTemplateAMEarth()); + AM_AIR.registerGenomeTemplate(BeeGenomeManager.getTemplateAMAir()); + AM_FIRE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMFire()); + AM_WATER.registerGenomeTemplate(BeeGenomeManager.getTemplateAMWater()); + AM_LIGHTNING.registerGenomeTemplate(BeeGenomeManager.getTemplateAMLightning()); + AM_PLANT.registerGenomeTemplate(BeeGenomeManager.getTemplateAMPlant()); + AM_ICE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMIce()); + AM_ARCANE.registerGenomeTemplate(BeeGenomeManager.getTemplateAMArcane()); + AM_VORTEX.registerGenomeTemplate(BeeGenomeManager.getTemplateAMVortex()); + AM_WIGHT.registerGenomeTemplate(BeeGenomeManager.getTemplateAMWight()); + TE_BLIZZY.registerGenomeTemplate(BeeGenomeManager.getTemplateTEBlizzy()); + TE_GELID.registerGenomeTemplate(BeeGenomeManager.getTemplateTEGelid()); + TE_DANTE.registerGenomeTemplate(BeeGenomeManager.getTemplateTEDante()); + TE_PYRO.registerGenomeTemplate(BeeGenomeManager.getTemplateTEPyro()); + TE_SHOCKING.registerGenomeTemplate(BeeGenomeManager.getTemplateTEShocking()); + TE_AMPED.registerGenomeTemplate(BeeGenomeManager.getTemplateTEAmped()); + TE_GROUNDED.registerGenomeTemplate(BeeGenomeManager.getTemplateTEGrounded()); + TE_ROCKING.registerGenomeTemplate(BeeGenomeManager.getTemplateTERocking()); + TE_ELECTRUM.registerGenomeTemplate(BeeGenomeManager.getTemplateTEElectrum()); + TE_PLATINUM.registerGenomeTemplate(BeeGenomeManager.getTemplateTEPlatinum()); + TE_NICKEL.registerGenomeTemplate(BeeGenomeManager.getTemplateTENickel()); + TE_INVAR.registerGenomeTemplate(BeeGenomeManager.getTemplateTEInvar()); + TE_BRONZE.registerGenomeTemplate(BeeGenomeManager.getTemplateTEBronze()); + TE_COAL.registerGenomeTemplate(BeeGenomeManager.getTemplateTECoal()); + TE_DESTABILIZED.registerGenomeTemplate(BeeGenomeManager.getTemplateTEDestabilized()); + TE_LUX.registerGenomeTemplate(BeeGenomeManager.getTemplateTELux()); + TE_WINSOME.registerGenomeTemplate(BeeGenomeManager.getTemplateTEWinsome()); + TE_ENDEARING.registerGenomeTemplate(BeeGenomeManager.getTemplateTEEndearing()); + TE_SIGNALUS.registerGenomeTemplate(BeeGenomeManager.getTemplateTESignalus()); + TE_LUMIUS.registerGenomeTemplate(BeeGenomeManager.getTemplateTELumius()); + RSA_FLUXED.registerGenomeTemplate(BeeGenomeManager.getTemplateRSAFluxed()); + BOT_ROOTED.registerGenomeTemplate(BeeGenomeManager.getTemplateBotRooted()); + BOT_BOTANIC.registerGenomeTemplate(BeeGenomeManager.getTemplateBotBotanic()); + BOT_BLOSSOM.registerGenomeTemplate(BeeGenomeManager.getTemplateBotBlossom()); + BOT_FLORAL.registerGenomeTemplate(BeeGenomeManager.getTemplateBotFloral()); + BOT_VAZBEE.registerGenomeTemplate(BeeGenomeManager.getTemplateBotVazbee()); + BOT_SOMNOLENT.registerGenomeTemplate(BeeGenomeManager.getTemplateBotSomnolent()); + BOT_DREAMING.registerGenomeTemplate(BeeGenomeManager.getTemplateBotDreaming()); + BOT_ALFHEIM.registerGenomeTemplate(BeeGenomeManager.getTemplateBotAelfheim()); + AE_SKYSTONE.registerGenomeTemplate(BeeGenomeManager.getTemplateAESkystone()); + + BeeProductHelper.initThaumcraftProducts(); + if (!ThaumcraftHelper.isActive()) { + TC_CHAOS.setInactive(); + TC_AIR.setInactive(); + TC_FIRE.setInactive(); + TC_WATER.setInactive(); + TC_EARTH.setInactive(); + TC_ORDER.setInactive(); + + TC_VIS.setInactive(); + TC_REJUVENATING.setInactive(); + TC_EMPOWERING.setInactive(); + TC_NEXUS.setInactive(); + TC_TAINT.setInactive(); + TC_PURE.setInactive(); + TC_HUNGRY.setInactive(); + + BRAINY.setInactive(); + + TC_WISPY.setInactive(); + TC_VOID.setInactive(); + } + + BeeProductHelper.initEquivalentExchange3Species(); + if (!EquivalentExchangeHelper.isActive()) { + EE_MINIUM.setInactive(); + } + + BeeProductHelper.initArsMagicaSpecies(); + if (!ArsMagicaHelper.isActive()) { + AM_ESSENCE.setInactive(); + AM_QUINTESSENCE.setInactive(); + AM_EARTH.setInactive(); + AM_AIR.setInactive(); + AM_FIRE.setInactive(); + AM_WATER.setInactive(); + AM_LIGHTNING.setInactive(); + AM_PLANT.setInactive(); + AM_ICE.setInactive(); + AM_ARCANE.setInactive(); + AM_VORTEX.setInactive(); + AM_WIGHT.setInactive(); + } + + BeeProductHelper.initThermalExpansionProducts(); + if (!ThermalModsHelper.isActive()) { + TE_BLIZZY.setInactive(); + TE_GELID.setInactive(); + TE_DANTE.setInactive(); + TE_PYRO.setInactive(); + TE_SHOCKING.setInactive(); + TE_AMPED.setInactive(); + TE_GROUNDED.setInactive(); + TE_ROCKING.setInactive(); + TE_DESTABILIZED.setInactive(); + TE_COAL.setInactive(); + TE_LUX.setInactive(); + TE_WINSOME.setInactive(); + TE_ENDEARING.setInactive(); + TE_SIGNALUS.setInactive(); + TE_LUMIUS.setInactive(); + } + + BeeProductHelper.initRedstoneArsenelProducts(); + if (!RedstoneArsenalHelper.isActive()) { + RSA_FLUXED.setInactive(); + } + + BeeProductHelper.initBotaniaProducts(); + if (!BotaniaHelper.isActive()) { + BOT_ROOTED.setInactive(); + BOT_BLOSSOM.setInactive(); + BOT_BOTANIC.setInactive(); + BOT_FLORAL.setInactive(); + BOT_VAZBEE.setInactive(); + BOT_SOMNOLENT.setInactive(); + BOT_DREAMING.setInactive(); + BOT_ALFHEIM.setInactive(); + } + + BeeProductHelper.initAppEngProducts(); + if (!AppliedEnergisticsHelper.isActive()) { + AE_SKYSTONE.setInactive(); + } + + for (BeeSpecies beeSpecies : BeeSpecies.values()) { + if (beeSpecies.isActive()) { + beeSpecies.setupCustomIconProvider(); + } + } + } + + private static final String authority = "MysteriousAges"; + + private final IAlleleBeeSpeciesCustom species; + private final EnumTemperature temperature; + private final EnumHumidity humidity; + + private boolean active = true; + + private IAllele genomeTemplate[]; + + BeeSpecies( + String speciesName, + String genusName, + IClassification classification, + int firstColour, + EnumTemperature preferredTemp, + EnumHumidity preferredHumidity, + boolean hasGlowEffect, + boolean isSpeciesDominant) { + this( + speciesName, + genusName, + classification, + firstColour, + BodyColours.DEFAULT, + preferredTemp, + preferredHumidity, + hasGlowEffect, + true, + true, + isSpeciesDominant, + false); + } + + BeeSpecies( + String speciesName, + String genusName, + IClassification classification, + int firstColour, + int secondColour, + EnumTemperature preferredTemp, + EnumHumidity preferredHumidity, + boolean hasGlowEffect, + boolean isSpeciesDominant) { + this( + speciesName, + genusName, + classification, + firstColour, + secondColour, + preferredTemp, + preferredHumidity, + hasGlowEffect, + true, + true, + isSpeciesDominant, + false); + } + + BeeSpecies( + String speciesName, + String genusName, + IClassification classification, + int firstColour, + int secondColour, + EnumTemperature preferredTemp, + EnumHumidity preferredHumidity, + boolean isSecret, + boolean hasGlowEffect, + boolean isSpeciesDominant) { + this( + speciesName, + genusName, + classification, + firstColour, + secondColour, + preferredTemp, + preferredHumidity, + hasGlowEffect, + isSecret, + true, + isSpeciesDominant, + false); + } + + BeeSpecies( + String speciesName, + String genusName, + IClassification classification, + int firstColour, + EnumTemperature preferredTemp, + EnumHumidity preferredHumidity, + boolean isSecret, + boolean hasGlowEffect, + boolean isSpeciesDominant) { + this( + speciesName, + genusName, + classification, + firstColour, + BodyColours.DEFAULT, + preferredTemp, + preferredHumidity, + hasGlowEffect, + isSecret, + true, + isSpeciesDominant, + false); + } + + BeeSpecies( + String speciesName, + String genusName, + IClassification classification, + int firstColour, + int secondColour, + EnumTemperature preferredTemp, + EnumHumidity preferredHumidity, + boolean hasGlowEffect, + boolean isSpeciesSecret, + boolean isSpeciesCounted, + boolean isSpeciesDominant, + boolean isSpeciesNocturnal) { + + String uid = "magicbees.species" + speciesName; + + this.temperature = preferredTemp; + this.humidity = preferredHumidity; + + IBeeFactory beeFactory = forestry.api.apiculture.BeeManager.beeFactory; + this.species = beeFactory.createSpecies( + uid, + isSpeciesDominant, + authority, + uid, + uid + ".description", + classification, + genusName, + firstColour, + secondColour); + + this.species.setTemperature(preferredTemp); + this.species.setHumidity(preferredHumidity); + + if (isSpeciesNocturnal) { + this.species.setNocturnal(); + } + if (hasGlowEffect) { + this.species.setHasEffect(); + } + if (isSpeciesSecret) { + this.species.setIsSecret(); + } + if (!isSpeciesCounted) { + this.species.setIsNotCounted(); + } + + classification.addMemberSpecies(species); + } + + public IAllele[] getGenome() { + return genomeTemplate; + } + + public IAlleleBeeSpecies getSpecies() { + return species; + } + + public BeeSpecies addProduct(ItemStack produce, float chance) { + species.addProduct(produce, chance); + return this; + } + + public BeeSpecies addSpecialty(ItemStack produce, float chance) { + species.addSpecialty(produce, chance); + return this; + } + + public ItemStack getBeeItem(EnumBeeType beeType) { + return BeeManager.beeRoot.getMemberStack( + BeeManager.beeRoot.getBee(null, BeeManager.beeRoot.templateAsGenome(genomeTemplate)), + beeType.ordinal()); + } + + public BeeSpecies setInactive() { + this.active = false; + AlleleManager.alleleRegistry.blacklistAllele(species.getUID()); + return this; + } + + public boolean isActive() { + return active; + } + + public void registerGenomeTemplate(IAllele[] genome) { + genomeTemplate = genome; + BeeManager.beeRoot.registerTemplate(species.getUID(), genome); + } + + private void setupCustomIconProvider() { + IBeeIconProvider iconProvider = getCustomIconProvider(); + if (iconProvider != null) { + this.species.setCustomBeeIconProvider(iconProvider); + } + + IBeeIconColourProvider iconColourProvider = getCustomIconColourProvider(); + if (iconColourProvider != null) { + this.species.setCustomBeeIconColourProvider(iconColourProvider); + } + } + + private IBeeIconProvider getCustomIconProvider() { + switch (this) { + case SKULKING: + case GHASTLY: + case SPIDERY: + case SMOULDERING: + case BIGBAD: + case BATTY: + case SHEEPISH: + case HORSE: + case CATTY: + case BRAINY: + case TC_WISPY: + case AM_VORTEX: + case AM_WIGHT: + case TE_BLIZZY: + case TE_GELID: + case TE_DANTE: + case TE_PYRO: + case TE_SHOCKING: + case TE_AMPED: + case TE_GROUNDED: + case TE_ROCKING: + return BeeIconProvider.SKULKING; + + case DOCTORAL: + return BeeIconProvider.DOCTORAL; + + default: + return null; + } + } + + private IBeeIconColourProvider getCustomIconColourProvider() { + switch (this) { + case BOT_ALFHEIM: + return BeeIconColourProvider.RAINBOW; + } + return null; + } + + public boolean canWorkInTemperature(EnumTemperature temp) { + IAlleleTolerance tolerance = + (IAlleleTolerance) genomeTemplate[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()]; + return AlleleManager.climateHelper.isWithinLimits( + temp, EnumHumidity.NORMAL, temperature, tolerance.getValue(), EnumHumidity.NORMAL, EnumTolerance.NONE); + } + + public boolean canWorkInHumidity(EnumHumidity humid) { + IAlleleTolerance tolerance = (IAlleleTolerance) genomeTemplate[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()]; + return AlleleManager.climateHelper.isWithinLimits( + EnumTemperature.NORMAL, + humid, + EnumTemperature.NORMAL, + EnumTolerance.NONE, + humidity, + tolerance.getValue()); + } } diff --git a/src/main/java/magicbees/bees/HiveDescription.java b/src/main/java/magicbees/bees/HiveDescription.java index 247c4b3..569e930 100644 --- a/src/main/java/magicbees/bees/HiveDescription.java +++ b/src/main/java/magicbees/bees/HiveDescription.java @@ -1,23 +1,14 @@ package magicbees.bees; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - -import net.minecraftforge.common.BiomeDictionary; - import forestry.api.apiculture.hives.HiveManager; import forestry.api.apiculture.hives.IHiveDescription; import forestry.api.apiculture.hives.IHiveGen; import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; - +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Random; import magicbees.block.types.HiveType; import magicbees.main.Config; import magicbees.main.utils.BlockUtil; @@ -26,166 +17,200 @@ import magicbees.world.feature.FeatureOreVein; import magicbees.world.feature.HiveGenNether; import magicbees.world.feature.HiveGenOblivion; import magicbees.world.feature.HiveGenUnderground; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary; public enum HiveDescription implements IHiveDescription { - CURIOUS(HiveType.CURIOUS, 3.0f, HiveManager.genHelper.tree(), false, - BiomeDictionary.Type.FOREST, BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.HILLS), - UNUSUAL(HiveType.UNUSUAL, 1.0f, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass), false, - BiomeDictionary.Type.PLAINS, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.HILLS, BiomeDictionary.Type.RIVER), - RESONANT(HiveType.RESONANT, 0.9f, HiveManager.genHelper.ground(Blocks.sand, Blocks.sandstone), false, - BiomeDictionary.Type.SANDY, BiomeDictionary.Type.MESA, BiomeDictionary.Type.HOT, BiomeDictionary.Type.MAGICAL), - DEEP(HiveType.DEEP, 5.0f, new HiveGenUnderground(10, 15, 5), true, - BiomeDictionary.Type.HILLS, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.MAGICAL) { - @Override - public void postGen(World world, int x, int y, int z) { - super.postGen(world, x, y, z); - Random random = world.rand; - FeatureOreVein.redstoneGen.generateVein(world, random, x + 1, y, z, 5); - FeatureOreVein.redstoneGen.generateVein(world, random, x - 1, y, z, 5); - FeatureOreVein.redstoneGen.generateVein(world, random, x, y + 1, z, 5); - FeatureOreVein.redstoneGen.generateVein(world, random, x, y - 1, z, 5); - FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z + 1, 5); - FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z - 1, 5); - } - }, - INFERNAL(HiveType.INFERNAL, 50.0f, new HiveGenNether(0, 175, 6), true, - BiomeDictionary.Type.NETHER) { - @Override - public void postGen(World world, int x, int y, int z) { - super.postGen(world, x, y, z); - Random random = world.rand; - FeatureOreVein.netherQuartzGen.generateVein(world, random, x + 1, y, z, 4); - FeatureOreVein.netherQuartzGen.generateVein(world, random, x - 1, y, z, 4); - FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y + 1, z, 4); - FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y - 1, z, 4); - FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z + 1, 4); - FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z - 1, 4); - } - }, - INFERNAL_OVERWORLD(HiveType.INFERNAL, 0.95f, new HiveGenUnderground(5, 13, 6), true, - BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.HOT) { - @Override - public void postGen(World world, int x, int y, int z) { - super.postGen(world, x, y, z); - Random random = world.rand; - FeatureOreVein.glowstoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(4) + 1); - FeatureOreVein.glowstoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(4) + 1); + CURIOUS( + HiveType.CURIOUS, + 3.0f, + HiveManager.genHelper.tree(), + false, + BiomeDictionary.Type.FOREST, + BiomeDictionary.Type.PLAINS, + BiomeDictionary.Type.HILLS), + UNUSUAL( + HiveType.UNUSUAL, + 1.0f, + HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass), + false, + BiomeDictionary.Type.PLAINS, + BiomeDictionary.Type.MOUNTAIN, + BiomeDictionary.Type.HILLS, + BiomeDictionary.Type.RIVER), + RESONANT( + HiveType.RESONANT, + 0.9f, + HiveManager.genHelper.ground(Blocks.sand, Blocks.sandstone), + false, + BiomeDictionary.Type.SANDY, + BiomeDictionary.Type.MESA, + BiomeDictionary.Type.HOT, + BiomeDictionary.Type.MAGICAL), + DEEP( + HiveType.DEEP, + 5.0f, + new HiveGenUnderground(10, 15, 5), + true, + BiomeDictionary.Type.HILLS, + BiomeDictionary.Type.MOUNTAIN, + BiomeDictionary.Type.MAGICAL) { + @Override + public void postGen(World world, int x, int y, int z) { + super.postGen(world, x, y, z); + Random random = world.rand; + FeatureOreVein.redstoneGen.generateVein(world, random, x + 1, y, z, 5); + FeatureOreVein.redstoneGen.generateVein(world, random, x - 1, y, z, 5); + FeatureOreVein.redstoneGen.generateVein(world, random, x, y + 1, z, 5); + FeatureOreVein.redstoneGen.generateVein(world, random, x, y - 1, z, 5); + FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z + 1, 5); + FeatureOreVein.redstoneGen.generateVein(world, random, x, y, z - 1, 5); + } + }, + INFERNAL(HiveType.INFERNAL, 50.0f, new HiveGenNether(0, 175, 6), true, BiomeDictionary.Type.NETHER) { + @Override + public void postGen(World world, int x, int y, int z) { + super.postGen(world, x, y, z); + Random random = world.rand; + FeatureOreVein.netherQuartzGen.generateVein(world, random, x + 1, y, z, 4); + FeatureOreVein.netherQuartzGen.generateVein(world, random, x - 1, y, z, 4); + FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y + 1, z, 4); + FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y - 1, z, 4); + FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z + 1, 4); + FeatureOreVein.netherQuartzGen.generateVein(world, random, x, y, z - 1, 4); + } + }, + INFERNAL_OVERWORLD( + HiveType.INFERNAL, + 0.95f, + new HiveGenUnderground(5, 13, 6), + true, + BiomeDictionary.Type.MAGICAL, + BiomeDictionary.Type.HOT) { + @Override + public void postGen(World world, int x, int y, int z) { + super.postGen(world, x, y, z); + Random random = world.rand; + FeatureOreVein.glowstoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(4) + 1); + FeatureOreVein.glowstoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(4) + 1); - if (BlockUtil.canBlockReplaceAt(world, x, y + 1, z, Blocks.stone)) { - world.setBlock(x, y + 1, z, Blocks.glowstone, 0, 3); - } + if (BlockUtil.canBlockReplaceAt(world, x, y + 1, z, Blocks.stone)) { + world.setBlock(x, y + 1, z, Blocks.glowstone, 0, 3); + } - if (BlockUtil.canBlockReplaceAt(world, x, y - 1, z, Blocks.stone)) { - world.setBlock(x, y - 1, z, Blocks.glowstone, 0, 3); - } + if (BlockUtil.canBlockReplaceAt(world, x, y - 1, z, Blocks.stone)) { + world.setBlock(x, y - 1, z, Blocks.glowstone, 0, 3); + } - FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(4) + 1); - FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(4) + 1); - } - }, - OBLIVION(HiveType.OBLIVION, 20.0f, new HiveGenOblivion(), true, - BiomeDictionary.Type.END) { - @Override - public void postGen(World world, int x, int y, int z) { - super.postGen(world, x, y, z); - int obsidianSpikeHeight = world.rand.nextInt(8) + 3; + FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(4) + 1); + FeatureOreVein.glowstoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(4) + 1); + } + }, + OBLIVION(HiveType.OBLIVION, 20.0f, new HiveGenOblivion(), true, BiomeDictionary.Type.END) { + @Override + public void postGen(World world, int x, int y, int z) { + super.postGen(world, x, y, z); + int obsidianSpikeHeight = world.rand.nextInt(8) + 3; - for (int i = 1; i < obsidianSpikeHeight && y - i > 0; ++i) { - world.setBlock(x, y - i, z, Blocks.obsidian, 0, 2); - } - } - }, - OBLIVION_OVERWORLD(HiveType.OBLIVION, 0.87f, new HiveGenUnderground(5, 5, 5), true, - BiomeDictionary.Type.MAGICAL, BiomeDictionary.Type.COLD) { - @Override - public void postGen(World world, int x, int y, int z) { - super.postGen(world, x, y, z); - Random random = world.rand; + for (int i = 1; i < obsidianSpikeHeight && y - i > 0; ++i) { + world.setBlock(x, y - i, z, Blocks.obsidian, 0, 2); + } + } + }, + OBLIVION_OVERWORLD( + HiveType.OBLIVION, + 0.87f, + new HiveGenUnderground(5, 5, 5), + true, + BiomeDictionary.Type.MAGICAL, + BiomeDictionary.Type.COLD) { + @Override + public void postGen(World world, int x, int y, int z) { + super.postGen(world, x, y, z); + Random random = world.rand; - FeatureOreVein.endStoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(6) + 1); - FeatureOreVein.endStoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(6) + 1); - FeatureOreVein.endStoneGen.generateVein(world, random, x, y + 1, z, world.rand.nextInt(3) + 1); - FeatureOreVein.endStoneGen.generateVein(world, random, x, y - 1, z, world.rand.nextInt(3) + 1); - FeatureOreVein.endStoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(6) + 1); - FeatureOreVein.endStoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(6) + 1); - } - }; + FeatureOreVein.endStoneGen.generateVein(world, random, x + 1, y, z, world.rand.nextInt(6) + 1); + FeatureOreVein.endStoneGen.generateVein(world, random, x - 1, y, z, world.rand.nextInt(6) + 1); + FeatureOreVein.endStoneGen.generateVein(world, random, x, y + 1, z, world.rand.nextInt(3) + 1); + FeatureOreVein.endStoneGen.generateVein(world, random, x, y - 1, z, world.rand.nextInt(3) + 1); + FeatureOreVein.endStoneGen.generateVein(world, random, x, y, z + 1, world.rand.nextInt(6) + 1); + FeatureOreVein.endStoneGen.generateVein(world, random, x, y, z - 1, world.rand.nextInt(6) + 1); + } + }; - private static boolean logSpawns = Config.logHiveSpawns; + private static boolean logSpawns = Config.logHiveSpawns; - private final HiveType hiveType; - private final float genChance; - private final List biomes = new ArrayList(); - private final IHiveGen hiveGen; - private final boolean spawnsIgnoreClimate; - - private HiveDescription(HiveType type, float chance, IHiveGen genType, boolean ignoreClimate, BiomeDictionary.Type ... goodBiomeTypes) { - hiveType = type; - genChance = chance; - hiveGen = genType; - spawnsIgnoreClimate = ignoreClimate; - for (BiomeDictionary.Type biomeType : goodBiomeTypes) { - biomes.add(biomeType); - } - } + private final HiveType hiveType; + private final float genChance; + private final List biomes = new ArrayList(); + private final IHiveGen hiveGen; + private final boolean spawnsIgnoreClimate; - @Override - public IHiveGen getHiveGen() - { - return hiveGen; - } + private HiveDescription( + HiveType type, + float chance, + IHiveGen genType, + boolean ignoreClimate, + BiomeDictionary.Type... goodBiomeTypes) { + hiveType = type; + genChance = chance; + hiveGen = genType; + spawnsIgnoreClimate = ignoreClimate; + for (BiomeDictionary.Type biomeType : goodBiomeTypes) { + biomes.add(biomeType); + } + } - @Override - public Block getBlock() - { - return Config.hive; - } + @Override + public IHiveGen getHiveGen() { + return hiveGen; + } - @Override - public int getMeta() - { - return hiveType.ordinal(); - } + @Override + public Block getBlock() { + return Config.hive; + } - @Override - public boolean isGoodBiome(BiomeGenBase biome) - { - BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biome); - for (BiomeDictionary.Type type : types) - { - if (biomes.contains(type)) - { - return true; - } - } + @Override + public int getMeta() { + return hiveType.ordinal(); + } - return false; - } + @Override + public boolean isGoodBiome(BiomeGenBase biome) { + BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biome); + for (BiomeDictionary.Type type : types) { + if (biomes.contains(type)) { + return true; + } + } - @Override - public boolean isGoodHumidity(EnumHumidity humidity) - { - return spawnsIgnoreClimate || hiveType.getOccupant().canWorkInHumidity(humidity); - } + return false; + } - @Override - public boolean isGoodTemperature(EnumTemperature temperature) - { - return spawnsIgnoreClimate || hiveType.getOccupant().canWorkInTemperature(temperature); - } + @Override + public boolean isGoodHumidity(EnumHumidity humidity) { + return spawnsIgnoreClimate || hiveType.getOccupant().canWorkInHumidity(humidity); + } - @Override - public float getGenChance() - { - return genChance; - } + @Override + public boolean isGoodTemperature(EnumTemperature temperature) { + return spawnsIgnoreClimate || hiveType.getOccupant().canWorkInTemperature(temperature); + } - @Override - public void postGen(World world, int x, int y, int z) - { - if (logSpawns) - { - LogHelper.info("Spawned " + this.toString().toLowerCase(Locale.ENGLISH) + " hive at: X " + x + ", Y: " + y + ", Z: " + z); - } - } + @Override + public float getGenChance() { + return genChance; + } + + @Override + public void postGen(World world, int x, int y, int z) { + if (logSpawns) { + LogHelper.info("Spawned " + this.toString().toLowerCase(Locale.ENGLISH) + " hive at: X " + x + ", Y: " + y + + ", Z: " + z); + } + } } diff --git a/src/main/java/magicbees/bees/HiveDrop.java b/src/main/java/magicbees/bees/HiveDrop.java index b00399f..d5a6430 100644 --- a/src/main/java/magicbees/bees/HiveDrop.java +++ b/src/main/java/magicbees/bees/HiveDrop.java @@ -1,77 +1,66 @@ package magicbees.bees; -import java.util.ArrayList; -import java.util.Collection; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IBee; import forestry.api.apiculture.IHiveDrop; import forestry.api.genetics.IAllele; +import java.util.ArrayList; +import java.util.Collection; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; -public class HiveDrop implements IHiveDrop -{ - private IAllele[] template; - private int chance; - private ItemStack[] bonus; - private float ignoblePercent = 0f; - - public HiveDrop(IAllele[] beeTemplate, ItemStack[] bonusDrops, int dropChance) - { - this.template = beeTemplate; - this.bonus = bonusDrops; - this.chance = dropChance; - } - - public HiveDrop setIgnoblePercentage(float f) - { - this.ignoblePercent = f; - - return this; - } - - private IBee getBee(World w) - { - IBee bee = BeeManager.beeRoot.getBee(w, BeeManager.beeRoot.templateAsGenome(this.template)); - if (w.rand.nextFloat() < this.ignoblePercent) - { - bee.setIsNatural(false); - } - - return bee; - } +public class HiveDrop implements IHiveDrop { + private IAllele[] template; + private int chance; + private ItemStack[] bonus; + private float ignoblePercent = 0f; - @Override - public ItemStack getPrincess(World world, int x, int y, int z, int fortune) - { - return BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.PRINCESS.ordinal()); - } + public HiveDrop(IAllele[] beeTemplate, ItemStack[] bonusDrops, int dropChance) { + this.template = beeTemplate; + this.bonus = bonusDrops; + this.chance = dropChance; + } - @Override - public Collection getDrones(World world, int x, int y, int z, int fortune) - { - ArrayList value = new ArrayList(1); - value.add(BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.DRONE.ordinal())); - return value; - } + public HiveDrop setIgnoblePercentage(float f) { + this.ignoblePercent = f; - @Override - public Collection getAdditional(World world, int x, int y, int z, int fortune) - { - ArrayList value = new ArrayList(bonus.length); - - for (int i = 0; i < bonus.length; ++i) - { - value.add(bonus[i].copy()); - } - - return value; - } + return this; + } - @Override - public int getChance(World world, int x, int y, int z) - { - return this.chance; - } + private IBee getBee(World w) { + IBee bee = BeeManager.beeRoot.getBee(w, BeeManager.beeRoot.templateAsGenome(this.template)); + if (w.rand.nextFloat() < this.ignoblePercent) { + bee.setIsNatural(false); + } + + return bee; + } + + @Override + public ItemStack getPrincess(World world, int x, int y, int z, int fortune) { + return BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.PRINCESS.ordinal()); + } + + @Override + public Collection getDrones(World world, int x, int y, int z, int fortune) { + ArrayList value = new ArrayList(1); + value.add(BeeManager.beeRoot.getMemberStack(getBee(world), EnumBeeType.DRONE.ordinal())); + return value; + } + + @Override + public Collection getAdditional(World world, int x, int y, int z, int fortune) { + ArrayList value = new ArrayList(bonus.length); + + for (int i = 0; i < bonus.length; ++i) { + value.add(bonus[i].copy()); + } + + return value; + } + + @Override + public int getChance(World world, int x, int y, int z) { + return this.chance; + } } diff --git a/src/main/java/magicbees/bees/MoonPhaseMutationBonus.java b/src/main/java/magicbees/bees/MoonPhaseMutationBonus.java index ed2db26..5e84386 100644 --- a/src/main/java/magicbees/bees/MoonPhaseMutationBonus.java +++ b/src/main/java/magicbees/bees/MoonPhaseMutationBonus.java @@ -1,49 +1,59 @@ package magicbees.bees; -import net.minecraft.world.World; - import forestry.api.core.IClimateProvider; import forestry.api.genetics.IAllele; import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; - import magicbees.main.utils.LocalizationManager; import magicbees.main.utils.MoonPhase; +import net.minecraft.world.World; // There is a bonus to this mutation during moon phases... public class MoonPhaseMutationBonus implements IMutationCondition { - private final MoonPhase moonPhaseStart; - private final MoonPhase moonPhaseEnd; - private final float mutationBonus; + private final MoonPhase moonPhaseStart; + private final MoonPhase moonPhaseEnd; + private final float mutationBonus; - public MoonPhaseMutationBonus(MoonPhase phase, float bonus) { - this.moonPhaseStart = phase; - this.moonPhaseEnd = phase; - this.mutationBonus = bonus; - } + public MoonPhaseMutationBonus(MoonPhase phase, float bonus) { + this.moonPhaseStart = phase; + this.moonPhaseEnd = phase; + this.mutationBonus = bonus; + } - public MoonPhaseMutationBonus(MoonPhase start, MoonPhase end, float bonus) { - this.moonPhaseStart = start; - this.moonPhaseEnd = end; - this.mutationBonus = bonus; - } + public MoonPhaseMutationBonus(MoonPhase start, MoonPhase end, float bonus) { + this.moonPhaseStart = start; + this.moonPhaseEnd = end; + this.mutationBonus = bonus; + } - @Override - public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) { - if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) { - return this.mutationBonus; - } - return 1; - } + @Override + public float getChance( + World world, + int x, + int y, + int z, + IAllele allele0, + IAllele allele1, + IGenome genome0, + IGenome genome1, + IClimateProvider climate) { + if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) { + return this.mutationBonus; + } + return 1; + } - @Override - public String getDescription() { - if (this.moonPhaseStart != this.moonPhaseEnd) { - return String.format(LocalizationManager.getLocalizedString("research.bonusPhase"), - moonPhaseStart.getLocalizedNameAlt(), moonPhaseEnd.getLocalizedNameAlt()); - } else { - return String.format(LocalizationManager.getLocalizedString("research.bonusPhaseSingle"), - moonPhaseStart.getLocalizedName()); - } - } + @Override + public String getDescription() { + if (this.moonPhaseStart != this.moonPhaseEnd) { + return String.format( + LocalizationManager.getLocalizedString("research.bonusPhase"), + moonPhaseStart.getLocalizedNameAlt(), + moonPhaseEnd.getLocalizedNameAlt()); + } else { + return String.format( + LocalizationManager.getLocalizedString("research.bonusPhaseSingle"), + moonPhaseStart.getLocalizedName()); + } + } } diff --git a/src/main/java/magicbees/bees/MoonPhaseMutationRestriction.java b/src/main/java/magicbees/bees/MoonPhaseMutationRestriction.java index aed398b..e152faf 100644 --- a/src/main/java/magicbees/bees/MoonPhaseMutationRestriction.java +++ b/src/main/java/magicbees/bees/MoonPhaseMutationRestriction.java @@ -1,46 +1,55 @@ package magicbees.bees; -import net.minecraft.world.World; - import forestry.api.core.IClimateProvider; import forestry.api.genetics.IAllele; import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; - import magicbees.main.utils.LocalizationManager; import magicbees.main.utils.MoonPhase; +import net.minecraft.world.World; public class MoonPhaseMutationRestriction implements IMutationCondition { - private final MoonPhase moonPhaseStart; - private final MoonPhase moonPhaseEnd; + private final MoonPhase moonPhaseStart; + private final MoonPhase moonPhaseEnd; - public MoonPhaseMutationRestriction(MoonPhase phase) { - this.moonPhaseStart = phase; - this.moonPhaseEnd = phase; - } + public MoonPhaseMutationRestriction(MoonPhase phase) { + this.moonPhaseStart = phase; + this.moonPhaseEnd = phase; + } - public MoonPhaseMutationRestriction(MoonPhase start, MoonPhase end) { - this.moonPhaseStart = start; - this.moonPhaseEnd = end; - } + public MoonPhaseMutationRestriction(MoonPhase start, MoonPhase end) { + this.moonPhaseStart = start; + this.moonPhaseEnd = end; + } - @Override - public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) { - if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) { - return 1; - } - return 0; - } + @Override + public float getChance( + World world, + int x, + int y, + int z, + IAllele allele0, + IAllele allele1, + IGenome genome0, + IGenome genome1, + IClimateProvider climate) { + if (MoonPhase.getMoonPhase(world).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) { + return 1; + } + return 0; + } - @Override - public String getDescription() { - if (moonPhaseStart != moonPhaseEnd) { - return String.format(LocalizationManager.getLocalizedString("research.requiresPhase"), - moonPhaseStart.getLocalizedNameAlt(), moonPhaseEnd.getLocalizedNameAlt()); - } - else { - return String.format(LocalizationManager.getLocalizedString("research.requiresPhaseSingle"), - moonPhaseStart.getLocalizedName()); - } - } + @Override + public String getDescription() { + if (moonPhaseStart != moonPhaseEnd) { + return String.format( + LocalizationManager.getLocalizedString("research.requiresPhase"), + moonPhaseStart.getLocalizedNameAlt(), + moonPhaseEnd.getLocalizedNameAlt()); + } else { + return String.format( + LocalizationManager.getLocalizedString("research.requiresPhaseSingle"), + moonPhaseStart.getLocalizedName()); + } + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectCrumbling.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectCrumbling.java index ba097a0..6a09895 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectCrumbling.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectCrumbling.java @@ -1,87 +1,90 @@ package magicbees.bees.allele.effect; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.apiculture.IBeeModifier; +import forestry.api.genetics.IEffectData; import java.util.HashMap; - import magicbees.bees.AlleleEffect; import magicbees.bees.BeeManager; - import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.genetics.IEffectData; public class AlleleEffectCrumbling extends AlleleEffect { - private static HashMap crumbleMap = new HashMap(); + private static HashMap crumbleMap = new HashMap(); - public static void addPairToMap(ItemStack source, ItemStack target) { - boolean add = true; - for (ItemStack i : crumbleMap.keySet()) { - if (OreDictionary.itemMatches(i, source, false)) { - add = false; - break; - } - } - if (add) { - crumbleMap.put(source, target); - } - } + public static void addPairToMap(ItemStack source, ItemStack target) { + boolean add = true; + for (ItemStack i : crumbleMap.keySet()) { + if (OreDictionary.itemMatches(i, source, false)) { + add = false; + break; + } + } + if (add) { + crumbleMap.put(source, target); + } + } - public AlleleEffectCrumbling(String id, boolean isDominant) { - super(id, isDominant, 600); + public AlleleEffectCrumbling(String id, boolean isDominant) { + super(id, isDominant, 600); - addPairToMap(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone)); - addPairToMap(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone)); - addPairToMap(new ItemStack(Blocks.stonebrick, 1, 0), new ItemStack(Blocks.stonebrick, 1, 2)); - addPairToMap(new ItemStack(Blocks.stonebrick, 1, 2), new ItemStack(Blocks.stonebrick, 1, 1)); - addPairToMap(new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall, 1, 1)); - addPairToMap(new ItemStack(Blocks.gravel), new ItemStack(Blocks.sand)); - } + addPairToMap(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone)); + addPairToMap(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone)); + addPairToMap(new ItemStack(Blocks.stonebrick, 1, 0), new ItemStack(Blocks.stonebrick, 1, 2)); + addPairToMap(new ItemStack(Blocks.stonebrick, 1, 2), new ItemStack(Blocks.stonebrick, 1, 1)); + addPairToMap(new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall, 1, 1)); + addPairToMap(new ItemStack(Blocks.gravel), new ItemStack(Blocks.sand)); + } - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { - storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); - } - return storedData; - } + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { + storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); + } + return storedData; + } - @Override - protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - World world = housing.getWorld(); - ChunkCoordinates coords = housing.getCoordinates(); - IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + @Override + protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + World world = housing.getWorld(); + ChunkCoordinates coords = housing.getCoordinates(); + IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - // Get random coords within territory - int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]); - int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]); - int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]); + // Get random coords within territory + int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]); + int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]); + int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]); - int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2; - int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2; - int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2; + int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2; + int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2; + int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2; - Block block = world.getBlock(xCoord, yCoord, zCoord); - if (block != null) { - ItemStack source = new ItemStack(block, 1, world.getBlockMetadata(xCoord, yCoord, zCoord)); - for (ItemStack key : crumbleMap.keySet()) { - if (OreDictionary.itemMatches(source, key, false)) { - ItemStack target = crumbleMap.get(key); - world.setBlock(xCoord, yCoord, zCoord, Block.getBlockFromItem(target.getItem()), target.getItemDamage(), 2); + Block block = world.getBlock(xCoord, yCoord, zCoord); + if (block != null) { + ItemStack source = new ItemStack(block, 1, world.getBlockMetadata(xCoord, yCoord, zCoord)); + for (ItemStack key : crumbleMap.keySet()) { + if (OreDictionary.itemMatches(source, key, false)) { + ItemStack target = crumbleMap.get(key); + world.setBlock( + xCoord, + yCoord, + zCoord, + Block.getBlockFromItem(target.getItem()), + target.getItemDamage(), + 2); - break; - } - } - } + break; + } + } + } - storedData.setInteger(0, 0); - - return storedData; - } + storedData.setInteger(0, 0); + return storedData; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectCure.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectCure.java index 38c85cc..d5bf72f 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectCure.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectCure.java @@ -1,41 +1,37 @@ package magicbees.bees.allele.effect; -import java.util.List; - -import magicbees.bees.AlleleEffect; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; +import java.util.List; +import magicbees.bees.AlleleEffect; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; public class AlleleEffectCure extends AlleleEffect { - public AlleleEffectCure(String id, boolean isDominant) { - super(id, isDominant, 200); - } + public AlleleEffectCure(String id, boolean isDominant) { + super(id, isDominant, 200); + } - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (storedData == null) { - storedData = new EffectData(1, 0, 0); - } - return storedData; - } + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (storedData == null) { + storedData = new EffectData(1, 0, 0); + } + return storedData; + } - @Override - public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - List entityList = this.getEntitiesWithinRange(genome, housing, EntityPlayer.class); + @Override + public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + List entityList = this.getEntitiesWithinRange(genome, housing, EntityPlayer.class); - for (EntityPlayer player : entityList) { - player.curePotionEffects(new ItemStack(Items.milk_bucket)); - } - storedData.setInteger(0, 0); - - return storedData; - } + for (EntityPlayer player : entityList) { + player.curePotionEffects(new ItemStack(Items.milk_bucket)); + } + storedData.setInteger(0, 0); + return storedData; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectEmpowering.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectEmpowering.java index fbf6b60..7438879 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectEmpowering.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectEmpowering.java @@ -1,61 +1,60 @@ package magicbees.bees.allele.effect; +import static magicbees.main.utils.compat.thaumcraft.NodeHelper.getWeightedRandomAspect; +import static magicbees.main.utils.compat.thaumcraft.NodeHelper.updateNode; + +import cpw.mods.fml.common.Optional; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.apiculture.IBeeModifier; +import forestry.api.genetics.IEffectData; +import gregtech.api.interfaces.IAlleleBeeAcceleratableEffect; import java.util.ArrayList; import java.util.Collections; import java.util.List; - -import cpw.mods.fml.common.Optional; -import gregtech.api.interfaces.IAlleleBeeAcceleratableEffect; import magicbees.bees.AlleleEffect; import magicbees.bees.BeeManager; import magicbees.main.Config; import magicbees.main.utils.BlockUtil; import magicbees.main.utils.compat.thaumcraft.NodeHelper; - import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.genetics.IEffectData; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.nodes.INode; -import static magicbees.main.utils.compat.thaumcraft.NodeHelper.getWeightedRandomAspect; -import static magicbees.main.utils.compat.thaumcraft.NodeHelper.updateNode; - @Optional.Interface(iface = "gregtech.api.interfaces.IAlleleBeeAcceleratableEffect", modid = "gregtech") public class AlleleEffectEmpowering extends AlleleEffect implements IAlleleBeeAcceleratableEffect { - public AlleleEffectEmpowering(String id, boolean isDominant) { - super(id, isDominant, 200); - combinable = true; - } + public AlleleEffectEmpowering(String id, boolean isDominant) { + super(id, isDominant, 200); + combinable = true; + } - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (!(storedData instanceof EffectData)) { - storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); - } - return storedData; - } + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (!(storedData instanceof EffectData)) { + storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); + } + return storedData; + } - @Override - protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - World world = housing.getWorld(); - ChunkCoordinates coords = housing.getCoordinates(); - IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - int range = Math.max((int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1); - List chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); + @Override + protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + World world = housing.getWorld(); + ChunkCoordinates coords = housing.getCoordinates(); + IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + int range = + Math.max((int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1); + List chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); if (NodeHelper.growNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) { - storedData.setInteger(0, storedData.getInteger(0) - throttle); + storedData.setInteger(0, storedData.getInteger(0) - throttle); } - return storedData; - } + return storedData; + } @Optional.Method(modid = "gregtech") @Override @@ -64,21 +63,20 @@ public class AlleleEffectEmpowering extends AlleleEffect implements IAlleleBeeAc World world = housing.getWorld(); ChunkCoordinates coords = housing.getCoordinates(); IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - int range = Math.max((int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1); + int range = + Math.max((int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1); List chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); - int idid = (int)did; + int idid = (int) did; List nodes = new ArrayList<>(idid); Collections.shuffle(chunks); - for(Chunk chunk : chunks) { + for (Chunk chunk : chunks) { List l = NodeHelper.findNodesInChunkWithinRange(chunk, coords.posX, coords.posY, coords.posZ, range); nodes.addAll(l); idid -= l.size(); - if(idid <= 0) - { - while(idid < 0) - { + if (idid <= 0) { + while (idid < 0) { nodes.remove(0); idid++; } @@ -86,15 +84,12 @@ public class AlleleEffectEmpowering extends AlleleEffect implements IAlleleBeeAc } } - if(nodes.isEmpty()) - return storedData; + if (nodes.isEmpty()) return storedData; did /= (float) nodes.size(); - if(did < 1f) - did = 1f; + if (did < 1f) did = 1f; - - for(INode node : nodes){ + for (INode node : nodes) { AspectList aspectsBase = node.getAspectsBase(); int randBase = Math.max(aspectsBase.visSize(), 1); if (world.rand.nextInt(randBase) < 120) { @@ -103,14 +98,13 @@ public class AlleleEffectEmpowering extends AlleleEffect implements IAlleleBeeAc do { aspectToAdd = getWeightedRandomAspect(world.rand); ++rollAttempts; - } - while (aspectsBase.getAmount(aspectToAdd) > (Config.thaumcraftNodeMaxSize -1) && rollAttempts < 20); + } while (aspectsBase.getAmount(aspectToAdd) > (Config.thaumcraftNodeMaxSize - 1) && rollAttempts < 20); if (20 <= rollAttempts) { continue; } - short amount = (short)((int)did + world.rand.nextInt((int)(2f * did))); + short amount = (short) ((int) did + world.rand.nextInt((int) (2f * did))); aspectsBase.add(aspectToAdd, amount); node.getAspects().add(aspectToAdd, amount); updateNode(node, world); diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectNodeConversion.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectNodeConversion.java index 0ed0b14..ffd9eba 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectNodeConversion.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectNodeConversion.java @@ -1,7 +1,10 @@ package magicbees.bees.allele.effect; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.apiculture.IBeeModifier; +import forestry.api.genetics.IEffectData; import java.util.List; - import magicbees.bees.AlleleEffect; import magicbees.bees.BeeManager; import magicbees.main.utils.BlockUtil; @@ -10,41 +13,37 @@ import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import thaumcraft.api.nodes.NodeType; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.genetics.IEffectData; public class AlleleEffectNodeConversion extends AlleleEffect { - private NodeType targetType; - - public AlleleEffectNodeConversion(String id, NodeType targetNodeType, boolean isDominant, int timeout) { - super(id, isDominant, timeout); - targetType = targetNodeType; - } + private NodeType targetType; - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { - storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); - } - return storedData; - } + public AlleleEffectNodeConversion(String id, NodeType targetNodeType, boolean isDominant, int timeout) { + super(id, isDominant, timeout); + targetType = targetNodeType; + } - @Override - protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - World world = housing.getWorld(); - ChunkCoordinates coords = housing.getCoordinates(); - IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)); - List chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); - - if (NodeHelper.convertNodeInRangeToType(chunks, world, coords.posX, coords.posY, coords.posZ, range, targetType)) { - storedData.setInteger(0, storedData.getInteger(0) - throttle); - } - - return storedData; - } + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { + storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); + } + return storedData; + } + @Override + protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + World world = housing.getWorld(); + ChunkCoordinates coords = housing.getCoordinates(); + IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + int range = (int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)); + List chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); + + if (NodeHelper.convertNodeInRangeToType( + chunks, world, coords.posX, coords.posY, coords.posZ, range, targetType)) { + storedData.setInteger(0, storedData.getInteger(0) - throttle); + } + + return storedData; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectNodeRepair.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectNodeRepair.java index 1023920..be2a521 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectNodeRepair.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectNodeRepair.java @@ -1,46 +1,44 @@ package magicbees.bees.allele.effect; -import java.util.List; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeModifier; import forestry.api.genetics.IEffectData; +import java.util.List; import magicbees.bees.AlleleEffect; import magicbees.bees.BeeManager; import magicbees.main.utils.BlockUtil; import magicbees.main.utils.compat.thaumcraft.NodeHelper; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; public class AlleleEffectNodeRepair extends AlleleEffect { - public AlleleEffectNodeRepair(String id, boolean isDominant) { - super(id, isDominant, 2); - } + public AlleleEffectNodeRepair(String id, boolean isDominant) { + super(id, isDominant, 2); + } - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { - storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); - } - return storedData; - } + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { + storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); + } + return storedData; + } - @Override - protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - World world = housing.getWorld(); - ChunkCoordinates coords = housing.getCoordinates(); - IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)); - List chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); - - if (NodeHelper.repairNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) { - storedData.setInteger(0, storedData.getInteger(0) - throttle); - } - - return storedData; - } + @Override + protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + World world = housing.getWorld(); + ChunkCoordinates coords = housing.getCoordinates(); + IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + int range = (int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)); + List chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); + if (NodeHelper.repairNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) { + storedData.setInteger(0, storedData.getInteger(0) - throttle); + } + + return storedData; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectPlaceholder.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectPlaceholder.java index 83c9b07..64a9637 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectPlaceholder.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectPlaceholder.java @@ -7,18 +7,17 @@ import magicbees.bees.AlleleEffect; public class AlleleEffectPlaceholder extends AlleleEffect { - public AlleleEffectPlaceholder(String id, boolean isDominant) { - super(id, isDominant, 100000); - } + public AlleleEffectPlaceholder(String id, boolean isDominant) { + super(id, isDominant, 100000); + } - @Override - public IEffectData validateStorage(IEffectData storedData) { - return storedData; - } - - @Override - protected IEffectData doEffectThrottled(IBeeGenome genome,IEffectData storedData, IBeeHousing housing) { - return storedData; - } + @Override + public IEffectData validateStorage(IEffectData storedData) { + return storedData; + } + @Override + protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + return storedData; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectPotion.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectPotion.java index 153aa36..f5f87c2 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectPotion.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectPotion.java @@ -1,64 +1,61 @@ package magicbees.bees.allele.effect; -import java.util.List; - -import magicbees.bees.AlleleEffect; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; - import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; +import java.util.List; +import magicbees.bees.AlleleEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; public class AlleleEffectPotion extends AlleleEffect { - private int potionId; - private int duration; - private boolean isMalicious; + private int potionId; + private int duration; + private boolean isMalicious; - public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant) { - super(name, isDominant, 200); - this.potionId = potionApplied.id; - this.duration = 20 * effectDuration; - this.isMalicious = false; - } + public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant) { + super(name, isDominant, 200); + this.potionId = potionApplied.id; + this.duration = 20 * effectDuration; + this.isMalicious = false; + } - public AlleleEffectPotion setMalicious() { - this.isMalicious = true; + public AlleleEffectPotion setMalicious() { + this.isMalicious = true; - return this; - } + return this; + } - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (storedData == null) { - storedData = new EffectData(1, 0, 0); - } - return storedData; - } + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (storedData == null) { + storedData = new EffectData(1, 0, 0); + } + return storedData; + } - @Override - public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - List entityList = this.getEntitiesWithinRange(genome, housing, EntityLivingBase.class); + @Override + public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + List entityList = this.getEntitiesWithinRange(genome, housing, EntityLivingBase.class); - for (EntityLivingBase e : entityList) { - if (this.isMalicious) { - int armorPieces = BeeManager.armorApiaristHelper.wearsItems(e, getUID(), true); - int finalDuration = this.duration / 4 * (4 - armorPieces); - if (finalDuration > 0) { - e.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0)); - } - } else { - if (e instanceof EntityPlayer) { - e.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0)); - } - } - } - storedData.setInteger(0, 0); + for (EntityLivingBase e : entityList) { + if (this.isMalicious) { + int armorPieces = BeeManager.armorApiaristHelper.wearsItems(e, getUID(), true); + int finalDuration = this.duration / 4 * (4 - armorPieces); + if (finalDuration > 0) { + e.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0)); + } + } else { + if (e instanceof EntityPlayer) { + e.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0)); + } + } + } + storedData.setInteger(0, 0); - return storedData; - } + return storedData; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectRecharge.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectRecharge.java index c1ebe5b..03d1d0c 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectRecharge.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectRecharge.java @@ -1,47 +1,45 @@ package magicbees.bees.allele.effect; -import java.util.List; - -import magicbees.bees.AlleleEffect; -import magicbees.bees.BeeManager; -import magicbees.main.utils.BlockUtil; -import magicbees.main.utils.compat.thaumcraft.NodeHelper; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeModifier; import forestry.api.genetics.IEffectData; +import java.util.List; +import magicbees.bees.AlleleEffect; +import magicbees.bees.BeeManager; +import magicbees.main.utils.BlockUtil; +import magicbees.main.utils.compat.thaumcraft.NodeHelper; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; public class AlleleEffectRecharge extends AlleleEffect { - - public AlleleEffectRecharge(String id, boolean isDominant) { - super(id, isDominant, 20); - combinable = true; - } - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { - storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); - } - return storedData; - } + public AlleleEffectRecharge(String id, boolean isDominant) { + super(id, isDominant, 20); + combinable = true; + } + + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { + storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); + } + return storedData; + } + + @Override + protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + World world = housing.getWorld(); + ChunkCoordinates coords = housing.getCoordinates(); + IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + int range = (int) Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)); + List chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); - @Override - protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - World world = housing.getWorld(); - ChunkCoordinates coords = housing.getCoordinates(); - IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)); - List chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range); - if (NodeHelper.rechargeNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) { - storedData.setInteger(0, storedData.getInteger(0) - throttle); + storedData.setInteger(0, storedData.getInteger(0) - throttle); } - return storedData; - } + return storedData; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnMob.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnMob.java index d4440a5..7c66884 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnMob.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnMob.java @@ -1,10 +1,12 @@ package magicbees.bees.allele.effect; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.apiculture.IBeeModifier; +import forestry.api.genetics.IEffectData; import java.util.List; - import magicbees.bees.AlleleEffect; import magicbees.bees.BeeManager; - import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; @@ -12,175 +14,185 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.genetics.IEffectData; public class AlleleEffectSpawnMob extends AlleleEffect { - protected boolean aggosOnPlayer; - protected boolean spawnsWhilePlayerNear; - protected String alternateMob; - protected String mobName; - protected String mobSound; - protected int chanceToSpawn; - protected int maxMobsInArea; + protected boolean aggosOnPlayer; + protected boolean spawnsWhilePlayerNear; + protected String alternateMob; + protected String mobName; + protected String mobSound; + protected int chanceToSpawn; + protected int maxMobsInArea; - public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn) { - this(id, isDominant, mobToSpawn, null); - } + public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn) { + this(id, isDominant, mobToSpawn, null); + } - public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn, String mobSoundFx) { - super(id, isDominant, 200); - this.aggosOnPlayer = false; - this.mobName = mobToSpawn; - this.chanceToSpawn = 100; - this.maxMobsInArea = 6; - this.mobSound = mobSoundFx; - } + public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn, String mobSoundFx) { + super(id, isDominant, 200); + this.aggosOnPlayer = false; + this.mobName = mobToSpawn; + this.chanceToSpawn = 100; + this.maxMobsInArea = 6; + this.mobSound = mobSoundFx; + } - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { - // Throttle; Ready to spawn - storedData = new EffectData(1, 1, 0); - } - return storedData; - } + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { + // Throttle; Ready to spawn + storedData = new EffectData(1, 1, 0); + } + return storedData; + } - @Override - public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - // Check if we're ready to spawn the mob. - boolean didSpawn = false; - if (storedData.getBoolean(0)) { - World w = housing.getWorld(); - - int roll = w.rand.nextInt(100); - - if (roll <= chanceToSpawn) { - if (spawnsWhilePlayerNear) { - EntityPlayer target = findPlayerTarget(genome, housing); - - // Let's spawn a mob. =D - if (target != null) { - didSpawn = spawnMob(genome, target, w, housing, false); - } else if (alternateMob != null) { - didSpawn = spawnMob(genome, null, w, housing, true); - } - } else { - storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true)); - } - } else { - playMobLiveSound(genome, housing, w); - didSpawn = true; - } - - if (didSpawn) { - storedData.setBoolean(0, !didSpawn); - storedData.setInteger(0, storedData.getInteger(0) - throttle); - } - } - else { - storedData.setBoolean(0, true); - } + @Override + public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + // Check if we're ready to spawn the mob. + boolean didSpawn = false; + if (storedData.getBoolean(0)) { + World w = housing.getWorld(); - return storedData; - } + int roll = w.rand.nextInt(100); - private void playMobLiveSound(IBeeGenome genome, IBeeHousing housing, World w) { - if (mobSound != null && w.rand.nextInt(100) < 35) { - ChunkCoordinates coords = housing.getCoordinates(); + if (roll <= chanceToSpawn) { + if (spawnsWhilePlayerNear) { + EntityPlayer target = findPlayerTarget(genome, housing); - int range = genome.getTerritory()[0]; - double x = coords.posX + w.rand.nextDouble() * (range * 2) - range; - range = genome.getTerritory()[1]; - double y = coords.posY + w.rand.nextDouble() * (range * 2) - range; - range = genome.getTerritory()[2]; - double z = coords.posZ + w.rand.nextDouble() * (range * 2) - range; - w.playSoundEffect(x, y, z, this.mobSound, 0.5f, (w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f + 1.0f); - } - } + // Let's spawn a mob. =D + if (target != null) { + didSpawn = spawnMob(genome, target, w, housing, false); + } else if (alternateMob != null) { + didSpawn = spawnMob(genome, null, w, housing, true); + } + } else { + storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true)); + } + } else { + playMobLiveSound(genome, housing, w); + didSpawn = true; + } - private EntityPlayer findPlayerTarget(IBeeGenome genome, IBeeHousing housing) { - List entities = getEntitiesWithinRange(genome, housing, EntityPlayer.class); - for (EntityPlayer e : entities) { - // Check for wearing armor & cancel - // Full armor suit is treated as "invisible." - if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) e, getUID(), true) < 4) { - return e; - } - } - return null; - } + if (didSpawn) { + storedData.setBoolean(0, !didSpawn); + storedData.setInteger(0, storedData.getInteger(0) - throttle); + } + } else { + storedData.setBoolean(0, true); + } - protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) { - boolean spawnedFlag = false; + return storedData; + } - EntityLiving mob; - if (spawnAlternate && alternateMob != null) { - mob = (EntityLiving) EntityList.createEntityByName(alternateMob, world); - } else { - mob = (EntityLiving) EntityList.createEntityByName(mobName, world); - } + private void playMobLiveSound(IBeeGenome genome, IBeeHousing housing, World w) { + if (mobSound != null && w.rand.nextInt(100) < 35) { + ChunkCoordinates coords = housing.getCoordinates(); - if (mob != null) { - double pos[] = this.randomMobSpawnCoords(world, bee, housing); + int range = genome.getTerritory()[0]; + double x = coords.posX + w.rand.nextDouble() * (range * 2) - range; + range = genome.getTerritory()[1]; + double y = coords.posY + w.rand.nextDouble() * (range * 2) - range; + range = genome.getTerritory()[2]; + double z = coords.posZ + w.rand.nextDouble() * (range * 2) - range; + w.playSoundEffect(x, y, z, this.mobSound, 0.5f, (w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f + 1.0f); + } + } - int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(), - AxisAlignedBB.getBoundingBox((int) pos[0], (int) pos[1], (int) pos[2], - (int) pos[0] + 1, (int) pos[1] + 1, (int) pos[2] + 1) - .expand(8.0D,4.0D, 8.0D)).size(); + private EntityPlayer findPlayerTarget(IBeeGenome genome, IBeeHousing housing) { + List entities = getEntitiesWithinRange(genome, housing, EntityPlayer.class); + for (EntityPlayer e : entities) { + // Check for wearing armor & cancel + // Full armor suit is treated as "invisible." + if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) e, getUID(), true) + < 4) { + return e; + } + } + return null; + } - mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f); + protected boolean spawnMob( + IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) { + boolean spawnedFlag = false; - if (entitiesCount < maxMobsInArea && mob.getCanSpawnHere()) { - spawnedFlag = world.spawnEntityInWorld(mob); - if (aggosOnPlayer && player != null) { - if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) { - // Protect fully suited player from initial murder intent. - mob.setAttackTarget(player); - } - } - } - } + EntityLiving mob; + if (spawnAlternate && alternateMob != null) { + mob = (EntityLiving) EntityList.createEntityByName(alternateMob, world); + } else { + mob = (EntityLiving) EntityList.createEntityByName(mobName, world); + } - return spawnedFlag; - } + if (mob != null) { + double pos[] = this.randomMobSpawnCoords(world, bee, housing); - public AlleleEffectSpawnMob setSpawnsOnPlayerNear(String alternateMobToSpawn) { - spawnsWhilePlayerNear = true; - alternateMob = alternateMobToSpawn; - return this; - } + int entitiesCount = world.getEntitiesWithinAABB( + mob.getClass(), + AxisAlignedBB.getBoundingBox( + (int) pos[0], + (int) pos[1], + (int) pos[2], + (int) pos[0] + 1, + (int) pos[1] + 1, + (int) pos[2] + 1) + .expand(8.0D, 4.0D, 8.0D)) + .size(); - public AlleleEffectSpawnMob setAggrosPlayerOnSpawn() { - aggosOnPlayer = true; - return this; - } + mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f); - public AlleleEffectSpawnMob setThrottle(int val) { - throttle = val; - return this; - } + if (entitiesCount < maxMobsInArea && mob.getCanSpawnHere()) { + spawnedFlag = world.spawnEntityInWorld(mob); + if (aggosOnPlayer && player != null) { + if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems( + (EntityLivingBase) player, getUID(), true) + < 4) { + // Protect fully suited player from initial murder intent. + mob.setAttackTarget(player); + } + } + } + } - public AlleleEffectSpawnMob setChanceToSpawn(int value) { - chanceToSpawn = value; - return this; - } + return spawnedFlag; + } - public AlleleEffectSpawnMob setMaxMobsInSpawnZone(int value) { - maxMobsInArea = value; - return this; - } + public AlleleEffectSpawnMob setSpawnsOnPlayerNear(String alternateMobToSpawn) { + spawnsWhilePlayerNear = true; + alternateMob = alternateMobToSpawn; + return this; + } - protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) { - ChunkCoordinates coords = housing.getCoordinates(); - IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + public AlleleEffectSpawnMob setAggrosPlayerOnSpawn() { + aggosOnPlayer = true; + return this; + } - double pos[] = new double[3]; - pos[0] = coords.posX + (world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2); - pos[1] = coords.posY + world.rand.nextInt(3) - 1; - pos[2] = coords.posZ + (world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2); - return pos; - } + public AlleleEffectSpawnMob setThrottle(int val) { + throttle = val; + return this; + } + + public AlleleEffectSpawnMob setChanceToSpawn(int value) { + chanceToSpawn = value; + return this; + } + + public AlleleEffectSpawnMob setMaxMobsInSpawnZone(int value) { + maxMobsInArea = value; + return this; + } + + protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) { + ChunkCoordinates coords = housing.getCoordinates(); + IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + + double pos[] = new double[3]; + pos[0] = coords.posX + + (world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f)) + - bee.getTerritory()[0] / 2); + pos[1] = coords.posY + world.rand.nextInt(3) - 1; + pos[2] = coords.posZ + + (world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f)) + - bee.getTerritory()[2] / 2); + return pos; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnMobWeighted.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnMobWeighted.java index 4200901..7e7ff93 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnMobWeighted.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnMobWeighted.java @@ -1,87 +1,90 @@ package magicbees.bees.allele.effect; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.apiculture.IBeeModifier; +import forestry.api.genetics.IEffectData; import magicbees.bees.AlleleEffect; import magicbees.bees.BeeManager; - import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.genetics.IEffectData; - public class AlleleEffectSpawnMobWeighted extends AlleleEffect { - private String[] entityNames; - private int[] spawnChance; + private String[] entityNames; + private int[] spawnChance; - public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance) { - super(id, isDominant, throttle); - if (mobs.length != chance.length) { - throw new IllegalArgumentException("Array lengths must be equal!"); - } - this.entityNames = mobs; - this.spawnChance = chance; - } + public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance) { + super(id, isDominant, throttle); + if (mobs.length != chance.length) { + throw new IllegalArgumentException("Array lengths must be equal!"); + } + this.entityNames = mobs; + this.spawnChance = chance; + } - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { - storedData = new EffectData(1, 0, 0); - } - return storedData; - } + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { + storedData = new EffectData(1, 0, 0); + } + return storedData; + } - @Override - public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - if (this.spawnMob(genome, housing)) { - storedData.setInteger(0, 0); - } + @Override + public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + if (this.spawnMob(genome, housing)) { + storedData.setInteger(0, 0); + } - return storedData; - } + return storedData; + } - protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing) { - boolean flag = false; + protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing) { + boolean flag = false; - World w = housing.getWorld(); - int roll = 0; + World w = housing.getWorld(); + int roll = 0; - for (int i = 0; i < this.spawnChance.length && !flag; ++i) { - roll = 100 - w.rand.nextInt(100) + 1; - if (roll < this.spawnChance[i]) { - Entity mob = EntityList.createEntityByName(this.entityNames[i], w); - if (mob != null) { - flag = true; - double[] coords = this.randomMobSpawnCoords(w, genome, housing); - - mob.setPositionAndRotation(coords[0], coords[1], coords[2], w.rand.nextFloat() * 360f, 0f); - if (mob instanceof EntityLiving) { - if (((EntityLiving) mob).getCanSpawnHere()) { - w.spawnEntityInWorld(mob); - } - } else { - w.spawnEntityInWorld(mob); - } - } - } - } + for (int i = 0; i < this.spawnChance.length && !flag; ++i) { + roll = 100 - w.rand.nextInt(100) + 1; + if (roll < this.spawnChance[i]) { + Entity mob = EntityList.createEntityByName(this.entityNames[i], w); + if (mob != null) { + flag = true; + double[] coords = this.randomMobSpawnCoords(w, genome, housing); - return flag; - } + mob.setPositionAndRotation(coords[0], coords[1], coords[2], w.rand.nextFloat() * 360f, 0f); + if (mob instanceof EntityLiving) { + if (((EntityLiving) mob).getCanSpawnHere()) { + w.spawnEntityInWorld(mob); + } + } else { + w.spawnEntityInWorld(mob); + } + } + } + } - protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) { - ChunkCoordinates coords = housing.getCoordinates(); - IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + return flag; + } - double pos[] = new double[3]; - pos[0] = coords.posX + world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2; - pos[1] = coords.posY + world.rand.nextDouble() * (bee.getTerritory()[1] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[1] / 2; - pos[2] = coords.posZ + world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[2] / 2; - return pos; - } + protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) { + ChunkCoordinates coords = housing.getCoordinates(); + IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + double pos[] = new double[3]; + pos[0] = coords.posX + + world.rand.nextDouble() * (bee.getTerritory()[0] * beeModifier.getTerritoryModifier(bee, 1f)) + - bee.getTerritory()[0] / 2; + pos[1] = coords.posY + + world.rand.nextDouble() * (bee.getTerritory()[1] * beeModifier.getTerritoryModifier(bee, 1f)) + - bee.getTerritory()[1] / 2; + pos[2] = coords.posZ + + world.rand.nextDouble() * (bee.getTerritory()[2] * beeModifier.getTerritoryModifier(bee, 1f)) + - bee.getTerritory()[2] / 2; + return pos; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnWisp.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnWisp.java index 4b873cc..adcab83 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnWisp.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectSpawnWisp.java @@ -1,7 +1,9 @@ package magicbees.bees.allele.effect; +import forestry.api.apiculture.BeeManager; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; import java.lang.reflect.Field; - import magicbees.main.utils.compat.ThaumcraftHelper; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; @@ -10,68 +12,70 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; -import forestry.api.apiculture.BeeManager; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; - public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob { - private byte[] wispTypes = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47 - }; + private byte[] wispTypes = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 + }; - public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn, String soundToPlay) { - super(id, isDominant, mobToSpawn, soundToPlay); - } + public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn, String soundToPlay) { + super(id, isDominant, mobToSpawn, soundToPlay); + } - @Override - protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) { - boolean spawnedFlag = false; + @Override + protected boolean spawnMob( + IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) { + boolean spawnedFlag = false; - EntityLiving mob; - if (spawnAlternate && this.alternateMob != null) { - mob = (EntityLiving) EntityList.createEntityByName(this.alternateMob, world); - } else { - mob = (EntityLiving) EntityList.createEntityByName(this.mobName, world); - } + EntityLiving mob; + if (spawnAlternate && this.alternateMob != null) { + mob = (EntityLiving) EntityList.createEntityByName(this.alternateMob, world); + } else { + mob = (EntityLiving) EntityList.createEntityByName(this.mobName, world); + } - if (mob != null) { - double pos[] = this.randomMobSpawnCoords(world, bee, housing); + if (mob != null) { + double pos[] = this.randomMobSpawnCoords(world, bee, housing); - int entitiesCount = world.getEntitiesWithinAABB( - mob.getClass(), - AxisAlignedBB.getBoundingBox((int) pos[0], (int) pos[1], (int) pos[2], (int) pos[0] + 1, (int) pos[1] + 1, (int) pos[2] + 1).expand(8.0D, - 4.0D, 8.0D)).size(); + int entitiesCount = world.getEntitiesWithinAABB( + mob.getClass(), + AxisAlignedBB.getBoundingBox( + (int) pos[0], + (int) pos[1], + (int) pos[2], + (int) pos[0] + 1, + (int) pos[1] + 1, + (int) pos[2] + 1) + .expand(8.0D, 4.0D, 8.0D)) + .size(); - mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f); + mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f); - if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere()) { - // Try some Reflection on TC code. This could be dangerous. - try { - Class wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName()); - Field type = wispEntity.getDeclaredField("type"); - type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]); - } catch (Exception e) { /* - * Last time I had a request to post - * error messages, I regretted it. - */ - } + if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere()) { + // Try some Reflection on TC code. This could be dangerous. + try { + Class wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName()); + Field type = wispEntity.getDeclaredField("type"); + type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]); + } catch (Exception e) { + /* + * Last time I had a request to post + * error messages, I regretted it. + */ + } - spawnedFlag = world.spawnEntityInWorld(mob); - if (this.aggosOnPlayer && player != null) { - if (BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) { - // Protect fully suited player from initial murder - // intent. - mob.setAttackTarget(player); - } - } - } - } + spawnedFlag = world.spawnEntityInWorld(mob); + if (this.aggosOnPlayer && player != null) { + if (BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) { + // Protect fully suited player from initial murder + // intent. + mob.setAttackTarget(player); + } + } + } + } - return spawnedFlag; - } + return spawnedFlag; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/AlleleEffectTransmuting.java b/src/main/java/magicbees/bees/allele/effect/AlleleEffectTransmuting.java index 04c08fe..2b74642 100644 --- a/src/main/java/magicbees/bees/allele/effect/AlleleEffectTransmuting.java +++ b/src/main/java/magicbees/bees/allele/effect/AlleleEffectTransmuting.java @@ -1,55 +1,61 @@ package magicbees.bees.allele.effect; -import magicbees.bees.AlleleEffect; -import magicbees.bees.BeeManager; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeModifier; import forestry.api.genetics.IEffectData; +import magicbees.bees.AlleleEffect; +import magicbees.bees.BeeManager; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; public class AlleleEffectTransmuting extends AlleleEffect { - - private TransmutationEffectController transmutationController; - - public AlleleEffectTransmuting(String id, boolean isDominant, TransmutationEffectController effectController, int timeoutBeeTicks) { - super(id, isDominant, timeoutBeeTicks); - this.transmutationController = effectController; - } - @Override - public IEffectData validateStorage(IEffectData storedData) { - if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { - storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); - } - return storedData; - } + private TransmutationEffectController transmutationController; - @Override - protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { - World world = housing.getWorld(); - ChunkCoordinates coords = housing.getCoordinates(); - IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + public AlleleEffectTransmuting( + String id, boolean isDominant, TransmutationEffectController effectController, int timeoutBeeTicks) { + super(id, isDominant, timeoutBeeTicks); + this.transmutationController = effectController; + } - // Get random coords within territory - int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]); - int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]); - int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]); + @Override + public IEffectData validateStorage(IEffectData storedData) { + if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) { + storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0); + } + return storedData; + } - int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2; - int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2; - int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2; + @Override + protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) { + World world = housing.getWorld(); + ChunkCoordinates coords = housing.getCoordinates(); + IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); - transmutationController.attemptTransmutations(world, biome, - new ItemStack(world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)), xCoord, yCoord, zCoord); + // Get random coords within territory + int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]); + int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]); + int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]); - storedData.setInteger(0, 0); + int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2; + int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2; + int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2; - return storedData; - } + BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); + transmutationController.attemptTransmutations( + world, + biome, + new ItemStack( + world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)), + xCoord, + yCoord, + zCoord); + + storedData.setInteger(0, 0); + + return storedData; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/EffectData.java b/src/main/java/magicbees/bees/allele/effect/EffectData.java index e560141..60342b6 100644 --- a/src/main/java/magicbees/bees/allele/effect/EffectData.java +++ b/src/main/java/magicbees/bees/allele/effect/EffectData.java @@ -1,89 +1,70 @@ package magicbees.bees.allele.effect; -import net.minecraft.nbt.NBTTagCompound; import forestry.api.genetics.IEffectData; +import net.minecraft.nbt.NBTTagCompound; -public class EffectData implements IEffectData -{ - private int[] intData; - private boolean[] boolData; - private float[] floatData; - - public EffectData(int intCount, int boolCount, int floatCount) - { - this.intData = new int[intCount]; - this.boolData = new boolean[boolCount]; - this.floatData = new float[floatCount]; - } +public class EffectData implements IEffectData { + private int[] intData; + private boolean[] boolData; + private float[] floatData; - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - } + public EffectData(int intCount, int boolCount, int floatCount) { + this.intData = new int[intCount]; + this.boolData = new boolean[boolCount]; + this.floatData = new float[floatCount]; + } - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - } + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) {} - @Override - public void setInteger(int index, int val) - { - if (index >= 0 && index < this.intData.length) - { - this.intData[index] = val; - } - } + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) {} - @Override - public void setFloat(int index, float val) - { - if (index >= 0 && index < this.floatData.length) - { - this.floatData[index] = val; - } - } + @Override + public void setInteger(int index, int val) { + if (index >= 0 && index < this.intData.length) { + this.intData[index] = val; + } + } - @Override - public void setBoolean(int index, boolean val) - { - if (index >= 0 && index < this.boolData.length) - { - this.boolData[index] = val; - } - } + @Override + public void setFloat(int index, float val) { + if (index >= 0 && index < this.floatData.length) { + this.floatData[index] = val; + } + } - @Override - public int getInteger(int index) - { - int val = 0; - if (index >= 0 && index < this.intData.length) - { - val = this.intData[index]; - } - return val; - } + @Override + public void setBoolean(int index, boolean val) { + if (index >= 0 && index < this.boolData.length) { + this.boolData[index] = val; + } + } - @Override - public float getFloat(int index) - { - float val = 0f; - if (index >= 0 && index < this.floatData.length) - { - val = this.floatData[index]; - } - return val; - } + @Override + public int getInteger(int index) { + int val = 0; + if (index >= 0 && index < this.intData.length) { + val = this.intData[index]; + } + return val; + } - @Override - public boolean getBoolean(int index) - { - boolean val = false; - if (index >= 0 && index < this.boolData.length) - { - val = this.boolData[index]; - } - return val; - } + @Override + public float getFloat(int index) { + float val = 0f; + if (index >= 0 && index < this.floatData.length) { + val = this.floatData[index]; + } + return val; + } + @Override + public boolean getBoolean(int index) { + boolean val = false; + if (index >= 0 && index < this.boolData.length) { + val = this.boolData[index]; + } + return val; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/TransmutationEffectController.java b/src/main/java/magicbees/bees/allele/effect/TransmutationEffectController.java index 273e481..3bd31e5 100644 --- a/src/main/java/magicbees/bees/allele/effect/TransmutationEffectController.java +++ b/src/main/java/magicbees/bees/allele/effect/TransmutationEffectController.java @@ -3,7 +3,6 @@ package magicbees.bees.allele.effect; import java.util.ArrayList; import java.util.Collections; import java.util.List; - import magicbees.api.bees.ITransmutationEffectController; import magicbees.api.bees.ITransmutationEffectLogic; import magicbees.main.utils.LogHelper; @@ -12,35 +11,35 @@ import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; public class TransmutationEffectController implements ITransmutationEffectController { - private List logicObjects; + private List logicObjects; - public TransmutationEffectController(ITransmutationEffectLogic... effectLogic) { - logicObjects = new ArrayList(); - for (ITransmutationEffectLogic logic : effectLogic) { - logicObjects.add(logic); - } - } + public TransmutationEffectController(ITransmutationEffectLogic... effectLogic) { + logicObjects = new ArrayList(); + for (ITransmutationEffectLogic logic : effectLogic) { + logicObjects.add(logic); + } + } - public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { - Collections.shuffle(logicObjects); - for (ITransmutationEffectLogic logic : logicObjects) { - try { - if (logic.tryTransmutation(world, biome, sourceBlock, x, y, z)) { - break; - } - } catch (Exception e) { - LogHelper.warn(String.format("Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.", - logic.getClass().getName())); - LogHelper.info(e.getMessage()); - } - } - } - - @Override - public void addEffectLogic(ITransmutationEffectLogic logic) { - if (logic != null && !logicObjects.contains(logic)) { - logicObjects.add(logic); - } - } + public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { + Collections.shuffle(logicObjects); + for (ITransmutationEffectLogic logic : logicObjects) { + try { + if (logic.tryTransmutation(world, biome, sourceBlock, x, y, z)) { + break; + } + } catch (Exception e) { + LogHelper.warn(String.format( + "Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.", + logic.getClass().getName())); + LogHelper.info(e.getMessage()); + } + } + } + @Override + public void addEffectLogic(ITransmutationEffectLogic logic) { + if (logic != null && !logicObjects.contains(logic)) { + logicObjects.add(logic); + } + } } diff --git a/src/main/java/magicbees/bees/allele/effect/TransmutationEffectLBotaniaLiving.java b/src/main/java/magicbees/bees/allele/effect/TransmutationEffectLBotaniaLiving.java index 05f3893..20ff8a6 100644 --- a/src/main/java/magicbees/bees/allele/effect/TransmutationEffectLBotaniaLiving.java +++ b/src/main/java/magicbees/bees/allele/effect/TransmutationEffectLBotaniaLiving.java @@ -9,23 +9,21 @@ import net.minecraftforge.oredict.OreDictionary; public class TransmutationEffectLBotaniaLiving implements ITransmutationEffectLogic { - @Override - public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { - int[] oreIDs = OreDictionary.getOreIDs(sourceBlock); - for (int oreId : oreIDs) { - if (oreId == OreDictionary.getOreID("logWood")) { - world.setBlock(x, y, z, BotaniaHelper.blockLivingWood); - return true; - } - else if (oreId == OreDictionary.getOreID("stone")) { - world.setBlock(x, y, z, BotaniaHelper.blockLivingRock); - return true; - } - else if (oreId == OreDictionary.getOreID("livingwood")) { - world.setBlock(x, y, z, BotaniaHelper.blockDreamWood); - return true; - } - } - return false; - } + @Override + public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { + int[] oreIDs = OreDictionary.getOreIDs(sourceBlock); + for (int oreId : oreIDs) { + if (oreId == OreDictionary.getOreID("logWood")) { + world.setBlock(x, y, z, BotaniaHelper.blockLivingWood); + return true; + } else if (oreId == OreDictionary.getOreID("stone")) { + world.setBlock(x, y, z, BotaniaHelper.blockLivingRock); + return true; + } else if (oreId == OreDictionary.getOreID("livingwood")) { + world.setBlock(x, y, z, BotaniaHelper.blockDreamWood); + return true; + } + } + return false; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/TransmutationEffectRailcraft.java b/src/main/java/magicbees/bees/allele/effect/TransmutationEffectRailcraft.java index 8134818..05838e6 100644 --- a/src/main/java/magicbees/bees/allele/effect/TransmutationEffectRailcraft.java +++ b/src/main/java/magicbees/bees/allele/effect/TransmutationEffectRailcraft.java @@ -1,8 +1,7 @@ package magicbees.bees.allele.effect; -import java.util.Locale; - import cpw.mods.fml.common.registry.GameRegistry; +import java.util.Locale; import magicbees.api.bees.ITransmutationEffectLogic; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -13,37 +12,40 @@ import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.oredict.OreDictionary; public class TransmutationEffectRailcraft implements ITransmutationEffectLogic { - @Override - public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { - boolean flag = false; - if (OreDictionary.itemMatches(new ItemStack(Blocks.stone), sourceBlock, false) - || OreDictionary.itemMatches(new ItemStack(Blocks.cobblestone), sourceBlock, false)) { - flag = trySpawnQuarriedStone(world, biome, sourceBlock, x, y, z) || trySpawnAbyssalStone(world, biome, sourceBlock, x, y, z); - } - return flag; - } + @Override + public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { + boolean flag = false; + if (OreDictionary.itemMatches(new ItemStack(Blocks.stone), sourceBlock, false) + || OreDictionary.itemMatches(new ItemStack(Blocks.cobblestone), sourceBlock, false)) { + flag = trySpawnQuarriedStone(world, biome, sourceBlock, x, y, z) + || trySpawnAbyssalStone(world, biome, sourceBlock, x, y, z); + } + return flag; + } - private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { - boolean flag = false; - if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) && !BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY)) { - ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1); - if (item != null) { - world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2); - flag = true; - } - } - return flag; - } + private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { + boolean flag = false; + if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) + && !BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY)) { + ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1); + if (item != null) { + world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2); + flag = true; + } + } + return flag; + } - private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { - boolean flag = false; - if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) && !biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river")) { - ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.abyssal", 1); - if (item != null) { - world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2); - flag = true; - } - } - return flag; - } + private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { + boolean flag = false; + if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) + && !biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river")) { + ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.abyssal", 1); + if (item != null) { + world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2); + flag = true; + } + } + return flag; + } } diff --git a/src/main/java/magicbees/bees/allele/effect/TransmutationEffectVanilla.java b/src/main/java/magicbees/bees/allele/effect/TransmutationEffectVanilla.java index b47133b..de13b9a 100644 --- a/src/main/java/magicbees/bees/allele/effect/TransmutationEffectVanilla.java +++ b/src/main/java/magicbees/bees/allele/effect/TransmutationEffectVanilla.java @@ -9,17 +9,18 @@ import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.oredict.OreDictionary; public class TransmutationEffectVanilla implements ITransmutationEffectLogic { - @Override - public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { - return trySpawnSandstone(world, biome, sourceBlock, x, y, z); - } + @Override + public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { + return trySpawnSandstone(world, biome, sourceBlock, x, y, z); + } - private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { - boolean flag = false; - if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) && OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false)) { - world.setBlock(x, y, z, Blocks.sandstone); - flag = true; - } - return flag; - } + private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) { + boolean flag = false; + if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) + && OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false)) { + world.setBlock(x, y, z, Blocks.sandstone); + flag = true; + } + return flag; + } } diff --git a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProvider.java b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProvider.java index b33c579..9dca9eb 100644 --- a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProvider.java +++ b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProvider.java @@ -1,31 +1,29 @@ package magicbees.bees.allele.flowerProvider; -import java.util.Set; - -import net.minecraft.block.Block; - import forestry.api.apiculture.FlowerManager; import forestry.api.genetics.IFlower; import forestry.api.genetics.IFlowerGrowthRule; import forestry.api.genetics.IFlowerProvider; +import java.util.Set; +import net.minecraft.block.Block; public abstract class FlowerProvider implements IFlowerProvider { - @Override - @Deprecated - public Set getFlowers() { - return FlowerManager.flowerRegistry.getAcceptableFlowers(getFlowerType()); - } + @Override + @Deprecated + public Set getFlowers() { + return FlowerManager.flowerRegistry.getAcceptableFlowers(getFlowerType()); + } - protected void registerPlantableFlower(Block block, int meta, int weight) { - FlowerManager.flowerRegistry.registerPlantableFlower(block, meta, weight, getFlowerType()); - } + protected void registerPlantableFlower(Block block, int meta, int weight) { + FlowerManager.flowerRegistry.registerPlantableFlower(block, meta, weight, getFlowerType()); + } - protected void registerAcceptableFlower(Block block, int meta) { - FlowerManager.flowerRegistry.registerAcceptableFlower(block, meta, getFlowerType()); - } + protected void registerAcceptableFlower(Block block, int meta) { + FlowerManager.flowerRegistry.registerAcceptableFlower(block, meta, getFlowerType()); + } - protected void registerGrowthRule(IFlowerGrowthRule growthRule) { - FlowerManager.flowerRegistry.registerGrowthRule(growthRule, getFlowerType()); - } + protected void registerGrowthRule(IFlowerGrowthRule growthRule) { + FlowerManager.flowerRegistry.registerGrowthRule(growthRule, getFlowerType()); + } } diff --git a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderArsMagicaFlower.java b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderArsMagicaFlower.java index c5eaec0..11471ef 100644 --- a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderArsMagicaFlower.java +++ b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderArsMagicaFlower.java @@ -1,5 +1,10 @@ package magicbees.bees.allele.flowerProvider; +import forestry.api.genetics.IFlowerGrowthHelper; +import forestry.api.genetics.IFlowerGrowthRule; +import forestry.api.genetics.IFlowerRegistry; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.IPollinatable; import magicbees.main.utils.LocalizationManager; import magicbees.main.utils.compat.ArsMagicaHelper; import net.minecraft.block.Block; @@ -7,87 +12,82 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import forestry.api.genetics.IFlowerGrowthHelper; -import forestry.api.genetics.IFlowerGrowthRule; -import forestry.api.genetics.IFlowerRegistry; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IPollinatable; - public class FlowerProviderArsMagicaFlower extends FlowerProvider implements IFlowerGrowthRule { - public FlowerProviderArsMagicaFlower() { - registerPlantableFlower(ArsMagicaHelper.blackOrchid, 0, 1); - registerPlantableFlower(ArsMagicaHelper.desertNova, 0, 1); - registerPlantableFlower(ArsMagicaHelper.aum, 0, 1); - registerPlantableFlower(ArsMagicaHelper.wakebloom, 0, 1); - registerPlantableFlower(ArsMagicaHelper.tarmaRoot, 0, 1); - registerGrowthRule(this); - } + public FlowerProviderArsMagicaFlower() { + registerPlantableFlower(ArsMagicaHelper.blackOrchid, 0, 1); + registerPlantableFlower(ArsMagicaHelper.desertNova, 0, 1); + registerPlantableFlower(ArsMagicaHelper.aum, 0, 1); + registerPlantableFlower(ArsMagicaHelper.wakebloom, 0, 1); + registerPlantableFlower(ArsMagicaHelper.tarmaRoot, 0, 1); + registerGrowthRule(this); + } - @Override - public String getFlowerType() { - return "flowersArsMagica"; - } + @Override + public String getFlowerType() { + return "flowersArsMagica"; + } - @Override - public String getDescription() { - return LocalizationManager.getLocalizedString("flowerProvider.arsmagica"); - } + @Override + public String getDescription() { + return LocalizationManager.getLocalizedString("flowerProvider.arsmagica"); + } - @Override - public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) { - return products; - } + @Override + public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) { + return products; + } - @Override - public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { - return pollinatable.getPlantType().size() > 1; - } + @Override + public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { + return pollinatable.getPlantType().size() > 1; + } - @Override - @Deprecated - public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { - return growFlower(world, x, y, z); - } + @Override + @Deprecated + public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { + return growFlower(world, x, y, z); + } - @Override - public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) { - return growFlower(world, x, y, z); - } + @Override + public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) { + return growFlower(world, x, y, z); + } - @Override - @Deprecated - public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { - return growFlower(world, x, y, z); - } + @Override + @Deprecated + public boolean growFlower( + IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { + return growFlower(world, x, y, z); + } - private boolean growFlower(World world, int x, int y, int z) { - boolean flag = false; - Block blockDown = world.getBlock(x, y - 1, z); - if (world.getBlock(x, y, z).isAir(world, x, y, z)) { - if (blockDown == Blocks.dirt || blockDown == Blocks.grass) { - int dart = world.rand.nextInt(100); - Block block; - if (dart > 60) { - block = ArsMagicaHelper.blackOrchid; - } else if (dart > 30) { - block = ArsMagicaHelper.aum; - } else { - block = ArsMagicaHelper.tarmaRoot; - } - world.setBlock(x, y, z, block); - flag = true; - } else if (blockDown == Blocks.sand) { - world.setBlock(x, y, z, ArsMagicaHelper.desertNova); - flag = true; - } else if (blockDown == Blocks.stone) { - world.setBlock(x, y, z, ArsMagicaHelper.tarmaRoot); - flag = true; - } else if (blockDown == Blocks.water || blockDown == Blocks.water) { - world.setBlock(x, y, z, ArsMagicaHelper.wakebloom); - flag = true; - } - } - return flag; - } + private boolean growFlower(World world, int x, int y, int z) { + boolean flag = false; + Block blockDown = world.getBlock(x, y - 1, z); + if (world.getBlock(x, y, z).isAir(world, x, y, z)) { + if (blockDown == Blocks.dirt || blockDown == Blocks.grass) { + int dart = world.rand.nextInt(100); + Block block; + if (dart > 60) { + block = ArsMagicaHelper.blackOrchid; + } else if (dart > 30) { + block = ArsMagicaHelper.aum; + } else { + block = ArsMagicaHelper.tarmaRoot; + } + world.setBlock(x, y, z, block); + flag = true; + } else if (blockDown == Blocks.sand) { + world.setBlock(x, y, z, ArsMagicaHelper.desertNova); + flag = true; + } else if (blockDown == Blocks.stone) { + world.setBlock(x, y, z, ArsMagicaHelper.tarmaRoot); + flag = true; + } else if (blockDown == Blocks.water || blockDown == Blocks.water) { + world.setBlock(x, y, z, ArsMagicaHelper.wakebloom); + flag = true; + } + } + return flag; + } } diff --git a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderAuraNode.java b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderAuraNode.java index cd2fbda..24819e7 100644 --- a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderAuraNode.java +++ b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderAuraNode.java @@ -1,66 +1,65 @@ package magicbees.bees.allele.flowerProvider; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.IPollinatable; import magicbees.main.utils.LocalizationManager; import magicbees.main.utils.compat.ThaumcraftHelper; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IPollinatable; - public class FlowerProviderAuraNode extends FlowerProvider { - - public FlowerProviderAuraNode() { - registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.NODE.ordinal()); - registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.ENERGIZED_NODE.ordinal()); - } - @Override - public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { - return pollinatable.getPlantType().size() > 0; - } + public FlowerProviderAuraNode() { + registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.NODE.ordinal()); + registerAcceptableFlower(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.ENERGIZED_NODE.ordinal()); + } - @Override - @Deprecated - public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { - return true; - } + @Override + public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { + return pollinatable.getPlantType().size() > 0; + } - @Override - public String getFlowerType() { - return "flowersThaumcraftAuraNode"; - } + @Override + @Deprecated + public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { + return true; + } - @Override - public String getDescription() { - return LocalizationManager.getLocalizedString("flowerProvider.node"); - } + @Override + public String getFlowerType() { + return "flowersThaumcraftAuraNode"; + } - @Override - public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) { - return products; - } + @Override + public String getDescription() { + return LocalizationManager.getLocalizedString("flowerProvider.node"); + } - protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack) { - for (ItemStack stack : products) { - if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage()) { - if (stack.stackSize < stack.getItem().getItemStackLimit(stack)) { - stack.stackSize += itemStack.stackSize; - itemStack.stackSize = Math.max(stack.stackSize - stack.getItem().getItemStackLimit(stack), 0); - } - } - } + @Override + public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) { + return products; + } - if (itemStack.stackSize > 0) { - ItemStack[] newProducts = new ItemStack[products.length + 1]; - for (int i = 0; i < products.length; ++i) { - newProducts[i] = products[i]; - } - newProducts[products.length] = itemStack; - products = newProducts; - } + protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack) { + for (ItemStack stack : products) { + if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage()) { + if (stack.stackSize < stack.getItem().getItemStackLimit(stack)) { + stack.stackSize += itemStack.stackSize; + itemStack.stackSize = + Math.max(stack.stackSize - stack.getItem().getItemStackLimit(stack), 0); + } + } + } - return products; - } + if (itemStack.stackSize > 0) { + ItemStack[] newProducts = new ItemStack[products.length + 1]; + for (int i = 0; i < products.length; ++i) { + newProducts[i] = products[i]; + } + newProducts[products.length] = itemStack; + products = newProducts; + } + return products; + } } diff --git a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderBookshelf.java b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderBookshelf.java index caeac9d..de68e02 100644 --- a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderBookshelf.java +++ b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderBookshelf.java @@ -1,46 +1,45 @@ package magicbees.bees.allele.flowerProvider; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.IPollinatable; import java.util.EnumSet; - import magicbees.main.utils.LocalizationManager; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.oredict.OreDictionary; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IPollinatable; public class FlowerProviderBookshelf extends FlowerProvider { - - public FlowerProviderBookshelf() { - registerAcceptableFlower(Blocks.bookshelf, OreDictionary.WILDCARD_VALUE); - } - @Override - @Deprecated - public boolean growFlower(World world, IIndividual genome, int x, int i, int j) { - return true; - } + public FlowerProviderBookshelf() { + registerAcceptableFlower(Blocks.bookshelf, OreDictionary.WILDCARD_VALUE); + } - @Override - public String getFlowerType() { - return "flowersBookshelf"; - } + @Override + @Deprecated + public boolean growFlower(World world, IIndividual genome, int x, int i, int j) { + return true; + } - @Override - public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[]) { - return products; - } + @Override + public String getFlowerType() { + return "flowersBookshelf"; + } - @Override - public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { - EnumSet types = pollinatable.getPlantType(); - return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water); - } + @Override + public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[]) { + return products; + } - @Override - public String getDescription() { - return LocalizationManager.getLocalizedString("flowerProvider.book"); - } + @Override + public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { + EnumSet types = pollinatable.getPlantType(); + return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water); + } + + @Override + public String getDescription() { + return LocalizationManager.getLocalizedString("flowerProvider.book"); + } } diff --git a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderBotania.java b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderBotania.java index db5e7df..4afbdfb 100644 --- a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderBotania.java +++ b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderBotania.java @@ -1,66 +1,66 @@ package magicbees.bees.allele.flowerProvider; -import magicbees.main.utils.LocalizationManager; -import magicbees.main.utils.compat.BotaniaHelper; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; - import forestry.api.genetics.IFlowerGrowthHelper; import forestry.api.genetics.IFlowerGrowthRule; import forestry.api.genetics.IFlowerRegistry; import forestry.api.genetics.IIndividual; import forestry.api.genetics.IPollinatable; +import magicbees.main.utils.LocalizationManager; +import magicbees.main.utils.compat.BotaniaHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; public class FlowerProviderBotania extends FlowerProvider implements IFlowerGrowthRule { - - public FlowerProviderBotania() { - registerPlantableFlower(BotaniaHelper.blockMysticalFlower, OreDictionary.WILDCARD_VALUE, 1); - registerGrowthRule(this); - } - @Override - @Deprecated - public boolean growFlower(World world, IIndividual individual, int x, int y, int z) { - return growFlower(world, x, y, z); - } + public FlowerProviderBotania() { + registerPlantableFlower(BotaniaHelper.blockMysticalFlower, OreDictionary.WILDCARD_VALUE, 1); + registerGrowthRule(this); + } - @Override - public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) { - return growFlower(world, x, y, z); - } + @Override + @Deprecated + public boolean growFlower(World world, IIndividual individual, int x, int y, int z) { + return growFlower(world, x, y, z); + } - @Override - @Deprecated - public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { - return growFlower(world, x, y, z); - } + @Override + public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) { + return growFlower(world, x, y, z); + } - private boolean growFlower(World world, int x, int y, int z) { - if (world.isAirBlock(x, y, z) && BotaniaHelper.blockMysticalFlower.canPlaceBlockAt(world, x, y, z)) { - world.setBlock(x, y, z, BotaniaHelper.blockMysticalFlower); - world.setBlockMetadataWithNotify(x, y, z, world.rand.nextInt(16), 2); - } - return false; - } + @Override + @Deprecated + public boolean growFlower( + IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { + return growFlower(world, x, y, z); + } - @Override - public ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products) { - return products; - } + private boolean growFlower(World world, int x, int y, int z) { + if (world.isAirBlock(x, y, z) && BotaniaHelper.blockMysticalFlower.canPlaceBlockAt(world, x, y, z)) { + world.setBlock(x, y, z, BotaniaHelper.blockMysticalFlower); + world.setBlockMetadataWithNotify(x, y, z, world.rand.nextInt(16), 2); + } + return false; + } - @Override - public String getDescription() { - return LocalizationManager.getLocalizedString("flowerProvider.botania"); - } + @Override + public ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products) { + return products; + } - @Override - public String getFlowerType() { - return "flowersBotania"; - } + @Override + public String getDescription() { + return LocalizationManager.getLocalizedString("flowerProvider.botania"); + } - @Override - public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { - return pollinatable.getPlantType().size() > 0; - } + @Override + public String getFlowerType() { + return "flowersBotania"; + } + + @Override + public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { + return pollinatable.getPlantType().size() > 0; + } } diff --git a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderThaumcraftFlower.java b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderThaumcraftFlower.java index 0288c18..314120e 100644 --- a/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderThaumcraftFlower.java +++ b/src/main/java/magicbees/bees/allele/flowerProvider/FlowerProviderThaumcraftFlower.java @@ -1,5 +1,10 @@ package magicbees.bees.allele.flowerProvider; +import forestry.api.genetics.IFlowerGrowthHelper; +import forestry.api.genetics.IFlowerGrowthRule; +import forestry.api.genetics.IFlowerRegistry; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.IPollinatable; import magicbees.main.utils.LocalizationManager; import magicbees.main.utils.compat.ThaumcraftHelper; import net.minecraft.block.Block; @@ -7,69 +12,64 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import forestry.api.genetics.IFlowerGrowthHelper; -import forestry.api.genetics.IFlowerGrowthRule; -import forestry.api.genetics.IFlowerRegistry; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IPollinatable; - public class FlowerProviderThaumcraftFlower extends FlowerProvider implements IFlowerGrowthRule { - - public FlowerProviderThaumcraftFlower() { - registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 1); - registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 1); - registerGrowthRule(this); - } - @Override - public String getFlowerType() { - return "flowersThaumcraft"; - } + public FlowerProviderThaumcraftFlower() { + registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 1); + registerPlantableFlower(ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 1); + registerGrowthRule(this); + } - @Override - public String getDescription() { - return LocalizationManager.getLocalizedString("flowerProvider.magic"); - } + @Override + public String getFlowerType() { + return "flowersThaumcraft"; + } - @Override - public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) { - return products; - } + @Override + public String getDescription() { + return LocalizationManager.getLocalizedString("flowerProvider.magic"); + } - @Override - public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { - return 0 < pollinatable.getPlantType().size(); - } + @Override + public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) { + return products; + } - @Override - @Deprecated - public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { - return growFlower(world, x, y, z); - } + @Override + public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) { + return 0 < pollinatable.getPlantType().size(); + } - @Override - public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) { - return growFlower(world, x, y, z); - } + @Override + @Deprecated + public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { + return growFlower(world, x, y, z); + } - @Override - @Deprecated - public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { - return growFlower(world, x, y, z); - } + @Override + public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z) { + return growFlower(world, x, y, z); + } - private boolean growFlower(World world, int x, int y, int z) { - boolean flag = false; - Block blockDown = world.getBlock(x, y - 1, z); - if (world.getBlock(x, y, z).isAir(world, x, y, z)) { - if (blockDown == Blocks.dirt || blockDown == Blocks.grass) { - world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2); - flag = true; - } else if (blockDown == Blocks.sand) { - world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2); - flag = true; - } - } - return flag; - } + @Override + @Deprecated + public boolean growFlower( + IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { + return growFlower(world, x, y, z); + } + + private boolean growFlower(World world, int x, int y, int z) { + boolean flag = false; + Block blockDown = world.getBlock(x, y - 1, z); + if (world.getBlock(x, y, z).isAir(world, x, y, z)) { + if (blockDown == Blocks.dirt || blockDown == Blocks.grass) { + world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2); + flag = true; + } else if (blockDown == Blocks.sand) { + world.setBlock(x, y, z, ThaumcraftHelper.plant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2); + flag = true; + } + } + return flag; + } } diff --git a/src/main/java/magicbees/block/BlockEffectJar.java b/src/main/java/magicbees/block/BlockEffectJar.java index bec7226..cac8354 100644 --- a/src/main/java/magicbees/block/BlockEffectJar.java +++ b/src/main/java/magicbees/block/BlockEffectJar.java @@ -18,96 +18,84 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -public class BlockEffectJar extends BlockContainer -{ - public BlockEffectJar() - { - super(Material.glass); - this.setCreativeTab(TabMagicBees.tabMagicBees); - this.setBlockName("effectJar"); - this.setBlockBounds(0.25f, 0f, 0.25f, 0.75f, 0.81f, 0.74f); - this.setHardness(0.1f); - this.setResistance(1.5f); - } +public class BlockEffectJar extends BlockContainer { + public BlockEffectJar() { + super(Material.glass); + this.setCreativeTab(TabMagicBees.tabMagicBees); + this.setBlockName("effectJar"); + this.setBlockBounds(0.25f, 0f, 0.25f, 0.75f, 0.81f, 0.74f); + this.setHardness(0.1f); + this.setResistance(1.5f); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) - { - boolean activate = false; - - if (!player.isSneaking()) - { - player.openGui(MagicBees.object, UIScreens.EFFECT_JAR.ordinal(), world, x, y, z); - activate = true; - } - - return activate; - } + @Override + public boolean onBlockActivated( + World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { + boolean activate = false; - @Override - public TileEntity createNewTileEntity(World w, int metadata) - { - return new TileEntityEffectJar(); - } + if (!player.isSneaking()) { + player.openGui(MagicBees.object, UIScreens.EFFECT_JAR.ordinal(), world, x, y, z); + activate = true; + } - @Override - public boolean isOpaqueCube() - { - return false; - } + return activate; + } - @Override - public boolean renderAsNormalBlock() - { - return false; - } + @Override + public TileEntity createNewTileEntity(World w, int metadata) { + return new TileEntityEffectJar(); + } - @Override - public int getRenderType() - { - return CommonProxy.RenderIdEffectJar; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public void breakBlock(World world, int x, int y, int z, Block block, int meta) - { - this.dropInventory(world, x, y, z); - super.breakBlock(world, x, y, z, block, meta); - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - private void dropInventory(World world, int x, int y, int z) - { - TileEntity e = world.getTileEntity(x, y, z); - - if (e != null && e instanceof TileEntityEffectJar) - { - TileEntityEffectJar jar = (TileEntityEffectJar)e; - - // 0 is the only droppable stack. - ItemStack stack = jar.getStackInSlot(0); - - if (stack != null && stack.stackSize > 0) - { - float pX = world.rand.nextFloat() * 0.8f + 0.1f; - float pY = world.rand.nextFloat() * 0.8f + 0.1f; - float pZ = world.rand.nextFloat() * 0.8f + 0.1f; - - EntityItem entityItem = new EntityItem(world, x + pX, y + pY, z + pZ, stack.copy()); - - entityItem.motionX = world.rand.nextGaussian() * 0.05f; - entityItem.motionY = world.rand.nextGaussian() * 0.05f + 0.2f; - entityItem.motionZ = world.rand.nextGaussian() * 0.05f; - - world.spawnEntityInWorld(entityItem); - stack.stackSize = 0; - } - } - } + @Override + public int getRenderType() { + return CommonProxy.RenderIdEffectJar; + } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) - { - this.blockIcon = Blocks.glass.getIcon(0, 0); - } + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { + this.dropInventory(world, x, y, z); + super.breakBlock(world, x, y, z, block, meta); + } + + private void dropInventory(World world, int x, int y, int z) { + TileEntity e = world.getTileEntity(x, y, z); + + if (e != null && e instanceof TileEntityEffectJar) { + TileEntityEffectJar jar = (TileEntityEffectJar) e; + + // 0 is the only droppable stack. + ItemStack stack = jar.getStackInSlot(0); + + if (stack != null && stack.stackSize > 0) { + float pX = world.rand.nextFloat() * 0.8f + 0.1f; + float pY = world.rand.nextFloat() * 0.8f + 0.1f; + float pZ = world.rand.nextFloat() * 0.8f + 0.1f; + + EntityItem entityItem = new EntityItem(world, x + pX, y + pY, z + pZ, stack.copy()); + + entityItem.motionX = world.rand.nextGaussian() * 0.05f; + entityItem.motionY = world.rand.nextGaussian() * 0.05f + 0.2f; + entityItem.motionZ = world.rand.nextGaussian() * 0.05f; + + world.spawnEntityInWorld(entityItem); + stack.stackSize = 0; + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) { + this.blockIcon = Blocks.glass.getIcon(0, 0); + } } diff --git a/src/main/java/magicbees/block/BlockEnchantedEarth.java b/src/main/java/magicbees/block/BlockEnchantedEarth.java index 5fe7e3b..dfd02f8 100644 --- a/src/main/java/magicbees/block/BlockEnchantedEarth.java +++ b/src/main/java/magicbees/block/BlockEnchantedEarth.java @@ -1,7 +1,8 @@ package magicbees.block; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import java.util.Random; - import magicbees.main.CommonProxy; import magicbees.main.utils.TabMagicBees; import net.minecraft.block.Block; @@ -12,64 +13,62 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.util.ForgeDirection; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockEnchantedEarth extends Block { - - @SideOnly(Side.CLIENT) - private IIcon top; - public BlockEnchantedEarth() { - super(Material.ground); - setCreativeTab(TabMagicBees.tabMagicBees); - setBlockName("enchantedEarth"); - setBlockTextureName(CommonProxy.DOMAIN + ":enchantedEarth"); - setTickRandomly(true); - setStepSound(soundTypeGravel); - } + @SideOnly(Side.CLIENT) + private IIcon top; - @Override - public void updateTick(World world, int x, int y, int z, Random random) { - for (int height = y + 1; height <= 256; ++height) { - Block b = world.getBlock(x, height, z); - if (b == this) { - continue; - } - else { - if (b.getTickRandomly()) { - world.scheduleBlockUpdate(x, height, z, b, 0); - } - break; - } - } - if (y < 256 && random.nextInt(2) == 0) { - int newX = x + (random.nextInt(3) - 1); - int newZ = z + (random.nextInt(3) - 1); - int newY = y + 1; - Block b = world.getBlock(newX, newY, newZ); - if (b.getTickRandomly()) { - world.scheduleBlockUpdate(newX, newY, newZ, b, random.nextInt(5) + 1); - } - } - } + public BlockEnchantedEarth() { + super(Material.ground); + setCreativeTab(TabMagicBees.tabMagicBees); + setBlockName("enchantedEarth"); + setBlockTextureName(CommonProxy.DOMAIN + ":enchantedEarth"); + setTickRandomly(true); + setStepSound(soundTypeGravel); + } - @Override - public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) { - return true; - } + @Override + public void updateTick(World world, int x, int y, int z, Random random) { + for (int height = y + 1; height <= 256; ++height) { + Block b = world.getBlock(x, height, z); + if (b == this) { + continue; + } else { + if (b.getTickRandomly()) { + world.scheduleBlockUpdate(x, height, z, b, 0); + } + break; + } + } + if (y < 256 && random.nextInt(2) == 0) { + int newX = x + (random.nextInt(3) - 1); + int newZ = z + (random.nextInt(3) - 1); + int newY = y + 1; + Block b = world.getBlock(newX, newY, newZ); + if (b.getTickRandomly()) { + world.scheduleBlockUpdate(newX, newY, newZ, b, random.nextInt(5) + 1); + } + } + } - @Override - public IIcon getIcon(int side, int meta) { - if (side == 1) { - return top; - } - return super.getIcon(side, meta); - } + @Override + public boolean canSustainPlant( + IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) { + return true; + } - @Override - public void registerBlockIcons(IIconRegister iconRegister) { - top = iconRegister.registerIcon(textureName + "_top"); - super.registerBlockIcons(iconRegister); - } + @Override + public IIcon getIcon(int side, int meta) { + if (side == 1) { + return top; + } + return super.getIcon(side, meta); + } + + @Override + public void registerBlockIcons(IIconRegister iconRegister) { + top = iconRegister.registerIcon(textureName + "_top"); + super.registerBlockIcons(iconRegister); + } } diff --git a/src/main/java/magicbees/block/BlockHive.java b/src/main/java/magicbees/block/BlockHive.java index a20b805..6a9a151 100644 --- a/src/main/java/magicbees/block/BlockHive.java +++ b/src/main/java/magicbees/block/BlockHive.java @@ -1,10 +1,10 @@ package magicbees.block; -import java.util.ArrayList; -import java.util.List; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import java.util.ArrayList; +import java.util.List; import magicbees.block.types.HiveType; import magicbees.main.Config; import net.minecraft.block.Block; @@ -17,97 +17,80 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import forestry.api.core.Tabs; -public class BlockHive extends Block -{ - public BlockHive() - { - super(new MaterialHive()); - this.setLightLevel(0.8f); - setHardness(1f); - setCreativeTab(Tabs.tabApiculture); - setBlockName("hive"); - } +public class BlockHive extends Block { + public BlockHive() { + super(new MaterialHive()); + this.setLightLevel(0.8f); + setHardness(1f); + setCreativeTab(Tabs.tabApiculture); + setBlockName("hive"); + } - @Override - public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) - { - return false; - } + @Override + public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { + return false; + } - @Override - public int damageDropped(int meta) - { - return meta; - } + @Override + public int damageDropped(int meta) { + return meta; + } - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta < 0 || meta > HiveType.values().length) - { - meta = 0; - } - return HiveType.getHiveFromMeta(meta).getLightValue(); - } + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) { + int meta = world.getBlockMetadata(x, y, z); + if (meta < 0 || meta > HiveType.values().length) { + meta = 0; + } + return HiveType.getHiveFromMeta(meta).getLightValue(); + } - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public void getSubBlocks(Item item, CreativeTabs tab, List itemsList) - { - // Java bitches about raw types & types not being checked. Sorry, but the API sucks. - for (HiveType type : HiveType.values()) - { - if (type.show || Config.forestryDebugEnabled) - { - itemsList.add(new ItemStack(this, 1, type.ordinal())); - } - } - } + @SideOnly(Side.CLIENT) + @SuppressWarnings({"rawtypes", "unchecked"}) + @Override + public void getSubBlocks(Item item, CreativeTabs tab, List itemsList) { + // Java bitches about raw types & types not being checked. Sorry, but the API sucks. + for (HiveType type : HiveType.values()) { + if (type.show || Config.forestryDebugEnabled) { + itemsList.add(new ItemStack(this, 1, type.ordinal())); + } + } + } - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) - { - return HiveType.getHiveFromMeta(metadata).getDrops(world, x, y, z, fortune); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister register) - { - HiveType.registerIcons(register); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) - { - if (meta < 0 || meta > HiveType.values().length) - { - meta = 0; - } - return HiveType.getHiveFromMeta(meta).getIconForSide(side); - } + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { + return HiveType.getHiveFromMeta(metadata).getDrops(world, x, y, z, fortune); + } - @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) - { - Block block = world.getBlock(x, y, z); + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister register) { + HiveType.registerIcons(register); + } - if (block.isAir(world, x, y, z)) - { - return null; - } + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + if (meta < 0 || meta > HiveType.values().length) { + meta = 0; + } + return HiveType.getHiveFromMeta(meta).getIconForSide(side); + } - Item item = Item.getItemFromBlock(block); - if (item == null) - { - return null; - } + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + Block block = world.getBlock(x, y, z); - return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7); - } + if (block.isAir(world, x, y, z)) { + return null; + } + + Item item = Item.getItemFromBlock(block); + if (item == null) { + return null; + } + + return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7); + } } diff --git a/src/main/java/magicbees/block/BlockMagicApiary.java b/src/main/java/magicbees/block/BlockMagicApiary.java index 92bf0cb..850f661 100644 --- a/src/main/java/magicbees/block/BlockMagicApiary.java +++ b/src/main/java/magicbees/block/BlockMagicApiary.java @@ -1,5 +1,7 @@ package magicbees.block; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.client.gui.UIScreens; import magicbees.main.CommonProxy; import magicbees.main.MagicBees; @@ -16,16 +18,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public class BlockMagicApiary extends BlockContainer -{ +public class BlockMagicApiary extends BlockContainer { @SideOnly(Side.CLIENT) private IIcon[] icons; - public BlockMagicApiary() - { + public BlockMagicApiary() { super(Material.wood); this.setCreativeTab(TabMagicBees.tabMagicBees); this.setBlockName("magicApiary"); @@ -35,12 +33,11 @@ public class BlockMagicApiary extends BlockContainer } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9 ) - { + public boolean onBlockActivated( + World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { boolean activate = false; - if (!player.isSneaking()) - { + if (!player.isSneaking()) { player.openGui(MagicBees.object, UIScreens.THAUMIC_APIARY.ordinal(), world, x, y, z); activate = true; } @@ -50,23 +47,22 @@ public class BlockMagicApiary extends BlockContainer @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta){ + public IIcon getIcon(int side, int meta) { - if (side == 0){ + if (side == 0) { return icons[0]; - }else if (side == 1){ + } else if (side == 1) { return icons[1]; - }else if (side == 2 || side == 3){ + } else if (side == 2 || side == 3) { return icons[2]; - }else{ + } else { return icons[3]; } } @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister register) - { + public void registerBlockIcons(IIconRegister register) { icons = new IIcon[4]; icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":thaumicapiary.0"); @@ -81,15 +77,15 @@ public class BlockMagicApiary extends BlockContainer } @Override - public void breakBlock(World world, int x, int y, int z, Block block, int meta){ + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { TileEntity te = world.getTileEntity(x, y, z); - if (te != null && te instanceof IInventory){ - IInventory inventory = (IInventory)te; + if (te != null && te instanceof IInventory) { + IInventory inventory = (IInventory) te; - for (int i = 0; i < inventory.getSizeInventory(); i++){ + for (int i = 0; i < inventory.getSizeInventory(); i++) { ItemStack itemStack = inventory.getStackInSlotOnClosing(i); - if (itemStack != null){ + if (itemStack != null) { float spawnX = x + world.rand.nextFloat(); float spawnY = y + world.rand.nextFloat(); float spawnZ = z + world.rand.nextFloat(); diff --git a/src/main/java/magicbees/block/BlockManaAuraProvider.java b/src/main/java/magicbees/block/BlockManaAuraProvider.java index 5d9c358..4516494 100644 --- a/src/main/java/magicbees/block/BlockManaAuraProvider.java +++ b/src/main/java/magicbees/block/BlockManaAuraProvider.java @@ -1,5 +1,7 @@ package magicbees.block; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.main.CommonProxy; import magicbees.main.utils.TabMagicBees; import magicbees.tileentity.TileEntityManaAuraProvider; @@ -10,39 +12,35 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockManaAuraProvider extends Block implements ITileEntityProvider { - @SideOnly(Side.CLIENT) - private IIcon topIcon; - - public BlockManaAuraProvider() { - super(Material.rock); - this.setCreativeTab(TabMagicBees.tabMagicBees); - this.setBlockName("manaAuraProvider"); - this.setHardness(2f); - this.setResistance(3f); - this.setHarvestLevel("pickaxe", 0); - } - - @Override - public TileEntity createNewTileEntity(World world, int meta) { - return new TileEntityManaAuraProvider(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconRegister) { - this.blockIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster0"); - this.topIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster1"); - } - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) - { - return (side == 0 || side == 1) ? this.topIcon : this.blockIcon; + private IIcon topIcon; + + public BlockManaAuraProvider() { + super(Material.rock); + this.setCreativeTab(TabMagicBees.tabMagicBees); + this.setBlockName("manaAuraProvider"); + this.setHardness(2f); + this.setResistance(3f); + this.setHarvestLevel("pickaxe", 0); } + @Override + public TileEntity createNewTileEntity(World world, int meta) { + return new TileEntityManaAuraProvider(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.blockIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster0"); + this.topIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manaApiaryBooster1"); + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return (side == 0 || side == 1) ? this.topIcon : this.blockIcon; + } } diff --git a/src/main/java/magicbees/block/BlockVisAuraProvider.java b/src/main/java/magicbees/block/BlockVisAuraProvider.java index bdb0a4e..2c335c5 100644 --- a/src/main/java/magicbees/block/BlockVisAuraProvider.java +++ b/src/main/java/magicbees/block/BlockVisAuraProvider.java @@ -1,5 +1,7 @@ package magicbees.block; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.main.CommonProxy; import magicbees.main.utils.TabMagicBees; import magicbees.tileentity.TileEntityVisAuraProvider; @@ -9,41 +11,36 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockVisAuraProvider extends BlockContainer { - public BlockVisAuraProvider() { - super(Material.glass); - this.setCreativeTab(TabMagicBees.tabMagicBees); - this.setBlockName("visAuraProvider"); - this.setHardness(0.5f); - this.setResistance(1.5f); - this.setLightLevel(8); - } + public BlockVisAuraProvider() { + super(Material.glass); + this.setCreativeTab(TabMagicBees.tabMagicBees); + this.setBlockName("visAuraProvider"); + this.setHardness(0.5f); + this.setResistance(1.5f); + this.setLightLevel(8); + } - @Override - public boolean isOpaqueCube() - { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public TileEntity createNewTileEntity(World world, int metadata) { - return new TileEntityVisAuraProvider(); - } - - @Override - public int getRenderType() - { - return CommonProxy.RenderIdVisAuraProvider; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconRegister) { - this.blockIcon = Blocks.planks.getIcon(0, 5); - } + @Override + public TileEntity createNewTileEntity(World world, int metadata) { + return new TileEntityVisAuraProvider(); + } + @Override + public int getRenderType() { + return CommonProxy.RenderIdVisAuraProvider; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.blockIcon = Blocks.planks.getIcon(0, 5); + } } diff --git a/src/main/java/magicbees/block/MaterialHive.java b/src/main/java/magicbees/block/MaterialHive.java index d8a38e0..e897491 100644 --- a/src/main/java/magicbees/block/MaterialHive.java +++ b/src/main/java/magicbees/block/MaterialHive.java @@ -3,14 +3,11 @@ package magicbees.block; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; -public class MaterialHive extends Material -{ - - public MaterialHive() - { - super(MapColor.stoneColor); - this.setImmovableMobility(); - this.setRequiresTool(); - } +public class MaterialHive extends Material { + public MaterialHive() { + super(MapColor.stoneColor); + this.setImmovableMobility(); + this.setRequiresTool(); + } } diff --git a/src/main/java/magicbees/block/types/HiveType.java b/src/main/java/magicbees/block/types/HiveType.java index dce6460..1c2bb39 100644 --- a/src/main/java/magicbees/block/types/HiveType.java +++ b/src/main/java/magicbees/block/types/HiveType.java @@ -1,8 +1,10 @@ package magicbees.block.types; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.apiculture.IHiveDrop; import java.util.ArrayList; import java.util.Collections; - import magicbees.bees.BeeGenomeManager; import magicbees.bees.BeeSpecies; import magicbees.bees.HiveDrop; @@ -15,177 +17,154 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.apiculture.IHiveDrop; -public enum HiveType -{ - CURIOUS("curious", BeeSpecies.MYSTICAL, 12, true), - UNUSUAL("unusual", BeeSpecies.UNUSUAL, 12, true), - RESONANT("resonant", BeeSpecies.SORCEROUS, 12, true), - DEEP("deep", BeeSpecies.ATTUNED, 4, false), - INFERNAL("infernal", BeeSpecies.INFERNAL, 15, false), - OBLIVION("oblivion", BeeSpecies.OBLIVION, 7, false), - ; - - private static String[] nameList; - - private String name; - private BeeSpecies occupant; - public boolean show; - private int lightLevel; - private ArrayList drops; +public enum HiveType { + CURIOUS("curious", BeeSpecies.MYSTICAL, 12, true), + UNUSUAL("unusual", BeeSpecies.UNUSUAL, 12, true), + RESONANT("resonant", BeeSpecies.SORCEROUS, 12, true), + DEEP("deep", BeeSpecies.ATTUNED, 4, false), + INFERNAL("infernal", BeeSpecies.INFERNAL, 15, false), + OBLIVION("oblivion", BeeSpecies.OBLIVION, 7, false), + ; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public static HiveType getHiveFromMeta(int meta) - { - HiveType type = CURIOUS; - - if (meta > 0 && meta < HiveType.values().length) - { - type = HiveType.values()[meta]; - } - - return type; - } - - public static void initHiveData() - { - ItemStack[] combs = new ItemStack[] { Config.combs.getStackForType(CombType.MUNDANE) }; - HiveDrop valiantDrop = new HiveDrop(BeeGenomeManager.addRainResist(ForestryHelper.getTemplateForestryForSpecies("Valiant")), combs, 5); + private static String[] nameList; - CURIOUS.drops.add(new HiveDrop(BeeSpecies.MYSTICAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f)); - CURIOUS.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.MYSTICAL.getGenome()), combs, 15)); - CURIOUS.drops.add(valiantDrop); + private String name; + private BeeSpecies occupant; + public boolean show; + private int lightLevel; + private ArrayList drops; - UNUSUAL.drops.add(new HiveDrop(BeeSpecies.UNUSUAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f)); - UNUSUAL.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.UNUSUAL.getGenome()), combs, 15)); - UNUSUAL.drops.add(valiantDrop); + @SideOnly(Side.CLIENT) + private IIcon[] icons; - RESONANT.drops.add(new HiveDrop(BeeSpecies.SORCEROUS.getGenome(), combs, 80).setIgnoblePercentage(0.7f)); - RESONANT.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.SORCEROUS.getGenome()), combs, 20)); - RESONANT.drops.add(valiantDrop); + public static HiveType getHiveFromMeta(int meta) { + HiveType type = CURIOUS; - DEEP.drops.add(new HiveDrop(BeeSpecies.ATTUNED.getGenome(), combs, 80).setIgnoblePercentage(0.65f)); - DEEP.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.ATTUNED.getGenome()), combs, 20)); - DEEP.drops.add(valiantDrop); + if (meta > 0 && meta < HiveType.values().length) { + type = HiveType.values()[meta]; + } - combs = new ItemStack[] { Config.combs.getStackForType(CombType.MOLTEN), new ItemStack(Items.glowstone_dust, 6) }; + return type; + } - INFERNAL.drops.add(new HiveDrop(BeeSpecies.INFERNAL.getGenome(), combs, 80).setIgnoblePercentage(0.5f)); - INFERNAL.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 3)); + public static void initHiveData() { + ItemStack[] combs = new ItemStack[] {Config.combs.getStackForType(CombType.MUNDANE)}; + HiveDrop valiantDrop = new HiveDrop( + BeeGenomeManager.addRainResist(ForestryHelper.getTemplateForestryForSpecies("Valiant")), combs, 5); - combs = new ItemStack[] { Config.combs.getStackForType(CombType.FORGOTTEN), new ItemStack(Items.ender_pearl, 1) }; + CURIOUS.drops.add(new HiveDrop(BeeSpecies.MYSTICAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f)); + CURIOUS.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.MYSTICAL.getGenome()), combs, 15)); + CURIOUS.drops.add(valiantDrop); - OBLIVION.drops.add(new HiveDrop(BeeSpecies.OBLIVION.getGenome(), combs, 80)); - OBLIVION.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 9)); - } - - private HiveType(String hiveName, BeeSpecies occupant, int light, boolean visible) - { - this.name = hiveName; - this.occupant = occupant; - this.lightLevel = light; - this.show = visible; - this.drops = new ArrayList(); - } - - @SideOnly(Side.CLIENT) - public static void registerIcons(IIconRegister register) - { - for (HiveType type : HiveType.values()) - { - type.icons = new IIcon[2]; + UNUSUAL.drops.add(new HiveDrop(BeeSpecies.UNUSUAL.getGenome(), combs, 80).setIgnoblePercentage(0.7f)); + UNUSUAL.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.UNUSUAL.getGenome()), combs, 15)); + UNUSUAL.drops.add(valiantDrop); - type.icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".top"); - type.icons[1] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".side"); - } - } + RESONANT.drops.add(new HiveDrop(BeeSpecies.SORCEROUS.getGenome(), combs, 80).setIgnoblePercentage(0.7f)); + RESONANT.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.SORCEROUS.getGenome()), combs, 20)); + RESONANT.drops.add(valiantDrop); - @SideOnly(Side.CLIENT) - public IIcon getIconForSide(int side) - { - IIcon i = this.icons[0]; - - if (side != 0 && side != 1) - { - i = this.icons[1]; - } - - return i; - } - - public int getLightValue() - { - return this.lightLevel; - } + DEEP.drops.add(new HiveDrop(BeeSpecies.ATTUNED.getGenome(), combs, 80).setIgnoblePercentage(0.65f)); + DEEP.drops.add(new HiveDrop(BeeGenomeManager.addRainResist(BeeSpecies.ATTUNED.getGenome()), combs, 20)); + DEEP.drops.add(valiantDrop); - public ArrayList getDrops(World world, int x, int y, int z, int fortune) - { - ArrayList hiveDrops = new ArrayList(); - int dart; - - Collections.shuffle(this.drops); + combs = new ItemStack[] {Config.combs.getStackForType(CombType.MOLTEN), new ItemStack(Items.glowstone_dust, 6)}; - // Get a princess. - int throttle = 0; - while (hiveDrops.size() <= 0 && throttle < 10) - { - ++throttle; - for (IHiveDrop drop : drops) - { - dart = world.rand.nextInt(100); - if (dart <= drop.getChance(world, x, y, z)) - { - hiveDrops.add(drop.getPrincess(world, x, y, z, fortune)); - break; - } - } - } - - // Get a drone, maybe. - for (IHiveDrop drop : drops) - { - dart = world.rand.nextInt(100); - if (dart <= drop.getChance(world, x, y, z)) - { - hiveDrops.addAll(drop.getDrones(world, x, y, z, fortune)); - break; - } - } - - // Get additional drops. - for (IHiveDrop drop : drops) - { - dart = world.rand.nextInt(100); - if (dart <= drop.getChance(world, x, y, z)) - { - hiveDrops.addAll(drop.getAdditional(world, x, y, z, fortune)); - } - } - - return hiveDrops; - } - - public static String[] getAllNames() - { - return (nameList == null) ? nameList = generateNames() : nameList; - } - - public BeeSpecies getOccupant() { - return this.occupant; - } - - private static String[] generateNames() - { - String[] names = new String[values().length]; - for (int i = 0; i < names.length; ++i) - { - names[i] = values()[i].name; - } - return names; - } + INFERNAL.drops.add(new HiveDrop(BeeSpecies.INFERNAL.getGenome(), combs, 80).setIgnoblePercentage(0.5f)); + INFERNAL.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 3)); + + combs = new ItemStack[] {Config.combs.getStackForType(CombType.FORGOTTEN), new ItemStack(Items.ender_pearl, 1)}; + + OBLIVION.drops.add(new HiveDrop(BeeSpecies.OBLIVION.getGenome(), combs, 80)); + OBLIVION.drops.add(new HiveDrop(ForestryHelper.getTemplateForestryForSpecies("Steadfast"), combs, 9)); + } + + private HiveType(String hiveName, BeeSpecies occupant, int light, boolean visible) { + this.name = hiveName; + this.occupant = occupant; + this.lightLevel = light; + this.show = visible; + this.drops = new ArrayList(); + } + + @SideOnly(Side.CLIENT) + public static void registerIcons(IIconRegister register) { + for (HiveType type : HiveType.values()) { + type.icons = new IIcon[2]; + + type.icons[0] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".top"); + type.icons[1] = register.registerIcon(CommonProxy.DOMAIN + ":beehive." + type.ordinal() + ".side"); + } + } + + @SideOnly(Side.CLIENT) + public IIcon getIconForSide(int side) { + IIcon i = this.icons[0]; + + if (side != 0 && side != 1) { + i = this.icons[1]; + } + + return i; + } + + public int getLightValue() { + return this.lightLevel; + } + + public ArrayList getDrops(World world, int x, int y, int z, int fortune) { + ArrayList hiveDrops = new ArrayList(); + int dart; + + Collections.shuffle(this.drops); + + // Get a princess. + int throttle = 0; + while (hiveDrops.size() <= 0 && throttle < 10) { + ++throttle; + for (IHiveDrop drop : drops) { + dart = world.rand.nextInt(100); + if (dart <= drop.getChance(world, x, y, z)) { + hiveDrops.add(drop.getPrincess(world, x, y, z, fortune)); + break; + } + } + } + + // Get a drone, maybe. + for (IHiveDrop drop : drops) { + dart = world.rand.nextInt(100); + if (dart <= drop.getChance(world, x, y, z)) { + hiveDrops.addAll(drop.getDrones(world, x, y, z, fortune)); + break; + } + } + + // Get additional drops. + for (IHiveDrop drop : drops) { + dart = world.rand.nextInt(100); + if (dart <= drop.getChance(world, x, y, z)) { + hiveDrops.addAll(drop.getAdditional(world, x, y, z, fortune)); + } + } + + return hiveDrops; + } + + public static String[] getAllNames() { + return (nameList == null) ? nameList = generateNames() : nameList; + } + + public BeeSpecies getOccupant() { + return this.occupant; + } + + private static String[] generateNames() { + String[] names = new String[values().length]; + for (int i = 0; i < names.length; ++i) { + names[i] = values()[i].name; + } + return names; + } } diff --git a/src/main/java/magicbees/block/types/PlankType.java b/src/main/java/magicbees/block/types/PlankType.java index 1599e64..0779fbf 100644 --- a/src/main/java/magicbees/block/types/PlankType.java +++ b/src/main/java/magicbees/block/types/PlankType.java @@ -1,45 +1,38 @@ package magicbees.block.types; -public enum PlankType -{ - GREATWOOD("greatwood", 48), - SILVERWOOD("silverwood", 49), - ; - - public String name; - public int textureIdx; - private static String[] nameList; - - private PlankType(String n, int idx) - { - this.name = n; - this.textureIdx = idx; - } - - public static PlankType getType(int meta) - { - PlankType type = null; - - if (meta >= 0 && meta <= values().length) - { - type = values()[meta]; - } - - return type; - } - - public static String[] getAllNames() - { - return (nameList == null) ? nameList = generateNames() : nameList; - } - - private static String[] generateNames() - { - String[] names = new String[values().length]; - for (int i = 0; i < names.length; ++i) - { - names[i] = values()[i].name; - } - return names; - } +public enum PlankType { + GREATWOOD("greatwood", 48), + SILVERWOOD("silverwood", 49), + ; + + public String name; + public int textureIdx; + private static String[] nameList; + + private PlankType(String n, int idx) { + this.name = n; + this.textureIdx = idx; + } + + public static PlankType getType(int meta) { + PlankType type = null; + + if (meta >= 0 && meta <= values().length) { + type = values()[meta]; + } + + return type; + } + + public static String[] getAllNames() { + return (nameList == null) ? nameList = generateNames() : nameList; + } + + private static String[] generateNames() { + String[] names = new String[values().length]; + for (int i = 0; i < names.length; ++i) { + names[i] = values()[i].name; + } + return names; + } } diff --git a/src/main/java/magicbees/client/gui/ContainerEffectJar.java b/src/main/java/magicbees/client/gui/ContainerEffectJar.java index 41b369d..1cf0676 100644 --- a/src/main/java/magicbees/client/gui/ContainerEffectJar.java +++ b/src/main/java/magicbees/client/gui/ContainerEffectJar.java @@ -10,113 +10,91 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class ContainerEffectJar extends Container -{ - public TileEntityEffectJar jar; - - public int lastBeeHealth = 0; - public int speciesColour = 0xffffff; - - public ContainerEffectJar(TileEntityEffectJar tileEntityEffectJar, EntityPlayer player) - { - this.jar = tileEntityEffectJar; - this.addSlotToContainer(new SlotCustomItems(this.jar, 0, 80, 22, GameRegistry.findItemStack("Forestry", "beeDroneGE", 1))); +public class ContainerEffectJar extends Container { + public TileEntityEffectJar jar; - for (int i = 0; i < 3; ++i) - { - for (int j = 0; j < 9; ++j) - { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 74 + i * 18)); - } - } + public int lastBeeHealth = 0; + public int speciesColour = 0xffffff; - for (int i = 0; i < 9; ++i) - { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 132)); - } - } - - @Override - public void addCraftingToCrafters(ICrafting crafting) - { - super.addCraftingToCrafters(crafting); - - crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth); - crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour); - } + public ContainerEffectJar(TileEntityEffectJar tileEntityEffectJar, EntityPlayer player) { + this.jar = tileEntityEffectJar; + this.addSlotToContainer( + new SlotCustomItems(this.jar, 0, 80, 22, GameRegistry.findItemStack("Forestry", "beeDroneGE", 1))); - @Override - public void detectAndSendChanges() - { - super.detectAndSendChanges(); - - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting crafting = (ICrafting)this.crafters.get(i); - - if (this.lastBeeHealth != this.jar.currentBeeHealth) - { - crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth); - this.lastBeeHealth = this.jar.currentBeeHealth; - } - if (this.speciesColour != this.jar.currentBeeColour) - { - crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour); - this.speciesColour = this.jar.currentBeeColour; - } - } - } + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 74 + i * 18)); + } + } - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int craftingId, int value) - { - if (craftingId == 0) - { - this.jar.currentBeeHealth = value; - } - else if (craftingId == 1) - { - this.jar.currentBeeColour = value; - } - } + for (int i = 0; i < 9; ++i) { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 132)); + } + } - @Override - public boolean canInteractWith(EntityPlayer entityplayer) - { - return this.jar.isUseableByPlayer(entityplayer); - } + @Override + public void addCraftingToCrafters(ICrafting crafting) { + super.addCraftingToCrafters(crafting); - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slot) - { - Slot itemSlot = this.getSlot(slot); - boolean clearSlot = false; - - if (itemSlot != null && itemSlot.getHasStack()) - { - ItemStack srcStack = itemSlot.getStack(); - if (slot == 0 && srcStack != null) - { - clearSlot = this.mergeItemStack(srcStack, 1, 36 + 1, false); - } - else - { - if (this.getSlot(0).isItemValid(srcStack)) - { - clearSlot = this.mergeItemStack(srcStack, 0, 1, false); - } - } - } - - if (clearSlot) - { - itemSlot.putStack(null); - } - itemSlot.onSlotChanged(); - player.inventory.markDirty(); - - return null; - } + crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth); + crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour); + } + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) { + ICrafting crafting = (ICrafting) this.crafters.get(i); + + if (this.lastBeeHealth != this.jar.currentBeeHealth) { + crafting.sendProgressBarUpdate(this, 0, this.jar.currentBeeHealth); + this.lastBeeHealth = this.jar.currentBeeHealth; + } + if (this.speciesColour != this.jar.currentBeeColour) { + crafting.sendProgressBarUpdate(this, 1, this.jar.currentBeeColour); + this.speciesColour = this.jar.currentBeeColour; + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int craftingId, int value) { + if (craftingId == 0) { + this.jar.currentBeeHealth = value; + } else if (craftingId == 1) { + this.jar.currentBeeColour = value; + } + } + + @Override + public boolean canInteractWith(EntityPlayer entityplayer) { + return this.jar.isUseableByPlayer(entityplayer); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int slot) { + Slot itemSlot = this.getSlot(slot); + boolean clearSlot = false; + + if (itemSlot != null && itemSlot.getHasStack()) { + ItemStack srcStack = itemSlot.getStack(); + if (slot == 0 && srcStack != null) { + clearSlot = this.mergeItemStack(srcStack, 1, 36 + 1, false); + } else { + if (this.getSlot(0).isItemValid(srcStack)) { + clearSlot = this.mergeItemStack(srcStack, 0, 1, false); + } + } + } + + if (clearSlot) { + itemSlot.putStack(null); + } + itemSlot.onSlotChanged(); + player.inventory.markDirty(); + + return null; + } } diff --git a/src/main/java/magicbees/client/gui/ContainerMB.java b/src/main/java/magicbees/client/gui/ContainerMB.java index e608cf7..cefa0fb 100644 --- a/src/main/java/magicbees/client/gui/ContainerMB.java +++ b/src/main/java/magicbees/client/gui/ContainerMB.java @@ -5,19 +5,18 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; -public class ContainerMB extends Container -{ +public class ContainerMB extends Container { protected final int PLAYER_INVENTORY_ROWS = 3; protected final int PLAYER_INVENTORY_COLUMNS = 9; - public void addPlayerInventory(InventoryPlayer inventoryPlayer, int xStart, int yStart) - { - for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){ - addSlotToContainer(new Slot(inventoryPlayer, x, xStart + 8 + 18 * x, yStart + 4 + PLAYER_INVENTORY_ROWS * 18)); + public void addPlayerInventory(InventoryPlayer inventoryPlayer, int xStart, int yStart) { + for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++) { + addSlotToContainer( + new Slot(inventoryPlayer, x, xStart + 8 + 18 * x, yStart + 4 + PLAYER_INVENTORY_ROWS * 18)); } - for (int y = 0; y < PLAYER_INVENTORY_ROWS; y++){ - for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++){ + for (int y = 0; y < PLAYER_INVENTORY_ROWS; y++) { + for (int x = 0; x < PLAYER_INVENTORY_COLUMNS; x++) { addSlotToContainer(new Slot(inventoryPlayer, x + y * 9 + 9, xStart + 8 + 18 * x, yStart + y * 18)); } } diff --git a/src/main/java/magicbees/client/gui/ContainerMagicApiary.java b/src/main/java/magicbees/client/gui/ContainerMagicApiary.java index c2eab67..0039eb0 100644 --- a/src/main/java/magicbees/client/gui/ContainerMagicApiary.java +++ b/src/main/java/magicbees/client/gui/ContainerMagicApiary.java @@ -19,39 +19,46 @@ public class ContainerMagicApiary extends ContainerMB { private static final int SLOT_QUEEN = 0; private static final int SLOT_DRONE = 1; private static final int SLOT_FRAME_START = 2; - private static final int SLOT_INVENTORY_START = 5; + private static final int SLOT_INVENTORY_START = 5; private static final int SLOT_FRAME_COUNT = 3; private static final int SLOT_INVENTORY_COUNT = 7; - public ContainerMagicApiary(InventoryPlayer inventoryPlayer, TileEntityMagicApiary thaumicApiary){ + public ContainerMagicApiary(InventoryPlayer inventoryPlayer, TileEntityMagicApiary thaumicApiary) { this.apiary = thaumicApiary; // Queen/Princess slot - addSlotToContainer(new SlotCustomItems(this.apiary, 0, 29, 39, ItemInterface.getItemStack("Forestry", "beeQueenGE", 1), ItemInterface.getItemStack("Forestry", "beePrincessGE", 1))); + addSlotToContainer(new SlotCustomItems( + this.apiary, + 0, + 29, + 39, + ItemInterface.getItemStack("Forestry", "beeQueenGE", 1), + ItemInterface.getItemStack("Forestry", "beePrincessGE", 1))); // Drone slot - addSlotToContainer(new SlotCustomItems(this.apiary, 1, 29, 65, ItemInterface.getItemStack("Forestry", "beeDroneGE", 64))); + addSlotToContainer( + new SlotCustomItems(this.apiary, 1, 29, 65, ItemInterface.getItemStack("Forestry", "beeDroneGE", 64))); int currentSlot = 1; // Frame slots - for (int x = 0; x < 3; x++){ + for (int x = 0; x < 3; x++) { currentSlot++; addSlotToContainer(new SlotFrame(thaumicApiary, currentSlot, 66, 23 + x * 29)); - //LogHelper.info("[1] CURRENTSLOT: " + currentSlot); + // LogHelper.info("[1] CURRENTSLOT: " + currentSlot); } - for (int x = 0; x < 3; x++){ + for (int x = 0; x < 3; x++) { currentSlot++; addSlotToContainer(new Slot(thaumicApiary, currentSlot, 116, 26 + x * 26)); - //LogHelper.info("[2] CURRENTSLOT: " + currentSlot); + // LogHelper.info("[2] CURRENTSLOT: " + currentSlot); } int j = 0; - for (int y = 0; y < 2; y++){ - for (int x = 0; x < 2; x++){ + for (int y = 0; y < 2; y++) { + for (int x = 0; x < 2; x++) { currentSlot++; addSlotToContainer(new Slot(thaumicApiary, currentSlot, 95 + x * 42, 39 + j * 26)); - //LogHelper.info("[3] CURRENTSLOT: " + currentSlot); + // LogHelper.info("[3] CURRENTSLOT: " + currentSlot); } j++; } @@ -59,41 +66,39 @@ public class ContainerMagicApiary extends ContainerMB { addPlayerInventory(inventoryPlayer, 0, 110); maxSlot = currentSlot; - } @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex){ + public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) { Slot itemSlot = this.getSlot(slotIndex); boolean clearSlot = false; if (itemSlot != null && itemSlot.getHasStack()) { ItemStack srcStack = itemSlot.getStack(); - if (slotIndex <= maxSlot && srcStack != null){ + if (slotIndex <= maxSlot && srcStack != null) { clearSlot = this.mergeItemStack(srcStack, maxSlot + 1, maxSlot + 36, false); - }else{ - if (slotIndex > maxSlot && srcStack != null){ - if (BeeManager.beeRoot.isMember(srcStack)){ - if (!BeeManager.beeRoot.isDrone(srcStack)){ - if (this.getSlot(SLOT_QUEEN).getHasStack() == false) { - clearSlot = this.mergeItemStack(srcStack, SLOT_QUEEN, SLOT_QUEEN + 1, false); - } - }else{ - if (this.getSlot(SLOT_DRONE).isItemValid(srcStack)){ - clearSlot = this.mergeItemStack(srcStack, SLOT_DRONE, SLOT_DRONE + 1, false); - } + } else { + if (slotIndex > maxSlot && srcStack != null) { + if (BeeManager.beeRoot.isMember(srcStack)) { + if (!BeeManager.beeRoot.isDrone(srcStack)) { + if (this.getSlot(SLOT_QUEEN).getHasStack() == false) { + clearSlot = this.mergeItemStack(srcStack, SLOT_QUEEN, SLOT_QUEEN + 1, false); } - }else if(srcStack.getItem() instanceof IHiveFrame){ - clearSlot = this.mergeItemStack(srcStack, SLOT_FRAME_START, SLOT_FRAME_START + SLOT_FRAME_COUNT, false); + } else { + if (this.getSlot(SLOT_DRONE).isItemValid(srcStack)) { + clearSlot = this.mergeItemStack(srcStack, SLOT_DRONE, SLOT_DRONE + 1, false); + } + } + } else if (srcStack.getItem() instanceof IHiveFrame) { + clearSlot = this.mergeItemStack( + srcStack, SLOT_FRAME_START, SLOT_FRAME_START + SLOT_FRAME_COUNT, false); } } } - - } - if (clearSlot){ + if (clearSlot) { itemSlot.putStack(null); } @@ -108,7 +113,6 @@ public class ContainerMagicApiary extends ContainerMB { return apiary.isUseableByPlayer(entityPlayer); } - @Override public void updateProgressBar(int i, int j) { apiary.getGUINetworkData(i, j); diff --git a/src/main/java/magicbees/client/gui/GUIEffectJar.java b/src/main/java/magicbees/client/gui/GUIEffectJar.java index 85b435a..9851c0e 100644 --- a/src/main/java/magicbees/client/gui/GUIEffectJar.java +++ b/src/main/java/magicbees/client/gui/GUIEffectJar.java @@ -7,59 +7,60 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +public class GUIEffectJar extends GuiContainer { + public static final String BACKGROUND_FILE = "jarScreen.png"; + public static final ResourceLocation BACKGROUND_LOCATION = + new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.GUI_TEXTURE + "jarScreen.png"); -public class GUIEffectJar extends GuiContainer -{ - public static final String BACKGROUND_FILE = "jarScreen.png"; - public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.GUI_TEXTURE + "jarScreen.png"); - - private static final int WIDTH = 176; - private static final int HEIGHT = 156; - - private static final int SLOT_JAR_X = 80; - private static final int SLOT_JAR_Y = 22; - private static final int SLOT_INVENTORY_X = 8; - private static final int SLOT_INVENTORY_Y = 74; - private static final int BAR_DEST_X = 117; - private static final int BAR_DEST_Y = 10; - - private static final int BAR_SRC_X = 176; - private static final int BAR_SRC_Y = 0; - - private static final int BAR_WIDTH = 10; - private static final int BAR_HEIGHT = 40; - - public GUIEffectJar(TileEntityEffectJar jar, EntityPlayer player) - { - super(new ContainerEffectJar(jar, player)); - this.xSize = WIDTH; - this.ySize = HEIGHT; - } + private static final int WIDTH = 176; + private static final int HEIGHT = 156; - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) - { - fontRendererObj.drawString("Inventory", 9, 63, 0); - } + private static final int SLOT_JAR_X = 80; + private static final int SLOT_JAR_Y = 22; + private static final int SLOT_INVENTORY_X = 8; + private static final int SLOT_INVENTORY_Y = 74; + private static final int BAR_DEST_X = 117; + private static final int BAR_DEST_Y = 10; - @Override - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) - { - GL11.glColor4f(1f, 1f, 1f, 1f); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_SRC_ALPHA); - this.mc.getTextureManager().bindTexture(BACKGROUND_LOCATION); - - this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize); - - TileEntityEffectJar jar = ((ContainerEffectJar)this.inventorySlots).jar; - float r = ((jar.currentBeeColour >> 16) & 255) / 255f; - float g = ((jar.currentBeeColour >> 8) & 255) / 255f; - float b = (jar.currentBeeColour & 255) / 255f; - - GL11.glColor3f(r, g, b); - - int value = BAR_HEIGHT - (jar.currentBeeHealth * BAR_HEIGHT) / 100; - this.drawTexturedModalRect(this.guiLeft + BAR_DEST_X, this.guiTop + value + BAR_DEST_Y, BAR_SRC_X, BAR_SRC_Y, BAR_WIDTH, BAR_HEIGHT - value); - } + private static final int BAR_SRC_X = 176; + private static final int BAR_SRC_Y = 0; + private static final int BAR_WIDTH = 10; + private static final int BAR_HEIGHT = 40; + + public GUIEffectJar(TileEntityEffectJar jar, EntityPlayer player) { + super(new ContainerEffectJar(jar, player)); + this.xSize = WIDTH; + this.ySize = HEIGHT; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString("Inventory", 9, 63, 0); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { + GL11.glColor4f(1f, 1f, 1f, 1f); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_SRC_ALPHA); + this.mc.getTextureManager().bindTexture(BACKGROUND_LOCATION); + + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, xSize, ySize); + + TileEntityEffectJar jar = ((ContainerEffectJar) this.inventorySlots).jar; + float r = ((jar.currentBeeColour >> 16) & 255) / 255f; + float g = ((jar.currentBeeColour >> 8) & 255) / 255f; + float b = (jar.currentBeeColour & 255) / 255f; + + GL11.glColor3f(r, g, b); + + int value = BAR_HEIGHT - (jar.currentBeeHealth * BAR_HEIGHT) / 100; + this.drawTexturedModalRect( + this.guiLeft + BAR_DEST_X, + this.guiTop + value + BAR_DEST_Y, + BAR_SRC_X, + BAR_SRC_Y, + BAR_WIDTH, + BAR_HEIGHT - value); + } } diff --git a/src/main/java/magicbees/client/gui/GUIHandler.java b/src/main/java/magicbees/client/gui/GUIHandler.java index 2dcf70b..7f2edf8 100644 --- a/src/main/java/magicbees/client/gui/GUIHandler.java +++ b/src/main/java/magicbees/client/gui/GUIHandler.java @@ -1,46 +1,36 @@ package magicbees.client.gui; +import cpw.mods.fml.common.network.IGuiHandler; import magicbees.tileentity.TileEntityEffectJar; import magicbees.tileentity.TileEntityMagicApiary; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import cpw.mods.fml.common.network.IGuiHandler; -public class GUIHandler implements IGuiHandler -{ +public class GUIHandler implements IGuiHandler { - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - Object value = null; + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + Object value = null; - if (ID == UIScreens.EFFECT_JAR.ordinal()) - { - value = new ContainerEffectJar((TileEntityEffectJar)world.getTileEntity(x, y, z), player); - } - else if (ID == UIScreens.THAUMIC_APIARY.ordinal()) - { + if (ID == UIScreens.EFFECT_JAR.ordinal()) { + value = new ContainerEffectJar((TileEntityEffectJar) world.getTileEntity(x, y, z), player); + } else if (ID == UIScreens.THAUMIC_APIARY.ordinal()) { TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z); value = new ContainerMagicApiary(player.inventory, tileEntityThaumicApiary); } - - return value; - } - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - if (ID == UIScreens.EFFECT_JAR.ordinal()) - { - return new GUIEffectJar((TileEntityEffectJar)world.getTileEntity(x, y, z), player); - }else if (ID == UIScreens.THAUMIC_APIARY.ordinal()) - { + return value; + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + if (ID == UIScreens.EFFECT_JAR.ordinal()) { + return new GUIEffectJar((TileEntityEffectJar) world.getTileEntity(x, y, z), player); + } else if (ID == UIScreens.THAUMIC_APIARY.ordinal()) { TileEntityMagicApiary tileEntityThaumicApiary = (TileEntityMagicApiary) world.getTileEntity(x, y, z); - return new GuiMagicApiary(player.inventory, tileEntityThaumicApiary); + return new GuiMagicApiary(player.inventory, tileEntityThaumicApiary); } else { - return null; - } - } - + return null; + } + } } diff --git a/src/main/java/magicbees/client/gui/GuiFactory.java b/src/main/java/magicbees/client/gui/GuiFactory.java index df88621..faec561 100644 --- a/src/main/java/magicbees/client/gui/GuiFactory.java +++ b/src/main/java/magicbees/client/gui/GuiFactory.java @@ -1,35 +1,27 @@ package magicbees.client.gui; -import java.util.Set; - import cpw.mods.fml.client.IModGuiFactory; +import java.util.Set; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; -public class GuiFactory implements IModGuiFactory -{ +public class GuiFactory implements IModGuiFactory { - @Override - public void initialize(Minecraft minecraftInstance) - { + @Override + public void initialize(Minecraft minecraftInstance) {} - } + @Override + public Class mainConfigGuiClass() { + return ModGuiConfig.class; + } - @Override - public Class mainConfigGuiClass() - { - return ModGuiConfig.class; - } + @Override + public Set runtimeGuiCategories() { + return null; + } - @Override - public Set runtimeGuiCategories() - { - return null; - } - - @Override - public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) - { - return null; - } + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { + return null; + } } diff --git a/src/main/java/magicbees/client/gui/GuiMagicApiary.java b/src/main/java/magicbees/client/gui/GuiMagicApiary.java index c9df78c..6b7582e 100644 --- a/src/main/java/magicbees/client/gui/GuiMagicApiary.java +++ b/src/main/java/magicbees/client/gui/GuiMagicApiary.java @@ -1,59 +1,57 @@ package magicbees.client.gui; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.main.CommonProxy; import magicbees.tileentity.TileEntityMagicApiary; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; - import org.lwjgl.opengl.GL11; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - @SideOnly(Side.CLIENT) -public class GuiMagicApiary extends GuiContainer -{ - public static final ResourceLocation BACKGROUND_LOCATION = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.GUI_TEXTURE + "apiary.png"); +public class GuiMagicApiary extends GuiContainer { + public static final ResourceLocation BACKGROUND_LOCATION = + new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.GUI_TEXTURE + "apiary.png"); private static final int WIDTH = 176; private static final int HEIGHT = 190; - + private static final int LIFEBAR_WIDTH = 2; private static final int LIFEBAR_HEIGHT = 46; - + private static final int LIFEBAR_DEST_X = 21; private static final int LIFEBAR_DEST_Y = 37; - + private static final int LIFEBAR_SRC_Y = 0; private static final int LIFEBAR_SRC_STAGE1_X = 184; private static final int LIFEBAR_SRC_STAGE2_X = 182; private static final int LIFEBAR_SRC_STAGE3_X = 180; private static final int LIFEBAR_SRC_STAGE4_X = 178; private static final int LIFEBAR_SRC_STAGE5_X = 176; - + private static final int WORKBOOST_WIDTH = 16; private static final int WORKBOOST_HEIGHT = 12; private static final int WORKBOOST_DEST_X = 37; private static final int WORKBOOST_DEST_Y = 18; private static final int WORKBOOST_SRC_X = 176; private static final int WORKBOOST_SRC_Y = 46; - + private static final int DEATHBOOST_WIDTH = 11; private static final int DEATHBOOST_HEIGHT = 13; private static final int DEATHBOOST_DEST_X = 25; private static final int DEATHBOOST_DEST_Y = 17; private static final int DEATHBOOST_SRC_X = 176; private static final int DEATHBOOST_SRC_Y = 58; - + private static final int MUTATIONBOOST_WIDTH = 9; private static final int MUTATIONBOOST_HEIGHT = 13; private static final int MUTATIONBOOST_DEST_X = 15; private static final int MUTATIONBOOST_DEST_Y = 17; private static final int MUTATIONBOOST_SRC_X = 176; private static final int MUTATIONBOOST_SRC_Y = 71; - + private GuiButton mutationButton; public GuiMagicApiary(InventoryPlayer inventoryPlayer, TileEntityMagicApiary thaumicApiary) { @@ -61,14 +59,12 @@ public class GuiMagicApiary extends GuiContainer this.xSize = WIDTH; this.ySize = HEIGHT; - } - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) - { - fontRendererObj.drawString("Inventory", 9, 99, 0); - } + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString("Inventory", 9, 99, 0); + } @Override protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) { @@ -76,9 +72,9 @@ public class GuiMagicApiary extends GuiContainer this.mc.getTextureManager().bindTexture(BACKGROUND_LOCATION); this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - - TileEntityMagicApiary apiary = ((ContainerMagicApiary)this.inventorySlots).apiary; - + + TileEntityMagicApiary apiary = ((ContainerMagicApiary) this.inventorySlots).apiary; + drawLifebar(apiary); drawWorkBoostIcon(apiary); @@ -86,56 +82,72 @@ public class GuiMagicApiary extends GuiContainer drawMutationIcon(apiary); } - private void drawMutationIcon(TileEntityMagicApiary apiary) { - if (apiary.isMutationBoosted()) { - this.drawTexturedModalRect(this.guiLeft + MUTATIONBOOST_DEST_X, this.guiTop + MUTATIONBOOST_DEST_Y, - MUTATIONBOOST_SRC_X, MUTATIONBOOST_SRC_Y, MUTATIONBOOST_WIDTH, MUTATIONBOOST_HEIGHT); + private void drawMutationIcon(TileEntityMagicApiary apiary) { + if (apiary.isMutationBoosted()) { + this.drawTexturedModalRect( + this.guiLeft + MUTATIONBOOST_DEST_X, + this.guiTop + MUTATIONBOOST_DEST_Y, + MUTATIONBOOST_SRC_X, + MUTATIONBOOST_SRC_Y, + MUTATIONBOOST_WIDTH, + MUTATIONBOOST_HEIGHT); } - } - - private void drawDeathRateIcon(TileEntityMagicApiary apiary) { - if (apiary.isDeathRateBoosted()) { - this.drawTexturedModalRect(this.guiLeft + DEATHBOOST_DEST_X, this.guiTop + DEATHBOOST_DEST_Y, - DEATHBOOST_SRC_X, DEATHBOOST_SRC_Y, DEATHBOOST_WIDTH, DEATHBOOST_HEIGHT); - } - } - - private void drawWorkBoostIcon(TileEntityMagicApiary apiary) { - if (apiary.isProductionBoosted()) { - this.drawTexturedModalRect(this.guiLeft + WORKBOOST_DEST_X, this.guiTop + WORKBOOST_DEST_Y, - WORKBOOST_SRC_X, WORKBOOST_SRC_Y, WORKBOOST_WIDTH, WORKBOOST_HEIGHT); - } - } - - private void drawLifebar(TileEntityMagicApiary apiary) { - int value = LIFEBAR_HEIGHT - apiary.getHealthScaled(LIFEBAR_HEIGHT); - int lifebarSrc = getLifebarSrc(apiary); - this.drawTexturedModalRect(this.guiLeft + LIFEBAR_DEST_X, this.guiTop + value + LIFEBAR_DEST_Y, - lifebarSrc, LIFEBAR_SRC_Y, LIFEBAR_WIDTH, LIFEBAR_HEIGHT - value); - } - - private int getLifebarSrc(TileEntityMagicApiary apiary) { - int value = apiary.getHealthScaled(5); - if (value >= 5) { - return LIFEBAR_SRC_STAGE1_X; - } - else if (value >= 4) { - return LIFEBAR_SRC_STAGE2_X; - } - else if (value >= 3) { - return LIFEBAR_SRC_STAGE3_X; - } - else if (value >= 2) { - return LIFEBAR_SRC_STAGE4_X; - } - else { - return LIFEBAR_SRC_STAGE5_X; - } } - @Override - protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) { - // TODO Auto-generated method stub - super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); - } + private void drawDeathRateIcon(TileEntityMagicApiary apiary) { + if (apiary.isDeathRateBoosted()) { + this.drawTexturedModalRect( + this.guiLeft + DEATHBOOST_DEST_X, + this.guiTop + DEATHBOOST_DEST_Y, + DEATHBOOST_SRC_X, + DEATHBOOST_SRC_Y, + DEATHBOOST_WIDTH, + DEATHBOOST_HEIGHT); + } + } + + private void drawWorkBoostIcon(TileEntityMagicApiary apiary) { + if (apiary.isProductionBoosted()) { + this.drawTexturedModalRect( + this.guiLeft + WORKBOOST_DEST_X, + this.guiTop + WORKBOOST_DEST_Y, + WORKBOOST_SRC_X, + WORKBOOST_SRC_Y, + WORKBOOST_WIDTH, + WORKBOOST_HEIGHT); + } + } + + private void drawLifebar(TileEntityMagicApiary apiary) { + int value = LIFEBAR_HEIGHT - apiary.getHealthScaled(LIFEBAR_HEIGHT); + int lifebarSrc = getLifebarSrc(apiary); + this.drawTexturedModalRect( + this.guiLeft + LIFEBAR_DEST_X, + this.guiTop + value + LIFEBAR_DEST_Y, + lifebarSrc, + LIFEBAR_SRC_Y, + LIFEBAR_WIDTH, + LIFEBAR_HEIGHT - value); + } + + private int getLifebarSrc(TileEntityMagicApiary apiary) { + int value = apiary.getHealthScaled(5); + if (value >= 5) { + return LIFEBAR_SRC_STAGE1_X; + } else if (value >= 4) { + return LIFEBAR_SRC_STAGE2_X; + } else if (value >= 3) { + return LIFEBAR_SRC_STAGE3_X; + } else if (value >= 2) { + return LIFEBAR_SRC_STAGE4_X; + } else { + return LIFEBAR_SRC_STAGE5_X; + } + } + + @Override + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) { + // TODO Auto-generated method stub + super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); + } } diff --git a/src/main/java/magicbees/client/gui/ModGuiConfig.java b/src/main/java/magicbees/client/gui/ModGuiConfig.java index 62d8008..eb148be 100644 --- a/src/main/java/magicbees/client/gui/ModGuiConfig.java +++ b/src/main/java/magicbees/client/gui/ModGuiConfig.java @@ -1,38 +1,39 @@ package magicbees.client.gui; +import cpw.mods.fml.client.config.DummyConfigElement; +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; import java.util.ArrayList; import java.util.List; - import magicbees.main.Config; import magicbees.main.utils.VersionInfo; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.common.config.ConfigElement; -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.client.config.DummyConfigElement; -import cpw.mods.fml.client.config.GuiConfig; -import cpw.mods.fml.client.config.IConfigElement; -public class ModGuiConfig extends GuiConfig -{ - public ModGuiConfig(GuiScreen guiScreen) - { - super(guiScreen, configElements(), VersionInfo.ModName, false, false, - GuiConfig.getAbridgedConfigPath(Config.configuration.toString())); - } - - private static List configElements() { - List list = new ArrayList(); +public class ModGuiConfig extends GuiConfig { + public ModGuiConfig(GuiScreen guiScreen) { + super( + guiScreen, + configElements(), + VersionInfo.ModName, + false, + false, + GuiConfig.getAbridgedConfigPath(Config.configuration.toString())); + } - list.add(categoryElement(Config.CATEGORY_GENERAL, "General", "magicbees.config.category.general")); - list.add(categoryElement(Config.CATEGORY_DEBUG, "Debug", "magicbees.config.category.debug")); - list.add(categoryElement(Config.CATEGORY_MODULES, "Modules", "magicbees.config.category.modules")); - list.add(categoryElement(Config.CATEGORY_BOTANIA, "Botania Plugin", "magicbees.config.category.botania")); - - return list; - } - - private static IConfigElement categoryElement(String category, String name, String tooltip_key) { - return new DummyConfigElement.DummyCategoryElement(name, tooltip_key, - new ConfigElement(Config.configuration.getCategory(category)).getChildElements()); - } + private static List configElements() { + List list = new ArrayList(); + + list.add(categoryElement(Config.CATEGORY_GENERAL, "General", "magicbees.config.category.general")); + list.add(categoryElement(Config.CATEGORY_DEBUG, "Debug", "magicbees.config.category.debug")); + list.add(categoryElement(Config.CATEGORY_MODULES, "Modules", "magicbees.config.category.modules")); + list.add(categoryElement(Config.CATEGORY_BOTANIA, "Botania Plugin", "magicbees.config.category.botania")); + + return list; + } + + private static IConfigElement categoryElement(String category, String name, String tooltip_key) { + return new DummyConfigElement.DummyCategoryElement( + name, tooltip_key, new ConfigElement(Config.configuration.getCategory(category)).getChildElements()); + } } diff --git a/src/main/java/magicbees/client/gui/SlotCustomItems.java b/src/main/java/magicbees/client/gui/SlotCustomItems.java index 99c2bfd..adeb4f2 100644 --- a/src/main/java/magicbees/client/gui/SlotCustomItems.java +++ b/src/main/java/magicbees/client/gui/SlotCustomItems.java @@ -3,7 +3,6 @@ package magicbees.client.gui; import java.util.ArrayList; import java.util.Collections; import java.util.List; - import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -12,90 +11,70 @@ import net.minecraftforge.oredict.OreDictionary; /** * @author MysteriousAges */ -public class SlotCustomItems extends Slot -{ - private List items; +public class SlotCustomItems extends Slot { + private List items; - public SlotCustomItems(IInventory inventory, int slotIndex, int xPos, int yPos, ItemStack... items) - { - super(inventory, slotIndex, xPos, yPos); - this.items = new ArrayList(items.length); + public SlotCustomItems(IInventory inventory, int slotIndex, int xPos, int yPos, ItemStack... items) { + super(inventory, slotIndex, xPos, yPos); + this.items = new ArrayList(items.length); - Collections.addAll(this.items, items); - } - - /** - * @return List of valid ItemStacks - */ - public List getValidItems() - { - return this.items; - } - - public void addValidItem(ItemStack newItem) - { - boolean contains = false; - for (int i = 0; i < this.items.size(); ++i) - { - ItemStack s = this.items.get(i); - if (s.getItem() == newItem.getItem()) - { - if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE) - { - contains = true; - break; - } - else if (s.getItemDamage() == newItem.getItemDamage()) - { - contains = true; - break; - } - } - } - if (!contains) - { - this.items.add(newItem); - } - } - - /** - * @param removeItem ItemStack to remove. - */ - public void removeValidItem(ItemStack removeItem) - { - for (int i = 0; i < this.items.size(); ++i) - { - ItemStack s = this.items.get(i); - if (s.getItem() == removeItem.getItem()) - { - if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE) - { - this.items.remove(i); - break; - } - else if (s.getItemDamage() == removeItem.getItemDamage()) - { - this.items.remove(i); - break; - } - } - } - } + Collections.addAll(this.items, items); + } - @Override - public boolean isItemValid(ItemStack itemStack) - { - for (ItemStack item : this.items) - { - if (item != null && item.getItem() == itemStack.getItem()) - { - if (item.getItemDamage() == itemStack.getItemDamage() || item.getItemDamage() == OreDictionary.WILDCARD_VALUE) - { - return true; - } - } - } - return false; - } + /** + * @return List of valid ItemStacks + */ + public List getValidItems() { + return this.items; + } + public void addValidItem(ItemStack newItem) { + boolean contains = false; + for (int i = 0; i < this.items.size(); ++i) { + ItemStack s = this.items.get(i); + if (s.getItem() == newItem.getItem()) { + if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE) { + contains = true; + break; + } else if (s.getItemDamage() == newItem.getItemDamage()) { + contains = true; + break; + } + } + } + if (!contains) { + this.items.add(newItem); + } + } + + /** + * @param removeItem ItemStack to remove. + */ + public void removeValidItem(ItemStack removeItem) { + for (int i = 0; i < this.items.size(); ++i) { + ItemStack s = this.items.get(i); + if (s.getItem() == removeItem.getItem()) { + if (s.getItemDamage() == OreDictionary.WILDCARD_VALUE) { + this.items.remove(i); + break; + } else if (s.getItemDamage() == removeItem.getItemDamage()) { + this.items.remove(i); + break; + } + } + } + } + + @Override + public boolean isItemValid(ItemStack itemStack) { + for (ItemStack item : this.items) { + if (item != null && item.getItem() == itemStack.getItem()) { + if (item.getItemDamage() == itemStack.getItemDamage() + || item.getItemDamage() == OreDictionary.WILDCARD_VALUE) { + return true; + } + } + } + return false; + } } diff --git a/src/main/java/magicbees/client/gui/SlotFrame.java b/src/main/java/magicbees/client/gui/SlotFrame.java index 53ad099..79c899d 100644 --- a/src/main/java/magicbees/client/gui/SlotFrame.java +++ b/src/main/java/magicbees/client/gui/SlotFrame.java @@ -10,17 +10,17 @@ public class SlotFrame extends SlotCustomItems { } @Override - public boolean isItemValid(ItemStack itemStack){ - if (itemStack == null){ + public boolean isItemValid(ItemStack itemStack) { + if (itemStack == null) { return false; } - if (!inventory.isItemValidForSlot(getSlotIndex(), itemStack)){ + if (!inventory.isItemValidForSlot(getSlotIndex(), itemStack)) { return false; } boolean flag = false; - if(itemStack.getItem() instanceof IHiveFrame){ + if (itemStack.getItem() instanceof IHiveFrame) { flag = true; } diff --git a/src/main/java/magicbees/client/gui/UIScreens.java b/src/main/java/magicbees/client/gui/UIScreens.java index 02b1184..16fcbc6 100644 --- a/src/main/java/magicbees/client/gui/UIScreens.java +++ b/src/main/java/magicbees/client/gui/UIScreens.java @@ -1,7 +1,7 @@ package magicbees.client.gui; -public enum UIScreens -{ - EFFECT_JAR, - THAUMIC_APIARY,; +public enum UIScreens { + EFFECT_JAR, + THAUMIC_APIARY, + ; } diff --git a/src/main/java/magicbees/client/model/ModelEffectJar.java b/src/main/java/magicbees/client/model/ModelEffectJar.java index 0db2696..bfb186c 100644 --- a/src/main/java/magicbees/client/model/ModelEffectJar.java +++ b/src/main/java/magicbees/client/model/ModelEffectJar.java @@ -9,31 +9,29 @@ import net.minecraftforge.client.model.IModelCustom; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) -public class ModelEffectJar -{ - public static final ResourceLocation objFile = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "effectJar.obj"); - public static final ResourceLocation textureLocation = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "jarTexture.png"); - - public static final ModelEffectJar model = new ModelEffectJar(); - - private IModelCustom effectJarObj; - - public ModelEffectJar() - { - this.effectJarObj = AdvancedModelLoader.loadModel(objFile); - } - - public void render() - { - this.effectJarObj.renderPart("jarLid"); - - GL11.glPushAttrib(GL11.GL_ENABLE_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - this.effectJarObj.renderPart("jarBase"); - GL11.glPopAttrib(); - - } +public class ModelEffectJar { + public static final ResourceLocation objFile = + new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "effectJar.obj"); + public static final ResourceLocation textureLocation = + new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "jarTexture.png"); + + public static final ModelEffectJar model = new ModelEffectJar(); + + private IModelCustom effectJarObj; + + public ModelEffectJar() { + this.effectJarObj = AdvancedModelLoader.loadModel(objFile); + } + + public void render() { + this.effectJarObj.renderPart("jarLid"); + + GL11.glPushAttrib(GL11.GL_ENABLE_BIT); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.effectJarObj.renderPart("jarBase"); + GL11.glPopAttrib(); + } } diff --git a/src/main/java/magicbees/client/model/ModelVisAuraProvider.java b/src/main/java/magicbees/client/model/ModelVisAuraProvider.java index a64a0f7..8597127 100644 --- a/src/main/java/magicbees/client/model/ModelVisAuraProvider.java +++ b/src/main/java/magicbees/client/model/ModelVisAuraProvider.java @@ -1,40 +1,42 @@ package magicbees.client.model; -import org.lwjgl.opengl.GL11; - +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.main.CommonProxy; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; +import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class ModelVisAuraProvider { - public static final ResourceLocation objFile = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "visAuraConverter.obj"); - public static final ResourceLocation textureLocation = new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "visAuraProvider.png"); - - public static final ModelVisAuraProvider model = new ModelVisAuraProvider(); - - private IModelCustom visAuraProviderObj; - - public ModelVisAuraProvider() { - this.visAuraProviderObj = AdvancedModelLoader.loadModel(objFile); - } + public static final ResourceLocation objFile = + new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "visAuraConverter.obj"); + public static final ResourceLocation textureLocation = + new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.MODEL + "visAuraProvider.png"); - public void render(long tick) { - GL11.glPushMatrix(); - GL11.glRotated(Math.sin(tick * Math.PI * 2 / 80) * 0.7, 0, 1, 0); - GL11.glRotated(Math.sin((tick + 25) * Math.PI * 2 / 150) * 0.75, 0.5, 0, 0.5); - GL11.glTranslated(Math.sin(tick * Math.PI * 2 / 1000) * 0.025, 0, Math.sin((tick + 30) * Math.PI * 2 / 650) * 0.03); - float red = (float)(Math.sin(tick * Math.PI * 2 / 130) * 0.2 + 0.8); - float green = (float)(Math.cos((tick + 2) * Math.PI * 2 / 140) * 0.2 + 0.8); - float blue = (float)(Math.sin((tick + 5) * Math.PI * 2 / 99) * 0.2 + 0.8); - GL11.glColor3f(red, green, blue); - this.visAuraProviderObj.renderPart("centre"); - GL11.glPopMatrix(); - - GL11.glColor3f(1f, 1f, 1f); - this.visAuraProviderObj.renderPart("frame"); - } + public static final ModelVisAuraProvider model = new ModelVisAuraProvider(); + + private IModelCustom visAuraProviderObj; + + public ModelVisAuraProvider() { + this.visAuraProviderObj = AdvancedModelLoader.loadModel(objFile); + } + + public void render(long tick) { + GL11.glPushMatrix(); + GL11.glRotated(Math.sin(tick * Math.PI * 2 / 80) * 0.7, 0, 1, 0); + GL11.glRotated(Math.sin((tick + 25) * Math.PI * 2 / 150) * 0.75, 0.5, 0, 0.5); + GL11.glTranslated( + Math.sin(tick * Math.PI * 2 / 1000) * 0.025, 0, Math.sin((tick + 30) * Math.PI * 2 / 650) * 0.03); + float red = (float) (Math.sin(tick * Math.PI * 2 / 130) * 0.2 + 0.8); + float green = (float) (Math.cos((tick + 2) * Math.PI * 2 / 140) * 0.2 + 0.8); + float blue = (float) (Math.sin((tick + 5) * Math.PI * 2 / 99) * 0.2 + 0.8); + GL11.glColor3f(red, green, blue); + this.visAuraProviderObj.renderPart("centre"); + GL11.glPopMatrix(); + + GL11.glColor3f(1f, 1f, 1f); + this.visAuraProviderObj.renderPart("frame"); + } } diff --git a/src/main/java/magicbees/client/render/RendererEffectJar.java b/src/main/java/magicbees/client/render/RendererEffectJar.java index c28b24f..abd1d8f 100644 --- a/src/main/java/magicbees/client/render/RendererEffectJar.java +++ b/src/main/java/magicbees/client/render/RendererEffectJar.java @@ -9,69 +9,60 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; -public class RendererEffectJar extends TileEntitySpecialRenderer implements IItemRenderer -{ - public static RendererEffectJar instance = new RendererEffectJar(); +public class RendererEffectJar extends TileEntitySpecialRenderer implements IItemRenderer { + public static RendererEffectJar instance = new RendererEffectJar(); - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) - { - if (tileEntity instanceof TileEntityEffectJar) - { - this.doRender(x, y, z, 1f); - } - } + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { + if (tileEntity instanceof TileEntityEffectJar) { + this.doRender(x, y, z, 1f); + } + } - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - return true; - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return true; + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) - { - switch (type) - { - default: - case ENTITY: - doRender(0, 0, 0, 1.8f); - break; - - case EQUIPPED: - doRender(0, 0, 0, 1.5f); - break; - - case EQUIPPED_FIRST_PERSON: - doRender(-.5, .5, 0.25, 1f); - break; - - case INVENTORY: - doRender(0.3, 0.25, 0.3, 1.5f); - break; - } - } - - private void doRender(double x, double y, double z, float scale) - { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - - GL11.glScaled(scale, scale, scale); - GL11.glTranslated(x, y, z); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelEffectJar.textureLocation); - - ModelEffectJar.model.render(); - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + switch (type) { + default: + case ENTITY: + doRender(0, 0, 0, 1.8f); + break; + case EQUIPPED: + doRender(0, 0, 0, 1.5f); + break; + + case EQUIPPED_FIRST_PERSON: + doRender(-.5, .5, 0.25, 1f); + break; + + case INVENTORY: + doRender(0.3, 0.25, 0.3, 1.5f); + break; + } + } + + private void doRender(double x, double y, double z, float scale) { + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_LIGHTING); + + GL11.glScaled(scale, scale, scale); + GL11.glTranslated(x, y, z); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelEffectJar.textureLocation); + + ModelEffectJar.model.render(); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } } diff --git a/src/main/java/magicbees/client/render/RendererVisAuraProvider.java b/src/main/java/magicbees/client/render/RendererVisAuraProvider.java index 75353e6..57d7826 100644 --- a/src/main/java/magicbees/client/render/RendererVisAuraProvider.java +++ b/src/main/java/magicbees/client/render/RendererVisAuraProvider.java @@ -1,50 +1,47 @@ package magicbees.client.render; +import cpw.mods.fml.client.FMLClientHandler; import magicbees.client.model.ModelVisAuraProvider; import magicbees.tileentity.TileEntityVisAuraProvider; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.client.IItemRenderer; - import org.lwjgl.opengl.GL11; -import cpw.mods.fml.client.FMLClientHandler; - public class RendererVisAuraProvider extends TileEntitySpecialRenderer implements IItemRenderer { - public static RendererVisAuraProvider instance = new RendererVisAuraProvider(); + public static RendererVisAuraProvider instance = new RendererVisAuraProvider(); - @Override - public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float tick) { - if (entity instanceof TileEntityVisAuraProvider) { - this.doRender(x, y, z, 1f, entity.getWorldObj().getTotalWorldTime()); - } - } + @Override + public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float tick) { + if (entity instanceof TileEntityVisAuraProvider) { + this.doRender(x, y, z, 1f, entity.getWorldObj().getTotalWorldTime()); + } + } - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return true; - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return true; + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { - doRender(0, 0, 0, 1f, 0); - } - - private void doRender(double x, double y, double z, float scale, long tick) { - GL11.glPushMatrix(); - GL11.glScaled(scale, scale, scale); - GL11.glTranslated(x, y, z); - - FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelVisAuraProvider.textureLocation); - ModelVisAuraProvider.model.render(tick); - - GL11.glPopMatrix(); - } + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + doRender(0, 0, 0, 1f, 0); + } + private void doRender(double x, double y, double z, float scale, long tick) { + GL11.glPushMatrix(); + GL11.glScaled(scale, scale, scale); + GL11.glTranslated(x, y, z); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(ModelVisAuraProvider.textureLocation); + ModelVisAuraProvider.model.render(tick); + + GL11.glPopMatrix(); + } } diff --git a/src/main/java/magicbees/item/ItemCapsule.java b/src/main/java/magicbees/item/ItemCapsule.java index eb8a44a..d471ac7 100644 --- a/src/main/java/magicbees/item/ItemCapsule.java +++ b/src/main/java/magicbees/item/ItemCapsule.java @@ -1,7 +1,9 @@ package magicbees.item; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import java.util.List; - import magicbees.item.types.CapsuleType; import magicbees.item.types.FluidType; import magicbees.main.CommonProxy; @@ -11,91 +13,75 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -public class ItemCapsule extends Item -{ - private CapsuleType capsuleType; - - public ItemCapsule(CapsuleType type, int maxStackSize) - { - super(); - this.capsuleType = type; - this.setCreativeTab(TabMagicBees.tabMagicBees); - this.setHasSubtypes(true); - this.setMaxStackSize(maxStackSize); - this.setUnlocalizedName("capsule." + type.toString().toLowerCase()); - GameRegistry.registerItem(this, "capsule." + type.toString().toLowerCase()); - } - - public CapsuleType getType() - { - return this.capsuleType; - } +public class ItemCapsule extends Item { + private CapsuleType capsuleType; - @Override - public String getItemStackDisplayName(ItemStack itemStack) - { - return String.format(this.capsuleType.getLocalizedName(), FluidType.values()[itemStack.getItemDamage()].getDisplayName()); - } + public ItemCapsule(CapsuleType type, int maxStackSize) { + super(); + this.capsuleType = type; + this.setCreativeTab(TabMagicBees.tabMagicBees); + this.setHasSubtypes(true); + this.setMaxStackSize(maxStackSize); + this.setUnlocalizedName("capsule." + type.toString().toLowerCase()); + GameRegistry.registerItem(this, "capsule." + type.toString().toLowerCase()); + } - public ItemStack getCapsuleForLiquid(FluidType l) - { - return new ItemStack(this, 1, l.ordinal()); - } + public CapsuleType getType() { + return this.capsuleType; + } - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tab, List itemList) - { - for (FluidType l : FluidType.values()) - { - if (l.available) - { - itemList.add(new ItemStack(this, 1, l.ordinal())); - } - } - } + @Override + public String getItemStackDisplayName(ItemStack itemStack) { + return String.format( + this.capsuleType.getLocalizedName(), FluidType.values()[itemStack.getItemDamage()].getDisplayName()); + } - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":capsule" + this.capsuleType.getName().substring(0, 1).toUpperCase() - + this.capsuleType.getName().substring(1)); - for (FluidType t : FluidType.values()) - { - if (t != FluidType.EMPTY) - { - t.liquidIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID); - } - } - } + public ItemStack getCapsuleForLiquid(FluidType l) { + return new ItemStack(this, 1, l.ordinal()); + } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamageForRenderPass(int metadata, int pass) - { - IIcon i = this.itemIcon; - if (metadata != 0 && pass == 0) - { - i = FluidType.values()[metadata % FluidType.values().length].liquidIcon; - } - return i; - } + @SuppressWarnings({"unchecked", "rawtypes"}) + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tab, List itemList) { + for (FluidType l : FluidType.values()) { + if (l.available) { + itemList.add(new ItemStack(this, 1, l.ordinal())); + } + } + } - @Override - public int getRenderPasses(int metadata) - { - return (metadata == 0) ? 1 : 2; - } + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":capsule" + + this.capsuleType.getName().substring(0, 1).toUpperCase() + + this.capsuleType.getName().substring(1)); + for (FluidType t : FluidType.values()) { + if (t != FluidType.EMPTY) { + t.liquidIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":liquids/" + t.liquidID); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int metadata, int pass) { + IIcon i = this.itemIcon; + if (metadata != 0 && pass == 0) { + i = FluidType.values()[metadata % FluidType.values().length].liquidIcon; + } + return i; + } + + @Override + public int getRenderPasses(int metadata) { + return (metadata == 0) ? 1 : 2; + } } diff --git a/src/main/java/magicbees/item/ItemComb.java b/src/main/java/magicbees/item/ItemComb.java index b7ac9ec..d8d6f6d 100644 --- a/src/main/java/magicbees/item/ItemComb.java +++ b/src/main/java/magicbees/item/ItemComb.java @@ -1,7 +1,10 @@ package magicbees.item; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; import java.util.List; - import magicbees.item.types.CombType; import magicbees.main.Config; import magicbees.main.utils.compat.ForestryHelper; @@ -10,103 +13,83 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.Tabs; -public class ItemComb extends Item -{ - public ItemComb() - { - super(); - this.setCreativeTab(Tabs.tabApiculture); - this.setHasSubtypes(true); - this.setUnlocalizedName("comb"); - GameRegistry.registerItem(this, "comb"); - } - - public ItemStack getStackForType(CombType type) - { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(CombType type, int count) - { - return new ItemStack(this, count, type.ordinal()); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tabs, List list) - { - for (CombType type : CombType.values()) - { - if (type.showInList || Config.forestryDebugEnabled) - { - list.add(this.getStackForType(type)); - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } +public class ItemComb extends Item { + public ItemComb() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("comb"); + GameRegistry.registerItem(this, "comb"); + } - @Override - public int getRenderPasses(int meta) - { - return 2; - } - - @SideOnly(Side.CLIENT) - private IIcon secondIcon; - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.0"); - this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.1"); - } + public ItemStack getStackForType(CombType type) { + return new ItemStack(this, 1, type.ordinal()); + } - @Override - public IIcon getIcon(ItemStack stack, int pass) - { - return (pass == 0) ? itemIcon : secondIcon; - } + public ItemStack getStackForType(CombType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) - { - int meta = Math.max(0, Math.min(CombType.values().length - 1, stack.getItemDamage())); - int colour = CombType.values()[meta].getColours()[0]; - - if (pass >= 1) - { - colour = CombType.values()[meta].getColours()[1]; - } - - return colour; - } + @SuppressWarnings({"unchecked", "rawtypes"}) + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (CombType type : CombType.values()) { + if (type.showInList || Config.forestryDebugEnabled) { + list.add(this.getStackForType(type)); + } + } + } - @Override - public String getItemStackDisplayName(ItemStack stack) - { - return CombType.values()[stack.getItemDamage()].getName(); - } + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } - @Override - public int getDamage(ItemStack stack) { - if (CombType.values().length < super.getDamage(stack)) { - stack.setItemDamage(0); - } - return super.getDamage(stack); - } + @Override + public int getRenderPasses(int meta) { + return 2; + } - + @SideOnly(Side.CLIENT) + private IIcon secondIcon; + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.0"); + this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":beeCombs.1"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return (pass == 0) ? itemIcon : secondIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(CombType.values().length - 1, stack.getItemDamage())); + int colour = CombType.values()[meta].getColours()[0]; + + if (pass >= 1) { + colour = CombType.values()[meta].getColours()[1]; + } + + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return CombType.values()[stack.getItemDamage()].getName(); + } + + @Override + public int getDamage(ItemStack stack) { + if (CombType.values().length < super.getDamage(stack)) { + stack.setItemDamage(0); + } + return super.getDamage(stack); + } } diff --git a/src/main/java/magicbees/item/ItemDrop.java b/src/main/java/magicbees/item/ItemDrop.java index b0683bb..b82bfe1 100644 --- a/src/main/java/magicbees/item/ItemDrop.java +++ b/src/main/java/magicbees/item/ItemDrop.java @@ -1,10 +1,10 @@ package magicbees.item; -import java.util.List; - import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import java.util.List; import magicbees.item.types.DropType; import magicbees.main.utils.compat.ForestryHelper; import net.minecraft.client.renderer.texture.IIconRegister; @@ -12,88 +12,73 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import forestry.api.core.Tabs; -public class ItemDrop extends Item -{ - public ItemDrop() - { - super(); - this.setCreativeTab(Tabs.tabApiculture); - this.setHasSubtypes(true); - this.setUnlocalizedName("drop"); - GameRegistry.registerItem(this, "drop"); - } - - public ItemStack getStackForType(DropType type) - { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(DropType type, int count) - { - return new ItemStack(this, count, type.ordinal()); - } - - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubItems(Item item, CreativeTabs tabs, List list) - { - for (DropType type : DropType.values()) - { - list.add(this.getStackForType(type)); - } - } - - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } +public class ItemDrop extends Item { + public ItemDrop() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("drop"); + GameRegistry.registerItem(this, "drop"); + } - @Override - public int getRenderPasses(int metadata) - { - return 2; - } - - @SideOnly(Side.CLIENT) - private IIcon secondIcon; - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.0"); - this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.1"); - } + public ItemStack getStackForType(DropType type) { + return new ItemStack(this, 1, type.ordinal()); + } - @Override - public IIcon getIcon(ItemStack stack, int pass) - { - return (pass == 0) ? this.itemIcon : this.secondIcon; - } + public ItemStack getStackForType(DropType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) - { - int meta = Math.max(0, Math.min(DropType.values().length - 1, stack.getItemDamage())); - int colour = DropType.values()[meta].combColour[0]; - - if (pass >= 1) - { - colour = DropType.values()[meta].combColour[1]; - } - - return colour; - } + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (DropType type : DropType.values()) { + list.add(this.getStackForType(type)); + } + } - @Override - public String getItemStackDisplayName(ItemStack stack) - { - return DropType.values()[stack.getItemDamage()].getName(); - } + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + @Override + public int getRenderPasses(int metadata) { + return 2; + } + + @SideOnly(Side.CLIENT) + private IIcon secondIcon; + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.0"); + this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":honeyDrop.1"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return (pass == 0) ? this.itemIcon : this.secondIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(DropType.values().length - 1, stack.getItemDamage())); + int colour = DropType.values()[meta].combColour[0]; + + if (pass >= 1) { + colour = DropType.values()[meta].combColour[1]; + } + + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return DropType.values()[stack.getItemDamage()].getName(); + } } diff --git a/src/main/java/magicbees/item/ItemGrafter.java b/src/main/java/magicbees/item/ItemGrafter.java index f47c218..aacdcbf 100644 --- a/src/main/java/magicbees/item/ItemGrafter.java +++ b/src/main/java/magicbees/item/ItemGrafter.java @@ -1,5 +1,6 @@ package magicbees.item; +import forestry.api.arboriculture.IToolGrafter; import magicbees.main.Config; import magicbees.main.utils.compat.ThaumcraftHelper; import net.minecraft.block.Block; @@ -9,53 +10,49 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import forestry.api.arboriculture.IToolGrafter; public class ItemGrafter extends Item implements IToolGrafter { - public ItemGrafter() { - super(); - this.setMaxStackSize(1); - this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture); - this.setHarvestLevel("grafter", 3); - } + public ItemGrafter() { + super(); + this.setMaxStackSize(1); + this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture); + this.setHarvestLevel("grafter", 3); + } - @Override - public float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z) { - return 100f; - } + @Override + public float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z) { + return 100f; + } - @Override - public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) { - int damage = 1; - if (ThaumcraftHelper.isActive()) { - if (block == ThaumcraftHelper.leaf) - { - int meta = world.getBlockMetadata(x, y, z) & 1; - if (meta == 0 || meta == 1) - { - double chance = Math.random(); - if (chance <= Config.thaumcraftSaplingDroprate) - { - this.dropItem(world, x, y, z, new ItemStack(ThaumcraftHelper.plant, 1, meta)); - } - } - } - } - itemstack.damageItem(damage, entityLiving); - return true; - } + @Override + public boolean onBlockDestroyed( + ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) { + int damage = 1; + if (ThaumcraftHelper.isActive()) { + if (block == ThaumcraftHelper.leaf) { + int meta = world.getBlockMetadata(x, y, z) & 1; + if (meta == 0 || meta == 1) { + double chance = Math.random(); + if (chance <= Config.thaumcraftSaplingDroprate) { + this.dropItem(world, x, y, z, new ItemStack(ThaumcraftHelper.plant, 1, meta)); + } + } + } + } + itemstack.damageItem(damage, entityLiving); + return true; + } - protected void dropItem(World world, int x, int y, int z, ItemStack item) { - if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops")) { - float f = 0.7F; - double d0 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; - double d1 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; - double d2 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; - EntityItem entityitem = new EntityItem(world, (double)x + d0, (double)y + d1, (double)z + d2, item); - entityitem.delayBeforeCanPickup = 10; - world.spawnEntityInWorld(entityitem); - } - } - -} \ No newline at end of file + protected void dropItem(World world, int x, int y, int z, ItemStack item) { + if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops")) { + float f = 0.7F; + double d0 = (double) (world.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + double d1 = (double) (world.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + double d2 = (double) (world.rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + EntityItem entityitem = new EntityItem(world, (double) x + d0, (double) y + d1, (double) z + d2, item); + entityitem.delayBeforeCanPickup = 10; + world.spawnEntityInWorld(entityitem); + } + } +} diff --git a/src/main/java/magicbees/item/ItemMagicHive.java b/src/main/java/magicbees/item/ItemMagicHive.java index f6b0e33..b2c0710 100644 --- a/src/main/java/magicbees/item/ItemMagicHive.java +++ b/src/main/java/magicbees/item/ItemMagicHive.java @@ -1,43 +1,41 @@ package magicbees.item; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.block.types.HiveType; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; /** * Created by Allen on 7/29/2014. */ -public class ItemMagicHive extends ItemBlock -{ - public ItemMagicHive(Block block) - { - super(block); - setMaxDamage(0); - setHasSubtypes(true); - } +public class ItemMagicHive extends ItemBlock { + public ItemMagicHive(Block block) { + super(block); + setMaxDamage(0); + setHasSubtypes(true); + } - @Override - public int getMetadata(int i) { - return i; - } + @Override + public int getMetadata(int i) { + return i; + } - protected Block getBlock() { - return field_150939_a; - } + protected Block getBlock() { + return field_150939_a; + } - @SideOnly(Side.CLIENT) - @Override - public IIcon getIconFromDamage(int meta) { - return this.getBlock().getIcon(1, meta); - } + @SideOnly(Side.CLIENT) + @Override + public IIcon getIconFromDamage(int meta) { + return this.getBlock().getIcon(1, meta); + } - @Override - public String getUnlocalizedName(ItemStack itemstack) - { - return getBlock().getUnlocalizedName() + "." + HiveType.getHiveFromMeta(itemstack.getItemDamage()).name().toLowerCase(); - } -} \ No newline at end of file + @Override + public String getUnlocalizedName(ItemStack itemstack) { + return getBlock().getUnlocalizedName() + "." + + HiveType.getHiveFromMeta(itemstack.getItemDamage()).name().toLowerCase(); + } +} diff --git a/src/main/java/magicbees/item/ItemMagicHiveFrame.java b/src/main/java/magicbees/item/ItemMagicHiveFrame.java index 3cb7ce7..48e17b0 100644 --- a/src/main/java/magicbees/item/ItemMagicHiveFrame.java +++ b/src/main/java/magicbees/item/ItemMagicHiveFrame.java @@ -3,6 +3,10 @@ package magicbees.item; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.apiculture.IBee; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.apiculture.IBeeModifier; +import forestry.api.apiculture.IHiveFrame; import magicbees.item.types.HiveFrameType; import magicbees.main.CommonProxy; import magicbees.main.utils.TabMagicBees; @@ -10,55 +14,45 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.apiculture.IHiveFrame; +public class ItemMagicHiveFrame extends Item implements IHiveFrame { + private HiveFrameType type; -public class ItemMagicHiveFrame extends Item implements IHiveFrame -{ - private HiveFrameType type; + public ItemMagicHiveFrame(HiveFrameType frameType) { + super(); + this.type = frameType; + this.setMaxDamage(this.type.maxDamage); + this.setMaxStackSize(1); + this.setCreativeTab(TabMagicBees.tabMagicBees); + this.setUnlocalizedName("frame" + frameType.getName()); + GameRegistry.registerItem(this, "frame" + frameType.getName()); + } - public ItemMagicHiveFrame(HiveFrameType frameType) - { - super(); - this.type = frameType; - this.setMaxDamage(this.type.maxDamage); - this.setMaxStackSize(1); - this.setCreativeTab(TabMagicBees.tabMagicBees); - this.setUnlocalizedName("frame" + frameType.getName()); - GameRegistry.registerItem(this, "frame" + frameType.getName()); - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":frame" + type.getName()); - } - - // --------- IHiveFrame functions ----------------------------------------- - - @Override - public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) { - frame.setItemDamage(frame.getItemDamage() + wear); + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":frame" + type.getName()); + } - if (frame.getItemDamage() >= frame.getMaxDamage()) { - // Break the frame. - frame = null; - } + // --------- IHiveFrame functions ----------------------------------------- - return frame; - } + @Override + public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) { + frame.setItemDamage(frame.getItemDamage() + wear); - @Override - public IBeeModifier getBeeModifier() { - return type; - } - - @Override - public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) - { - return false; - } + if (frame.getItemDamage() >= frame.getMaxDamage()) { + // Break the frame. + frame = null; + } + return frame; + } + + @Override + public IBeeModifier getBeeModifier() { + return type; + } + + @Override + public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { + return false; + } } diff --git a/src/main/java/magicbees/item/ItemManasteelGrafter.java b/src/main/java/magicbees/item/ItemManasteelGrafter.java index b50cd96..765d00e 100644 --- a/src/main/java/magicbees/item/ItemManasteelGrafter.java +++ b/src/main/java/magicbees/item/ItemManasteelGrafter.java @@ -1,5 +1,8 @@ package magicbees.item; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.main.CommonProxy; import magicbees.main.utils.compat.BotaniaHelper; import net.minecraft.client.renderer.texture.IIconRegister; @@ -8,48 +11,47 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import vazkii.botania.api.mana.IManaUsingItem; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; @Optional.InterfaceList({ - @Optional.Interface(iface = "vazkii.botania.api.mana.IManaUsingItem", modid = BotaniaHelper.Name, striprefs = true) + @Optional.Interface(iface = "vazkii.botania.api.mana.IManaUsingItem", modid = BotaniaHelper.Name, striprefs = true) }) public class ItemManasteelGrafter extends ItemGrafter implements IManaUsingItem { - public static final int MANA_PER_DAMAGE = 90; - - public ItemManasteelGrafter() { - super(); - this.setMaxDamage(15); - this.setUnlocalizedName("manasteelGrafter"); - } + public static final int MANA_PER_DAMAGE = 90; - @Override - @Optional.Method(modid = BotaniaHelper.Name) - public boolean getIsRepairable(ItemStack toolStack, ItemStack material) { - return (material.getItem() == BotaniaHelper.itemManaResource && material.getItemDamage() == BotaniaHelper.ManaResource.MANASTEEL.ordinal()) || super.getIsRepairable(toolStack, material); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manasteelGrafter"); - } + public ItemManasteelGrafter() { + super(); + this.setMaxDamage(15); + this.setUnlocalizedName("manasteelGrafter"); + } - @Override - public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) { - // Unsure if the server-side exclusion is necessary, but boy it looks disconcerting on the client if it's in. - if (/*!world.isRemote && */stack.getItemDamage() > 0 && player instanceof EntityPlayer) { - if (BotaniaHelper.requestMana(stack, (EntityPlayer)player, MANA_PER_DAMAGE, 1)) { - stack.setItemDamage(stack.getItemDamage() - 1); - } - } - } + @Override + @Optional.Method(modid = BotaniaHelper.Name) + public boolean getIsRepairable(ItemStack toolStack, ItemStack material) { + return (material.getItem() == BotaniaHelper.itemManaResource + && material.getItemDamage() == BotaniaHelper.ManaResource.MANASTEEL.ordinal()) + || super.getIsRepairable(toolStack, material); + } - @Override - public boolean usesMana(ItemStack arg0) { - return true; - } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manasteelGrafter"); + } + @Override + public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) { + // Unsure if the server-side exclusion is necessary, but boy it looks disconcerting on the client if it's in. + if ( + /*!world.isRemote && */ stack.getItemDamage() > 0 && player instanceof EntityPlayer) { + if (BotaniaHelper.requestMana(stack, (EntityPlayer) player, MANA_PER_DAMAGE, 1)) { + stack.setItemDamage(stack.getItemDamage() - 1); + } + } + } + + @Override + public boolean usesMana(ItemStack arg0) { + return true; + } } diff --git a/src/main/java/magicbees/item/ItemManasteelScoop.java b/src/main/java/magicbees/item/ItemManasteelScoop.java index d721bf1..782b161 100644 --- a/src/main/java/magicbees/item/ItemManasteelScoop.java +++ b/src/main/java/magicbees/item/ItemManasteelScoop.java @@ -1,5 +1,9 @@ package magicbees.item; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.IToolScoop; import magicbees.main.CommonProxy; import magicbees.main.utils.compat.BotaniaHelper; import net.minecraft.block.Block; @@ -11,57 +15,57 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import vazkii.botania.api.mana.IManaUsingItem; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.IToolScoop; @Optional.InterfaceList({ - @Optional.Interface(iface = "vazkii.botania.api.mana.IManaUsingItem", modid = BotaniaHelper.Name, striprefs = true) + @Optional.Interface(iface = "vazkii.botania.api.mana.IManaUsingItem", modid = BotaniaHelper.Name, striprefs = true) }) public class ItemManasteelScoop extends Item implements IManaUsingItem, IToolScoop { - public static final int MANA_PER_DAMAGE = 30; - - public ItemManasteelScoop() { - super(); - this.maxStackSize = 1; - this.setMaxDamage(20); - this.setCreativeTab(forestry.api.core.Tabs.tabApiculture); - this.setUnlocalizedName("manasteelScoop"); - this.setHarvestLevel("scoop", 3); - } - - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase player) { - stack.damageItem(1, player); - return true; - } - - @Override - public boolean usesMana(ItemStack stack) { - return true; - } - - @Override - @Optional.Method(modid = BotaniaHelper.Name) - public boolean getIsRepairable(ItemStack toolStack, ItemStack material) { - return (material.getItem() == BotaniaHelper.itemManaResource && material.getItemDamage() == BotaniaHelper.ManaResource.MANASTEEL.ordinal()) || super.getIsRepairable(toolStack, material); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manasteelScoop"); - } + public static final int MANA_PER_DAMAGE = 30; - @Override - public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) { - // Unsure if the server-side exclusion is necessary, but boy it looks disconcerting on the client if it's in. - if (/*!world.isRemote && */stack.getItemDamage() > 0 && player instanceof EntityPlayer) { - if (BotaniaHelper.requestMana(stack, (EntityPlayer)player, MANA_PER_DAMAGE, 1)) { - stack.setItemDamage(stack.getItemDamage() - 1); - } - } - } + public ItemManasteelScoop() { + super(); + this.maxStackSize = 1; + this.setMaxDamage(20); + this.setCreativeTab(forestry.api.core.Tabs.tabApiculture); + this.setUnlocalizedName("manasteelScoop"); + this.setHarvestLevel("scoop", 3); + } + + @Override + public boolean onBlockDestroyed( + ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase player) { + stack.damageItem(1, player); + return true; + } + + @Override + public boolean usesMana(ItemStack stack) { + return true; + } + + @Override + @Optional.Method(modid = BotaniaHelper.Name) + public boolean getIsRepairable(ItemStack toolStack, ItemStack material) { + return (material.getItem() == BotaniaHelper.itemManaResource + && material.getItemDamage() == BotaniaHelper.ManaResource.MANASTEEL.ordinal()) + || super.getIsRepairable(toolStack, material); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":manasteelScoop"); + } + + @Override + public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) { + // Unsure if the server-side exclusion is necessary, but boy it looks disconcerting on the client if it's in. + if ( + /*!world.isRemote && */ stack.getItemDamage() > 0 && player instanceof EntityPlayer) { + if (BotaniaHelper.requestMana(stack, (EntityPlayer) player, MANA_PER_DAMAGE, 1)) { + stack.setItemDamage(stack.getItemDamage() - 1); + } + } + } } diff --git a/src/main/java/magicbees/item/ItemMiscResources.java b/src/main/java/magicbees/item/ItemMiscResources.java index 7f54682..24a2671 100644 --- a/src/main/java/magicbees/item/ItemMiscResources.java +++ b/src/main/java/magicbees/item/ItemMiscResources.java @@ -1,10 +1,9 @@ package magicbees.item; -import java.util.List; - import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; import magicbees.item.types.ResourceType; import magicbees.main.CommonProxy; import magicbees.main.utils.TabMagicBees; @@ -14,63 +13,52 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -public class ItemMiscResources extends Item -{ - private IIcon[] icons = new IIcon[ResourceType.values().length]; - - public ItemMiscResources() - { - super(); - this.setCreativeTab(TabMagicBees.tabMagicBees); - this.setHasSubtypes(true); - this.setUnlocalizedName("miscResources"); - GameRegistry.registerItem(this, "miscResources"); - } - - public ItemStack getStackForType(ResourceType type) - { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(ResourceType type, int count) - { - return new ItemStack(this, count, type.ordinal()); - } - - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubItems(Item item, CreativeTabs tabs, List list) - { - for (ResourceType type : ResourceType.values()) - { - if (type.showInList) - { - list.add(this.getStackForType(type)); - } - } - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - for (int i = 0; i < ResourceType.values().length; i++) - { - this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":" + ResourceType.values()[i].getName()); - } - } +public class ItemMiscResources extends Item { + private IIcon[] icons = new IIcon[ResourceType.values().length]; - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int meta) - { - return icons[meta]; - } + public ItemMiscResources() { + super(); + this.setCreativeTab(TabMagicBees.tabMagicBees); + this.setHasSubtypes(true); + this.setUnlocalizedName("miscResources"); + GameRegistry.registerItem(this, "miscResources"); + } - @Override - public String getItemStackDisplayName(ItemStack stack) - { - return ResourceType.values()[stack.getItemDamage()].getLocalizedName(); - } + public ItemStack getStackForType(ResourceType type) { + return new ItemStack(this, 1, type.ordinal()); + } + public ItemStack getStackForType(ResourceType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (ResourceType type : ResourceType.values()) { + if (type.showInList) { + list.add(this.getStackForType(type)); + } + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + for (int i = 0; i < ResourceType.values().length; i++) { + this.icons[i] = + par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":" + ResourceType.values()[i].getName()); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) { + return icons[meta]; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return ResourceType.values()[stack.getItemDamage()].getLocalizedName(); + } } diff --git a/src/main/java/magicbees/item/ItemMoonDial.java b/src/main/java/magicbees/item/ItemMoonDial.java index 5b32547..4f52639 100644 --- a/src/main/java/magicbees/item/ItemMoonDial.java +++ b/src/main/java/magicbees/item/ItemMoonDial.java @@ -1,10 +1,9 @@ package magicbees.item; -import java.util.List; - import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; import magicbees.main.CommonProxy; import magicbees.main.Config; import magicbees.main.utils.MoonPhase; @@ -15,47 +14,43 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -public class ItemMoonDial extends Item -{ - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public ItemMoonDial() - { - super(); - this.setCreativeTab(TabMagicBees.tabMagicBees); - this.setUnlocalizedName("moonDial"); - GameRegistry.registerItem(this, "moonDial"); - } +public class ItemMoonDial extends Item { + @SideOnly(Side.CLIENT) + private IIcon[] icons; - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - this.icons = new IIcon[MoonPhase.values().length]; - for (int i = 0; i < MoonPhase.values().length; ++i) - { - this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":moonDial." + i); - } - this.itemIcon = this.icons[4]; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) - { - return this.icons[MoonPhase.getMoonPhaseFromTime(player.worldObj.getWorldTime()).ordinal()]; - } + public ItemMoonDial() { + super(); + this.setCreativeTab(TabMagicBees.tabMagicBees); + this.setUnlocalizedName("moonDial"); + GameRegistry.registerItem(this, "moonDial"); + } - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List infoList, boolean par4) - { - if (Config.moonDialShowsPhaseInText && - entityPlayer.getCurrentEquippedItem() != null && - entityPlayer.getCurrentEquippedItem().getItem() == this) - { - infoList.add("\u00A77" + MoonPhase.getMoonPhaseFromTime(entityPlayer.worldObj.getWorldTime()).getLocalizedName()); - } - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.icons = new IIcon[MoonPhase.values().length]; + for (int i = 0; i < MoonPhase.values().length; ++i) { + this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":moonDial." + i); + } + this.itemIcon = this.icons[4]; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + return this.icons[ + MoonPhase.getMoonPhaseFromTime(player.worldObj.getWorldTime()).ordinal()]; + } + + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List infoList, boolean par4) { + if (Config.moonDialShowsPhaseInText + && entityPlayer.getCurrentEquippedItem() != null + && entityPlayer.getCurrentEquippedItem().getItem() == this) { + infoList.add("\u00A77" + + MoonPhase.getMoonPhaseFromTime(entityPlayer.worldObj.getWorldTime()) + .getLocalizedName()); + } + } } diff --git a/src/main/java/magicbees/item/ItemMysteriousMagnet.java b/src/main/java/magicbees/item/ItemMysteriousMagnet.java index 3f5a4d7..5324a60 100644 --- a/src/main/java/magicbees/item/ItemMysteriousMagnet.java +++ b/src/main/java/magicbees/item/ItemMysteriousMagnet.java @@ -1,12 +1,12 @@ package magicbees.item; -import java.util.List; - import baubles.api.BaubleType; import baubles.api.IBauble; import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; import magicbees.main.CommonProxy; import magicbees.main.Config; import magicbees.main.utils.LocalizationManager; @@ -24,194 +24,191 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import cpw.mods.fml.common.Optional; -@Optional.Interface(modid="Baubles", iface="baubles.api.IBauble") +@Optional.Interface(modid = "Baubles", iface = "baubles.api.IBauble") public class ItemMysteriousMagnet extends Item implements IBauble { - - @SideOnly(Side.CLIENT) - private IIcon activeIcon; - - private final float FUDGE_FACTOR = 0.2f; - - public ItemMysteriousMagnet() { - super(); - this.setNoRepair(); - this.setHasSubtypes(true); - this.setUnlocalizedName(CommonProxy.DOMAIN + ":mysteriousMagnet"); - this.setCreativeTab(TabMagicBees.tabMagicBees); - } - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - String s = LocalizationManager.getLocalizedString("misc.level", getMagnetLevel(itemStack)); - if (isMagnetActive(itemStack)) { - list.add(LocalizationManager.getLocalizedString("misc.magnetActive", s)); - } - else { - list.add(LocalizationManager.getLocalizedString("misc.magnetInactive", s)); - } - } + @SideOnly(Side.CLIENT) + private IIcon activeIcon; - @Override - public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) { - if (entity instanceof EntityLivingBase) { - onWornTick(itemStack, (EntityLivingBase) entity); - } - } + private final float FUDGE_FACTOR = 0.2f; - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubItems(Item item, CreativeTabs tabs, List list) { - for (int i = 0; i <= getMaximumLevel(); i++) { - list.add(new ItemStack(this, 1, i * 2)); - } - } + public ItemMysteriousMagnet() { + super(); + this.setNoRepair(); + this.setHasSubtypes(true); + this.setUnlocalizedName(CommonProxy.DOMAIN + ":mysteriousMagnet"); + this.setCreativeTab(TabMagicBees.tabMagicBees); + } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetInactive"); - this.activeIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetActive"); - } + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { + String s = LocalizationManager.getLocalizedString("misc.level", getMagnetLevel(itemStack)); + if (isMagnetActive(itemStack)) { + list.add(LocalizationManager.getLocalizedString("misc.magnetActive", s)); + } else { + list.add(LocalizationManager.getLocalizedString("misc.magnetInactive", s)); + } + } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int meta) { - return isMagnetActive(meta) ? this.activeIcon : this.itemIcon; - } + @Override + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) { + if (entity instanceof EntityLivingBase) { + onWornTick(itemStack, (EntityLivingBase) entity); + } + } - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack, int pass) { - return isMagnetActive(itemStack); - } + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (int i = 0; i <= getMaximumLevel(); i++) { + list.add(new ItemStack(this, 1, i * 2)); + } + } - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if (player.isSneaking()) { - toggleActive(itemStack); - } - return itemStack; - } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetInactive"); + this.activeIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":magnetActive"); + } - public void toggleActive(ItemStack itemStack) { - itemStack.setItemDamage(itemStack.getItemDamage() ^ 1); - } - - public boolean isMagnetActive(ItemStack itemStack) { - return isMagnetActive(itemStack.getItemDamage()); - } - - private boolean isMagnetActive(int damage) { - return (damage & 0x01) == 1; - } - - public int getMaximumLevel() { - return Config.magnetMaxLevel; - } - - public int getMagnetLevel(ItemStack itemStack) { - return itemStack.getItemDamage() >> 1; - } + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) { + return isMagnetActive(meta) ? this.activeIcon : this.itemIcon; + } - private float getRadius(ItemStack itemStack) { - return Config.magnetBaseRange + (Config.magnetLevelMultiplier * getMagnetLevel(itemStack)); - } + @Override + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack itemStack, int pass) { + return isMagnetActive(itemStack); + } - @Override - public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) { - return true; - } + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { + if (player.isSneaking()) { + toggleActive(itemStack); + } + return itemStack; + } - @Override - public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) { - return true; - } + public void toggleActive(ItemStack itemStack) { + itemStack.setItemDamage(itemStack.getItemDamage() ^ 1); + } - @Override - @Optional.Method(modid="Baubles") - public BaubleType getBaubleType(ItemStack arg0) { - return BaubleType.AMULET; - } + public boolean isMagnetActive(ItemStack itemStack) { + return isMagnetActive(itemStack.getItemDamage()); + } - @Override - public void onEquipped(ItemStack itemStack, EntityLivingBase entity) { - if (!isMagnetActive(itemStack)) { - toggleActive(itemStack); - } - } + private boolean isMagnetActive(int damage) { + return (damage & 0x01) == 1; + } - @Override - public void onUnequipped(ItemStack itemStack, EntityLivingBase entity) { - if (isMagnetActive(itemStack)) { - toggleActive(itemStack); - } - } + public int getMaximumLevel() { + return Config.magnetMaxLevel; + } - @Override - @SuppressWarnings("unchecked") - public void onWornTick(ItemStack itemStack, EntityLivingBase entity) { - if (isMagnetActive(itemStack) && entity instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)entity; - World world = entity.worldObj; - float radius = getRadius(itemStack) - FUDGE_FACTOR; - AxisAlignedBB bounds = player.boundingBox.expand(radius, radius, radius); - - if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { - bounds.expand(FUDGE_FACTOR, FUDGE_FACTOR, FUDGE_FACTOR); - - if (7 <= getMagnetLevel(itemStack)) { - List arrows = world.getEntitiesWithinAABB(EntityArrow.class, bounds); - - for (EntityArrow arrow : arrows) { - if ((arrow.canBePickedUp == 1 || world.rand.nextFloat() < 0.3f) - && arrow.shootingEntity != entity) { - EntityItem replacement = new EntityItem(world, arrow.posX, arrow.posY, arrow.posZ, - new ItemStack(Items.arrow)); - world.spawnEntityInWorld(replacement); - } - world.removeEntity(arrow); - } - } - } - - List list = world.getEntitiesWithinAABB(EntityItem.class, bounds); - - for (EntityItem e : list) { - if (e.age >= 10) { - double x = player.posX - e.posX; - double y = player.posY - e.posY - 1.f; - double z = player.posZ - e.posZ; - - double length = Math.sqrt(x * x + y * y + z * z) * 2; + public int getMagnetLevel(ItemStack itemStack) { + return itemStack.getItemDamage() >> 1; + } - if (length < 1.2f) - continue; - - x = x / length + player.motionX / 2; - y = y / length + player.motionY / 2; - z = z / length + player.motionZ / 2; - - e.motionX = x; - e.motionY = y; - e.motionZ = z; - e.isAirBorne = true; - - if (e.isCollidedHorizontally) { - e.motionY += 1; - } - - if (world.rand.nextFloat() < 0.2f) { - float pitch = 0.85f - world.rand.nextFloat() * 3f / 10f; - if(!Config.disableMagnetSound) - world.playSoundEffect(e.posX, e.posY, e.posZ, "mob.endermen.portal", 0.6f, pitch); - } - } - } - } - } + private float getRadius(ItemStack itemStack) { + return Config.magnetBaseRange + (Config.magnetLevelMultiplier * getMagnetLevel(itemStack)); + } + + @Override + public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) { + return true; + } + + @Override + public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) { + return true; + } + + @Override + @Optional.Method(modid = "Baubles") + public BaubleType getBaubleType(ItemStack arg0) { + return BaubleType.AMULET; + } + + @Override + public void onEquipped(ItemStack itemStack, EntityLivingBase entity) { + if (!isMagnetActive(itemStack)) { + toggleActive(itemStack); + } + } + + @Override + public void onUnequipped(ItemStack itemStack, EntityLivingBase entity) { + if (isMagnetActive(itemStack)) { + toggleActive(itemStack); + } + } + + @Override + @SuppressWarnings("unchecked") + public void onWornTick(ItemStack itemStack, EntityLivingBase entity) { + if (isMagnetActive(itemStack) && entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) entity; + World world = entity.worldObj; + float radius = getRadius(itemStack) - FUDGE_FACTOR; + AxisAlignedBB bounds = player.boundingBox.expand(radius, radius, radius); + + if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) { + bounds.expand(FUDGE_FACTOR, FUDGE_FACTOR, FUDGE_FACTOR); + + if (7 <= getMagnetLevel(itemStack)) { + List arrows = world.getEntitiesWithinAABB(EntityArrow.class, bounds); + + for (EntityArrow arrow : arrows) { + if ((arrow.canBePickedUp == 1 || world.rand.nextFloat() < 0.3f) + && arrow.shootingEntity != entity) { + EntityItem replacement = new EntityItem( + world, arrow.posX, arrow.posY, arrow.posZ, new ItemStack(Items.arrow)); + world.spawnEntityInWorld(replacement); + } + world.removeEntity(arrow); + } + } + } + + List list = world.getEntitiesWithinAABB(EntityItem.class, bounds); + + for (EntityItem e : list) { + if (e.age >= 10) { + double x = player.posX - e.posX; + double y = player.posY - e.posY - 1.f; + double z = player.posZ - e.posZ; + + double length = Math.sqrt(x * x + y * y + z * z) * 2; + + if (length < 1.2f) continue; + + x = x / length + player.motionX / 2; + y = y / length + player.motionY / 2; + z = z / length + player.motionZ / 2; + + e.motionX = x; + e.motionY = y; + e.motionZ = z; + e.isAirBorne = true; + + if (e.isCollidedHorizontally) { + e.motionY += 1; + } + + if (world.rand.nextFloat() < 0.2f) { + float pitch = 0.85f - world.rand.nextFloat() * 3f / 10f; + if (!Config.disableMagnetSound) + world.playSoundEffect(e.posX, e.posY, e.posZ, "mob.endermen.portal", 0.6f, pitch); + } + } + } + } + } } diff --git a/src/main/java/magicbees/item/ItemNugget.java b/src/main/java/magicbees/item/ItemNugget.java index 37fc4a9..40409cf 100644 --- a/src/main/java/magicbees/item/ItemNugget.java +++ b/src/main/java/magicbees/item/ItemNugget.java @@ -1,9 +1,8 @@ package magicbees.item; -import java.util.List; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import java.util.List; import magicbees.item.types.NuggetType; import magicbees.main.CommonProxy; import net.minecraft.client.renderer.texture.IIconRegister; @@ -12,65 +11,54 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -public class ItemNugget extends Item -{ - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public ItemNugget() - { - super(); - this.setCreativeTab(CreativeTabs.tabMaterials); - this.setHasSubtypes(true); - this.setUnlocalizedName("beeNugget"); - } - - public ItemStack getStackForType(NuggetType type) - { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(NuggetType type, int count) - { - return new ItemStack(this, count, type.ordinal()); - } - - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubItems(Item item, CreativeTabs tab, List list) - { - for (NuggetType type : NuggetType.values()) - { - if (type.isActive()) - { - list.add(new ItemStack(item, 1, type.ordinal())); - } - } - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - this.icons = new IIcon[NuggetType.values().length]; - for (int i = 0; i < NuggetType.values().length; i++) - { - this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":nugget" - + NuggetType.values()[i].name().substring(0, 1) - + NuggetType.values()[i].name().substring(1).toLowerCase()); - } - } +public class ItemNugget extends Item { + @SideOnly(Side.CLIENT) + private IIcon[] icons; - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int meta) - { - return icons[meta]; - } - - @Override - public String getItemStackDisplayName(ItemStack stack) - { - return NuggetType.values()[stack.getItemDamage()].getName(); - } + public ItemNugget() { + super(); + this.setCreativeTab(CreativeTabs.tabMaterials); + this.setHasSubtypes(true); + this.setUnlocalizedName("beeNugget"); + } + + public ItemStack getStackForType(NuggetType type) { + return new ItemStack(this, 1, type.ordinal()); + } + + public ItemStack getStackForType(NuggetType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void getSubItems(Item item, CreativeTabs tab, List list) { + for (NuggetType type : NuggetType.values()) { + if (type.isActive()) { + list.add(new ItemStack(item, 1, type.ordinal())); + } + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.icons = new IIcon[NuggetType.values().length]; + for (int i = 0; i < NuggetType.values().length; i++) { + this.icons[i] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":nugget" + + NuggetType.values()[i].name().substring(0, 1) + + NuggetType.values()[i].name().substring(1).toLowerCase()); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) { + return icons[meta]; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return NuggetType.values()[stack.getItemDamage()].getName(); + } } diff --git a/src/main/java/magicbees/item/ItemPollen.java b/src/main/java/magicbees/item/ItemPollen.java index 376bcd5..c83ddae 100644 --- a/src/main/java/magicbees/item/ItemPollen.java +++ b/src/main/java/magicbees/item/ItemPollen.java @@ -1,10 +1,10 @@ package magicbees.item; -import java.util.List; - import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import java.util.List; import magicbees.item.types.PollenType; import magicbees.main.utils.compat.ForestryHelper; import net.minecraft.client.renderer.texture.IIconRegister; @@ -12,88 +12,73 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import forestry.api.core.Tabs; -public class ItemPollen extends Item -{ - public ItemPollen() - { - super(); - this.setCreativeTab(Tabs.tabApiculture); - this.setHasSubtypes(true); - this.setUnlocalizedName("pollen"); - GameRegistry.registerItem(this, "pollen"); - } +public class ItemPollen extends Item { + public ItemPollen() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("pollen"); + GameRegistry.registerItem(this, "pollen"); + } - public ItemStack getStackForType(PollenType type) - { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(PollenType type, int count) - { - return new ItemStack(this, count, type.ordinal()); - } - - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubItems(Item item, CreativeTabs tabs, List list) - { - for (PollenType type : PollenType.values()) - { - list.add(this.getStackForType(type)); - } - } + public ItemStack getStackForType(PollenType type) { + return new ItemStack(this, 1, type.ordinal()); + } - @Override - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } + public ItemStack getStackForType(PollenType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } - @Override - public int getRenderPasses(int metadata) - { - return 2; - } - - @SideOnly(Side.CLIENT) - private IIcon secondIcon; - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":pollen.0"); - this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":pollen.1"); - } + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (PollenType type : PollenType.values()) { + list.add(this.getStackForType(type)); + } + } - @Override - public IIcon getIcon(ItemStack stack, int pass) - { - return (pass == 0) ? this.itemIcon : this.secondIcon; - } + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) - { - int meta = Math.max(0, Math.min(PollenType.values().length - 1, stack.getItemDamage())); - int colour = PollenType.values()[meta].colour[0]; - - if (pass >= 1) - { - colour = PollenType.values()[meta].colour[1]; - } - - return colour; - } - - @Override - public String getItemStackDisplayName(ItemStack stack) - { - return PollenType.values()[stack.getItemDamage()].getName(); - } + @Override + public int getRenderPasses(int metadata) { + return 2; + } + @SideOnly(Side.CLIENT) + private IIcon secondIcon; + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":pollen.0"); + this.secondIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":pollen.1"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return (pass == 0) ? this.itemIcon : this.secondIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(PollenType.values().length - 1, stack.getItemDamage())); + int colour = PollenType.values()[meta].colour[0]; + + if (pass >= 1) { + colour = PollenType.values()[meta].colour[1]; + } + + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return PollenType.values()[stack.getItemDamage()].getName(); + } } diff --git a/src/main/java/magicbees/item/ItemPropolis.java b/src/main/java/magicbees/item/ItemPropolis.java index b5e2df2..230af27 100644 --- a/src/main/java/magicbees/item/ItemPropolis.java +++ b/src/main/java/magicbees/item/ItemPropolis.java @@ -1,72 +1,60 @@ package magicbees.item; -import java.util.List; - import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import java.util.List; import magicbees.item.types.PropolisType; import magicbees.main.utils.compat.ForestryHelper; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import forestry.api.core.Tabs; -public class ItemPropolis extends Item -{ - public ItemPropolis() - { - super(); - this.setCreativeTab(Tabs.tabApiculture); - this.setHasSubtypes(true); - this.setUnlocalizedName("propolis"); - GameRegistry.registerItem(this, "propolis"); - } - - public ItemStack getStackForType(PropolisType type) - { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(PropolisType type, int count) - { - return new ItemStack(this, count, type.ordinal()); - } +public class ItemPropolis extends Item { + public ItemPropolis() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("propolis"); + GameRegistry.registerItem(this, "propolis"); + } - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubItems(Item item, CreativeTabs tabs, List list) - { - for (PropolisType type : PropolisType.values()) - { - list.add(this.getStackForType(type)); - } - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":propolis.0"); - } - - @Override - public int getColorFromItemStack(ItemStack stack, int pass) - { - int colour = 0xffffff; - int meta = stack.getItemDamage(); - if (meta >= 0 && meta < PropolisType.values().length) - { - colour = PropolisType.values()[meta].colour; - } - return colour; - } + public ItemStack getStackForType(PropolisType type) { + return new ItemStack(this, 1, type.ordinal()); + } - @Override - public String getItemStackDisplayName(ItemStack stack) - { - return PropolisType.values()[stack.getItemDamage()].getName(); - } + public ItemStack getStackForType(PropolisType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (PropolisType type : PropolisType.values()) { + list.add(this.getStackForType(type)); + } + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon(ForestryHelper.Name.toLowerCase() + ":propolis.0"); + } + + @Override + public int getColorFromItemStack(ItemStack stack, int pass) { + int colour = 0xffffff; + int meta = stack.getItemDamage(); + if (meta >= 0 && meta < PropolisType.values().length) { + colour = PropolisType.values()[meta].colour; + } + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return PropolisType.values()[stack.getItemDamage()].getName(); + } } diff --git a/src/main/java/magicbees/item/ItemThaumiumGrafter.java b/src/main/java/magicbees/item/ItemThaumiumGrafter.java index b7b56bc..727f219 100644 --- a/src/main/java/magicbees/item/ItemThaumiumGrafter.java +++ b/src/main/java/magicbees/item/ItemThaumiumGrafter.java @@ -1,5 +1,8 @@ package magicbees.item; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.main.CommonProxy; import magicbees.main.utils.compat.ThaumcraftHelper; import net.minecraft.block.Block; @@ -11,84 +14,69 @@ import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.oredict.OreDictionary; import thaumcraft.api.IRepairableExtended; import thaumcraft.api.ThaumcraftApi; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; @Optional.InterfaceList({ - @Optional.Interface(iface = "thaumcraft.api.IRepairableExtended", modid = ThaumcraftHelper.Name, striprefs = true) + @Optional.Interface(iface = "thaumcraft.api.IRepairableExtended", modid = ThaumcraftHelper.Name, striprefs = true) }) -public class ItemThaumiumGrafter extends ItemGrafter implements IRepairableExtended -{ - public ItemThaumiumGrafter() - { - super(); - this.setMaxDamage(15); - this.setUnlocalizedName("thaumiumGrafter"); - } +public class ItemThaumiumGrafter extends ItemGrafter implements IRepairableExtended { + public ItemThaumiumGrafter() { + super(); + this.setMaxDamage(15); + this.setUnlocalizedName("thaumiumGrafter"); + } - @Override - public float func_150893_a(ItemStack itemStack, Block block) - { - return 1f; - } + @Override + public float func_150893_a(ItemStack itemStack, Block block) { + return 1f; + } - @Override - public float getDigSpeed(ItemStack itemStack, Block block, int metadata) - { - return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public int getItemEnchantability() - { - return ThaumcraftApi.toolMatThaumium.getEnchantability(); - } + @Override + public float getDigSpeed(ItemStack itemStack, Block block, int metadata) { + return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block); + } - /** - * Return the name for this tool's material. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public String getToolMaterialName() - { - return ThaumcraftApi.toolMatThaumium.toString(); - } + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public int getItemEnchantability() { + return ThaumcraftApi.toolMatThaumium.getEnchantability(); + } - /** - * Return whether this item is repairable in an anvil. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) - { - return OreDictionary.itemMatches(ThaumcraftApi.toolMatThaumium.getRepairItemStack(), par2ItemStack, true) - || super.getIsRepairable(par1ItemStack, par2ItemStack); - } + /** + * Return the name for this tool's material. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public String getToolMaterialName() { + return ThaumcraftApi.toolMatThaumium.toString(); + } - @Override - public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantLevel) - { - boolean flag = false; - if (stack.getItemDamage() > 0) - { - flag = true; - player.addExhaustion(0.6f * (enchantLevel * enchantLevel)); - } - return flag; - } + /** + * Return whether this item is repairable in an anvil. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + return OreDictionary.itemMatches(ThaumcraftApi.toolMatThaumium.getRepairItemStack(), par2ItemStack, true) + || super.getIsRepairable(par1ItemStack, par2ItemStack); + } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumGrafter"); - } - - public EnumRarity getRarity(ItemStack itemstack) - { - return EnumRarity.uncommon; - } - + @Override + public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantLevel) { + boolean flag = false; + if (stack.getItemDamage() > 0) { + flag = true; + player.addExhaustion(0.6f * (enchantLevel * enchantLevel)); + } + return flag; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumGrafter"); + } + + public EnumRarity getRarity(ItemStack itemstack) { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/magicbees/item/ItemThaumiumScoop.java b/src/main/java/magicbees/item/ItemThaumiumScoop.java index d7e72ca..7d5df70 100644 --- a/src/main/java/magicbees/item/ItemThaumiumScoop.java +++ b/src/main/java/magicbees/item/ItemThaumiumScoop.java @@ -1,5 +1,9 @@ package magicbees.item; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.IToolScoop; import magicbees.main.CommonProxy; import magicbees.main.utils.compat.ThaumcraftHelper; import net.minecraft.block.Block; @@ -13,86 +17,69 @@ import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.oredict.OreDictionary; import thaumcraft.api.IRepairable; import thaumcraft.api.ThaumcraftApi; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.IToolScoop; -@Optional.InterfaceList( - { - @Optional.Interface(iface = "thaumcraft.api.IRepairable", modid = ThaumcraftHelper.Name, striprefs = true) - } -) -public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop -{ - public ItemThaumiumScoop() - { - super(); - this.setMaxStackSize(1); - this.setMaxDamage(30); - this.setCreativeTab(forestry.api.core.Tabs.tabApiculture); - this.setUnlocalizedName("thaumiumScoop"); - this.setHarvestLevel("scoop", 3); - } +@Optional.InterfaceList({ + @Optional.Interface(iface = "thaumcraft.api.IRepairable", modid = ThaumcraftHelper.Name, striprefs = true) +}) +public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop { + public ItemThaumiumScoop() { + super(); + this.setMaxStackSize(1); + this.setMaxDamage(30); + this.setCreativeTab(forestry.api.core.Tabs.tabApiculture); + this.setUnlocalizedName("thaumiumScoop"); + this.setHarvestLevel("scoop", 3); + } - @Override - public float func_150893_a(ItemStack itemStack, Block block) - { - return 1f; - } + @Override + public float func_150893_a(ItemStack itemStack, Block block) { + return 1f; + } - @Override - public float getDigSpeed(ItemStack itemStack, Block block, int metadata) - { - return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block); - } + @Override + public float getDigSpeed(ItemStack itemStack, Block block, int metadata) { + return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block); + } - @Override - public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l, - EntityLivingBase entityliving) - { - itemstack.damageItem(1, entityliving); - return true; - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public int getItemEnchantability() - { - return ThaumcraftApi.toolMatThaumium.getEnchantability(); - } + @Override + public boolean onBlockDestroyed( + ItemStack itemstack, World world, Block block, int j, int k, int l, EntityLivingBase entityliving) { + itemstack.damageItem(1, entityliving); + return true; + } - /** - * Return the name for this tool's material. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public String getToolMaterialName() - { - return ThaumcraftApi.toolMatThaumium.toString(); - } + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public int getItemEnchantability() { + return ThaumcraftApi.toolMatThaumium.getEnchantability(); + } - /** - * Return whether this item is repairable in an anvil. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) - { - return OreDictionary.itemMatches(ThaumcraftApi.toolMatThaumium.getRepairItemStack(), par2ItemStack, true) - || super.getIsRepairable(par1ItemStack, par2ItemStack); - } + /** + * Return the name for this tool's material. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public String getToolMaterialName() { + return ThaumcraftApi.toolMatThaumium.toString(); + } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumScoop"); - } - - public EnumRarity getRarity(ItemStack itemstack) - { - return EnumRarity.uncommon; - } - + /** + * Return whether this item is repairable in an anvil. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + return OreDictionary.itemMatches(ThaumcraftApi.toolMatThaumium.getRepairItemStack(), par2ItemStack, true) + || super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":thaumiumScoop"); + } + + public EnumRarity getRarity(ItemStack itemstack) { + return EnumRarity.uncommon; + } } diff --git a/src/main/java/magicbees/item/ItemVoidGrafter.java b/src/main/java/magicbees/item/ItemVoidGrafter.java index 8c0db6b..ff09eb1 100644 --- a/src/main/java/magicbees/item/ItemVoidGrafter.java +++ b/src/main/java/magicbees/item/ItemVoidGrafter.java @@ -1,5 +1,8 @@ package magicbees.item; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.main.CommonProxy; import magicbees.main.utils.compat.ThaumcraftHelper; import net.minecraft.block.Block; @@ -18,109 +21,95 @@ import net.minecraftforge.oredict.OreDictionary; import thaumcraft.api.IRepairableExtended; import thaumcraft.api.IWarpingGear; import thaumcraft.api.ThaumcraftApi; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; @Optional.InterfaceList({ - @Optional.Interface(iface = "thaumcraft.api.IRepairableExtended", modid = ThaumcraftHelper.Name, striprefs = true), - @Optional.Interface(iface = "thaumcraft.api.IWarpingGear", modid = ThaumcraftHelper.Name, striprefs = true) + @Optional.Interface(iface = "thaumcraft.api.IRepairableExtended", modid = ThaumcraftHelper.Name, striprefs = true), + @Optional.Interface(iface = "thaumcraft.api.IWarpingGear", modid = ThaumcraftHelper.Name, striprefs = true) }) -public class ItemVoidGrafter extends ItemGrafter implements IRepairableExtended, IWarpingGear -{ - public ItemVoidGrafter() - { - super(); - this.setMaxDamage(10); - this.setUnlocalizedName("voidGrafter"); - } +public class ItemVoidGrafter extends ItemGrafter implements IRepairableExtended, IWarpingGear { + public ItemVoidGrafter() { + super(); + this.setMaxDamage(10); + this.setUnlocalizedName("voidGrafter"); + } - @Override - public float func_150893_a(ItemStack itemStack, Block block) - { - return 1f; - } + @Override + public float func_150893_a(ItemStack itemStack, Block block) { + return 1f; + } - @Override - public float getDigSpeed(ItemStack itemStack, Block block, int metadata) - { - return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public int getItemEnchantability() - { - return ThaumcraftApi.toolMatThaumium.getEnchantability(); - } + @Override + public float getDigSpeed(ItemStack itemStack, Block block, int metadata) { + return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block); + } - /** - * Return the name for this tool's material. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public String getToolMaterialName() - { - return ThaumcraftApi.toolMatThaumium.toString(); - } + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public int getItemEnchantability() { + return ThaumcraftApi.toolMatThaumium.getEnchantability(); + } - /** - * Return whether this item is repairable in an anvil. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) - { - return OreDictionary.itemMatches(ThaumcraftApi.toolMatThaumium.getRepairItemStack(), par2ItemStack, true) - || super.getIsRepairable(par1ItemStack, par2ItemStack); - } + /** + * Return the name for this tool's material. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public String getToolMaterialName() { + return ThaumcraftApi.toolMatThaumium.toString(); + } - @Override - public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantLevel) - { - boolean flag = false; - if (stack.getItemDamage() > 0) - { - flag = true; - player.addExhaustion(0.6f * (enchantLevel * enchantLevel)); - } - return flag; - } + /** + * Return whether this item is repairable in an anvil. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + return OreDictionary.itemMatches(ThaumcraftApi.toolMatThaumium.getRepairItemStack(), par2ItemStack, true) + || super.getIsRepairable(par1ItemStack, par2ItemStack); + } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":voidGrafter"); //TODO - } - - public EnumRarity getRarity(ItemStack itemstack) - { - return EnumRarity.uncommon; - } - - public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) - { - super.onUpdate(stack, world, entity, p_77663_4_, p_77663_5_); - if ((stack.isItemDamaged()) && (entity != null) && (entity.ticksExisted % 20 == 0) && ((entity instanceof EntityLivingBase))) { - stack.damageItem(-1, (EntityLivingBase)entity); - } - } - - public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) - { - if ((!player.worldObj.isRemote) && ((entity instanceof EntityLivingBase)) && ( - (!(entity instanceof EntityPlayer)) || (MinecraftServer.getServer().isPVPEnabled()))) { - ((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 80)); - } - return super.onLeftClickEntity(stack, player, entity); - } - - @Override - public int getWarp(ItemStack itemstack, EntityPlayer player) - { - return 1; - } - - + @Override + public boolean doRepair(ItemStack stack, EntityPlayer player, int enchantLevel) { + boolean flag = false; + if (stack.getItemDamage() > 0) { + flag = true; + player.addExhaustion(0.6f * (enchantLevel * enchantLevel)); + } + return flag; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":voidGrafter"); // TODO + } + + public EnumRarity getRarity(ItemStack itemstack) { + return EnumRarity.uncommon; + } + + public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(stack, world, entity, p_77663_4_, p_77663_5_); + if ((stack.isItemDamaged()) + && (entity != null) + && (entity.ticksExisted % 20 == 0) + && ((entity instanceof EntityLivingBase))) { + stack.damageItem(-1, (EntityLivingBase) entity); + } + } + + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { + if ((!player.worldObj.isRemote) + && ((entity instanceof EntityLivingBase)) + && ((!(entity instanceof EntityPlayer)) + || (MinecraftServer.getServer().isPVPEnabled()))) { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 80)); + } + return super.onLeftClickEntity(stack, player, entity); + } + + @Override + public int getWarp(ItemStack itemstack, EntityPlayer player) { + return 1; + } } diff --git a/src/main/java/magicbees/item/ItemVoidScoop.java b/src/main/java/magicbees/item/ItemVoidScoop.java index 91b54cd..a849f59 100644 --- a/src/main/java/magicbees/item/ItemVoidScoop.java +++ b/src/main/java/magicbees/item/ItemVoidScoop.java @@ -1,5 +1,9 @@ package magicbees.item; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.IToolScoop; import magicbees.main.CommonProxy; import magicbees.main.utils.compat.ThaumcraftHelper; import net.minecraft.block.Block; @@ -19,110 +23,95 @@ import net.minecraftforge.oredict.OreDictionary; import thaumcraft.api.IRepairable; import thaumcraft.api.IWarpingGear; import thaumcraft.api.ThaumcraftApi; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.IToolScoop; -@Optional.InterfaceList( - { - @Optional.Interface(iface = "thaumcraft.api.IRepairable", modid = ThaumcraftHelper.Name, striprefs = true), - @Optional.Interface(iface = "thaumcraft.api.IWarpingGear", modid = ThaumcraftHelper.Name, striprefs = true) - } -) -public class ItemVoidScoop extends Item implements IRepairable, IToolScoop, IWarpingGear -{ - public ItemVoidScoop() - { - super(); - this.setMaxStackSize(1); - this.setMaxDamage(20); - this.setCreativeTab(forestry.api.core.Tabs.tabApiculture); - this.setUnlocalizedName("voidScoop"); - this.setHarvestLevel("scoop", 3); - } +@Optional.InterfaceList({ + @Optional.Interface(iface = "thaumcraft.api.IRepairable", modid = ThaumcraftHelper.Name, striprefs = true), + @Optional.Interface(iface = "thaumcraft.api.IWarpingGear", modid = ThaumcraftHelper.Name, striprefs = true) +}) +public class ItemVoidScoop extends Item implements IRepairable, IToolScoop, IWarpingGear { + public ItemVoidScoop() { + super(); + this.setMaxStackSize(1); + this.setMaxDamage(20); + this.setCreativeTab(forestry.api.core.Tabs.tabApiculture); + this.setUnlocalizedName("voidScoop"); + this.setHarvestLevel("scoop", 3); + } - @Override - public float func_150893_a(ItemStack itemStack, Block block) - { - return 1f; - } + @Override + public float func_150893_a(ItemStack itemStack, Block block) { + return 1f; + } - @Override - public float getDigSpeed(ItemStack itemStack, Block block, int metadata) - { - return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block); - } + @Override + public float getDigSpeed(ItemStack itemStack, Block block, int metadata) { + return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : func_150893_a(itemStack, block); + } - @Override - public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l, - EntityLivingBase entityliving) - { - itemstack.damageItem(1, entityliving); - return true; - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public int getItemEnchantability() - { - return ThaumcraftApi.toolMatVoid.getEnchantability(); - } + @Override + public boolean onBlockDestroyed( + ItemStack itemstack, World world, Block block, int j, int k, int l, EntityLivingBase entityliving) { + itemstack.damageItem(1, entityliving); + return true; + } - /** - * Return the name for this tool's material. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public String getToolMaterialName() - { - return ThaumcraftApi.toolMatVoid.toString(); - } + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public int getItemEnchantability() { + return ThaumcraftApi.toolMatVoid.getEnchantability(); + } - /** - * Return whether this item is repairable in an anvil. - */ - @Optional.Method(modid = ThaumcraftHelper.Name) - public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) - { - return OreDictionary.itemMatches(ThaumcraftApi.toolMatVoid.getRepairItemStack(), par2ItemStack, true) - || super.getIsRepairable(par1ItemStack, par2ItemStack); - } + /** + * Return the name for this tool's material. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public String getToolMaterialName() { + return ThaumcraftApi.toolMatVoid.toString(); + } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":voidScoop"); //TODO - } - - public EnumRarity getRarity(ItemStack itemstack) - { - return EnumRarity.uncommon; - } - - public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) - { - super.onUpdate(stack, world, entity, p_77663_4_, p_77663_5_); - if ((stack.isItemDamaged()) && (entity != null) && (entity.ticksExisted % 20 == 0) && ((entity instanceof EntityLivingBase))) { - stack.damageItem(-1, (EntityLivingBase)entity); - } - } - - public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) - { - if ((!player.worldObj.isRemote) && ((entity instanceof EntityLivingBase)) && ( - (!(entity instanceof EntityPlayer)) || (MinecraftServer.getServer().isPVPEnabled()))) { - ((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 80)); - } - return super.onLeftClickEntity(stack, player, entity); - } - - @Override - public int getWarp(ItemStack itemstack, EntityPlayer player) - { - return 1; - } - + /** + * Return whether this item is repairable in an anvil. + */ + @Optional.Method(modid = ThaumcraftHelper.Name) + public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + return OreDictionary.itemMatches(ThaumcraftApi.toolMatVoid.getRepairItemStack(), par2ItemStack, true) + || super.getIsRepairable(par1ItemStack, par2ItemStack); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(CommonProxy.DOMAIN + ":voidScoop"); // TODO + } + + public EnumRarity getRarity(ItemStack itemstack) { + return EnumRarity.uncommon; + } + + public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(stack, world, entity, p_77663_4_, p_77663_5_); + if ((stack.isItemDamaged()) + && (entity != null) + && (entity.ticksExisted % 20 == 0) + && ((entity instanceof EntityLivingBase))) { + stack.damageItem(-1, (EntityLivingBase) entity); + } + } + + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { + if ((!player.worldObj.isRemote) + && ((entity instanceof EntityLivingBase)) + && ((!(entity instanceof EntityPlayer)) + || (MinecraftServer.getServer().isPVPEnabled()))) { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 80)); + } + return super.onLeftClickEntity(stack, player, entity); + } + + @Override + public int getWarp(ItemStack itemstack, EntityPlayer player) { + return 1; + } } diff --git a/src/main/java/magicbees/item/ItemWax.java b/src/main/java/magicbees/item/ItemWax.java index 3d5e4db..1446772 100644 --- a/src/main/java/magicbees/item/ItemWax.java +++ b/src/main/java/magicbees/item/ItemWax.java @@ -1,10 +1,10 @@ package magicbees.item; -import java.util.List; - import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import java.util.List; import magicbees.item.types.WaxType; import magicbees.main.CommonProxy; import net.minecraft.client.renderer.texture.IIconRegister; @@ -12,73 +12,61 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import forestry.api.core.Tabs; -public class ItemWax extends Item -{ - @SideOnly(Side.CLIENT) - private IIcon secondaryIcon; - - public ItemWax() - { - super(); - this.setCreativeTab(Tabs.tabApiculture); - this.setHasSubtypes(true); - this.setUnlocalizedName("wax"); - GameRegistry.registerItem(this, "wax"); - } - - public ItemStack getStackForType(WaxType type) - { - return new ItemStack(this, 1, type.ordinal()); - } - - public ItemStack getStackForType(WaxType type, int count) - { - return new ItemStack(this, count, type.ordinal()); - } +public class ItemWax extends Item { + @SideOnly(Side.CLIENT) + private IIcon secondaryIcon; - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) - { - this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":wax.0"); - this.secondaryIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":wax.1"); - } + public ItemWax() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("wax"); + GameRegistry.registerItem(this, "wax"); + } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int meta) - { - return (WaxType.values()[meta].sparkly) ? this.itemIcon : this.secondaryIcon; - } - - @Override - @SideOnly(Side.CLIENT) - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubItems(Item item, CreativeTabs tabs, List list) - { - for (WaxType type : WaxType.values()) - { - list.add(this.getStackForType(type)); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) - { - int colour = 0xffffff; - int meta = stack.getItemDamage(); - if (meta >= 0 && meta < WaxType.values().length) - { - colour = WaxType.values()[meta].colour; - } - return colour; - } + public ItemStack getStackForType(WaxType type) { + return new ItemStack(this, 1, type.ordinal()); + } - @Override - public String getItemStackDisplayName(ItemStack stack) - { - return WaxType.values()[stack.getItemDamage()].getName(); - } + public ItemStack getStackForType(WaxType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":wax.0"); + this.secondaryIcon = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":wax.1"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) { + return (WaxType.values()[meta].sparkly) ? this.itemIcon : this.secondaryIcon; + } + + @Override + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (WaxType type : WaxType.values()) { + list.add(this.getStackForType(type)); + } + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + int colour = 0xffffff; + int meta = stack.getItemDamage(); + if (meta >= 0 && meta < WaxType.values().length) { + colour = WaxType.values()[meta].colour; + } + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return WaxType.values()[stack.getItemDamage()].getName(); + } } diff --git a/src/main/java/magicbees/item/types/CapsuleType.java b/src/main/java/magicbees/item/types/CapsuleType.java index 114ddf7..fb322e4 100644 --- a/src/main/java/magicbees/item/types/CapsuleType.java +++ b/src/main/java/magicbees/item/types/CapsuleType.java @@ -2,29 +2,25 @@ package magicbees.item.types; import magicbees.main.utils.LocalizationManager; -public enum CapsuleType -{ - MAGIC("magic", 2000, 0), - VOID("void", 8000, 1), - ; - private String name; - public int capacity; - public int iconIdx; - - private CapsuleType(String n, int c, int idx) - { - this.name = n; - this.capacity = c; - this.iconIdx = idx; - } - - public String getName() - { - return this.name; - } - - public String getLocalizedName() - { - return LocalizationManager.getLocalizedString("capsule." + name); - } -} \ No newline at end of file +public enum CapsuleType { + MAGIC("magic", 2000, 0), + VOID("void", 8000, 1), + ; + private String name; + public int capacity; + public int iconIdx; + + private CapsuleType(String n, int c, int idx) { + this.name = n; + this.capacity = c; + this.iconIdx = idx; + } + + public String getName() { + return this.name; + } + + public String getLocalizedName() { + return LocalizationManager.getLocalizedString("capsule." + name); + } +} diff --git a/src/main/java/magicbees/item/types/CombType.java b/src/main/java/magicbees/item/types/CombType.java index 4c44cfe..30a7ec2 100644 --- a/src/main/java/magicbees/item/types/CombType.java +++ b/src/main/java/magicbees/item/types/CombType.java @@ -3,96 +3,91 @@ package magicbees.item.types; import magicbees.main.utils.LocalizationManager; public enum CombType { - // Reminder: Order matters! - // Meta value of comb == ordinal of enum value. - - MUNDANE("mundane", true), - MOLTEN("molten", true), - OCCULT("occult", true), - OTHERWORLDLY("otherworldly", true), - TRANSMUTED("transmuted", true), - - PAPERY("paper", true), - SOUL("soul", true), - FURTIVE("furtive", false), - INTELLECT("aware", false), - TEMPORAL("time", false), - FORGOTTEN("forgotten", false), - - AIRY("air", false), - FIREY("fire", false), - WATERY("water", false), - EARTHY("earth", false), - - TC_AIR("TCair", false), - TC_FIRE("TCfire", false), - TC_WATER("TCwater", false), - TC_EARTH("TCearth", false), - TC_ORDER("TCorder", false), - TC_CHAOS("TCchaos", false), - - AM_ESSENCE("essence", false), - AM_POTENT("potent", false), - - TE_DESTABILIZED("TEelectric", false), - TE_CARBON("TEcarbon", false), - TE_LUX("TElux", false), - TE_ENDEARING("TEendearing", false), - ; - - private static int[][] colours = new int[][] { - { 0xFF9859, 0xFFC58E }, - { 0xcc3333, 0x1E160E }, - { 0x9872FF, 0x2D2D2D }, - { 0x3EE0D8, 0x3A3820 }, - { 0xE5425D, 0x323291 }, + // Reminder: Order matters! + // Meta value of comb == ordinal of enum value. - { 0xBCA664, 0x35332E }, - { 0x7F7171, 0x876D53 }, - { 0xB7ACB7, 0x636363 }, - { 0x0092e9, 0x618fff }, - { 0x2F9381, 0x773C31 }, - { 0xB191D8, 0x35443B }, + MUNDANE("mundane", true), + MOLTEN("molten", true), + OCCULT("occult", true), + OTHERWORLDLY("otherworldly", true), + TRANSMUTED("transmuted", true), - { 0xffff7e, 0x606308 }, - { 0xff3C01, 0x5B0D10 }, - { 0x0090ff, 0x102F6B }, - { 0x00a000, 0x043004 }, + PAPERY("paper", true), + SOUL("soul", true), + FURTIVE("furtive", false), + INTELLECT("aware", false), + TEMPORAL("time", false), + FORGOTTEN("forgotten", false), - { 0xFFDF14, 0x707019 }, - { 0xE21802, 0x3F0E12 }, - { 0x00B6FF, 0x0F373D }, - { 0x28D328, 0x333004 }, - { 0xDDDDFF, 0x9D9DB5 }, - { 0x555577, 0x2D2D56 }, + AIRY("air", false), + FIREY("fire", false), + WATERY("water", false), + EARTHY("earth", false), - { 0xCC8604, 0x41046F }, - { 0xCCCC04, 0x41046F }, + TC_AIR("TCair", false), + TC_FIRE("TCfire", false), + TC_WATER("TCwater", false), + TC_EARTH("TCearth", false), + TC_ORDER("TCorder", false), + TC_CHAOS("TCchaos", false), - { 0xCC002C, 0x6B0118 }, - { 0x454545, 0x0F0F0F }, - { 0xF5F3A4, 0xC9C87D }, - { 0x12E3D9, 0x069E97 }, - }; - - private CombType(String pName, boolean show) { - this.name = pName; - - this.showInList = show; - } - - public void setHidden() { - this.showInList = false; - } - - private String name; - public boolean showInList; - - public String getName() { - return LocalizationManager.getLocalizedString("comb." + this.name); - } - - public int[] getColours() { - return colours[this.ordinal()]; - } -} \ No newline at end of file + AM_ESSENCE("essence", false), + AM_POTENT("potent", false), + + TE_DESTABILIZED("TEelectric", false), + TE_CARBON("TEcarbon", false), + TE_LUX("TElux", false), + TE_ENDEARING("TEendearing", false), + ; + + private static int[][] colours = new int[][] { + {0xFF9859, 0xFFC58E}, + {0xcc3333, 0x1E160E}, + {0x9872FF, 0x2D2D2D}, + {0x3EE0D8, 0x3A3820}, + {0xE5425D, 0x323291}, + {0xBCA664, 0x35332E}, + {0x7F7171, 0x876D53}, + {0xB7ACB7, 0x636363}, + {0x0092e9, 0x618fff}, + {0x2F9381, 0x773C31}, + {0xB191D8, 0x35443B}, + {0xffff7e, 0x606308}, + {0xff3C01, 0x5B0D10}, + {0x0090ff, 0x102F6B}, + {0x00a000, 0x043004}, + {0xFFDF14, 0x707019}, + {0xE21802, 0x3F0E12}, + {0x00B6FF, 0x0F373D}, + {0x28D328, 0x333004}, + {0xDDDDFF, 0x9D9DB5}, + {0x555577, 0x2D2D56}, + {0xCC8604, 0x41046F}, + {0xCCCC04, 0x41046F}, + {0xCC002C, 0x6B0118}, + {0x454545, 0x0F0F0F}, + {0xF5F3A4, 0xC9C87D}, + {0x12E3D9, 0x069E97}, + }; + + private CombType(String pName, boolean show) { + this.name = pName; + + this.showInList = show; + } + + public void setHidden() { + this.showInList = false; + } + + private String name; + public boolean showInList; + + public String getName() { + return LocalizationManager.getLocalizedString("comb." + this.name); + } + + public int[] getColours() { + return colours[this.ordinal()]; + } +} diff --git a/src/main/java/magicbees/item/types/DropType.java b/src/main/java/magicbees/item/types/DropType.java index 3f997d8..3fc1366 100644 --- a/src/main/java/magicbees/item/types/DropType.java +++ b/src/main/java/magicbees/item/types/DropType.java @@ -2,29 +2,25 @@ package magicbees.item.types; import magicbees.main.utils.LocalizationManager; -public enum DropType -{ - ENCHANTED("enchanting", 0x6e1c6d, 0xff8fff), - INTELLECT("intellect", 0x25914D, 0x18E072), - DESTABILIZED("destabilized", 0xCC002C, 0x6B0118), - CARBON("carbon", 0x454545, 0x0F0F0F), - LUX("lux", 0xF5F3A4, 0xC9C87D), - ENDEARING("endearing", 0x12E3D9, 0x069E97), - - ; - - private DropType(String pName, int colourA, int colourB) - { - this.name = pName; - this.combColour[0] = colourA; - this.combColour[1] = colourB; - } - - private final String name; - public int[] combColour = new int[2]; - - public String getName() - { - return LocalizationManager.getLocalizedString("drop." + this.name); - } -} \ No newline at end of file +public enum DropType { + ENCHANTED("enchanting", 0x6e1c6d, 0xff8fff), + INTELLECT("intellect", 0x25914D, 0x18E072), + DESTABILIZED("destabilized", 0xCC002C, 0x6B0118), + CARBON("carbon", 0x454545, 0x0F0F0F), + LUX("lux", 0xF5F3A4, 0xC9C87D), + ENDEARING("endearing", 0x12E3D9, 0x069E97), + ; + + private DropType(String pName, int colourA, int colourB) { + this.name = pName; + this.combColour[0] = colourA; + this.combColour[1] = colourB; + } + + private final String name; + public int[] combColour = new int[2]; + + public String getName() { + return LocalizationManager.getLocalizedString("drop." + this.name); + } +} diff --git a/src/main/java/magicbees/item/types/FluidType.java b/src/main/java/magicbees/item/types/FluidType.java index bf661e5..2d23784 100644 --- a/src/main/java/magicbees/item/types/FluidType.java +++ b/src/main/java/magicbees/item/types/FluidType.java @@ -3,63 +3,60 @@ package magicbees.item.types; import magicbees.main.utils.LocalizationManager; import net.minecraft.util.IIcon; -public enum FluidType -{ - // Incidentally, Item meta is the liquid ID. - - // Args are: forgeLiquidID - EMPTY(""), - - // Vanilla - WATER("water"), - LAVA("lava"), - - // Forestry - BIOMASS("biomass"), - ETHANOL("bioethanol"), - - // Buildcraft - OIL("oil"), - FUEL("fuel"), - - // More Forestry - SEEDOIL("seedoil"), - HONEY("honey"), - JUICE("juice"), - CRUSHEDICE("ice"), - MILK("milk"), - - // ExtraBees liquids - ACID("acid"), - POISON("poison"), - LIQUIDNITROGEN("liquidnitrogen"), - DNA("liquiddna"), - - // Railcraft - CREOSOTEOIL("creosote"), - STEAM("steam"), - - // Thermal Foundation - REDSTONE("redstone"), - GLOWSTONE("glowstone"), - ENDER("ender"), - PYROTHEUM("pyrotheum"), - CRYOTHEUM("cryotheum"), - MANA("mana"), - COAL("coal"), - ; - public String liquidID; - public int iconIdx; - public boolean available = false; - public IIcon liquidIcon; - - private FluidType(String l) - { - this.liquidID = l; - } +public enum FluidType { + // Incidentally, Item meta is the liquid ID. - public String getDisplayName() - { - return LocalizationManager.getLocalizedString("liquid." + liquidID); - } + // Args are: forgeLiquidID + EMPTY(""), + + // Vanilla + WATER("water"), + LAVA("lava"), + + // Forestry + BIOMASS("biomass"), + ETHANOL("bioethanol"), + + // Buildcraft + OIL("oil"), + FUEL("fuel"), + + // More Forestry + SEEDOIL("seedoil"), + HONEY("honey"), + JUICE("juice"), + CRUSHEDICE("ice"), + MILK("milk"), + + // ExtraBees liquids + ACID("acid"), + POISON("poison"), + LIQUIDNITROGEN("liquidnitrogen"), + DNA("liquiddna"), + + // Railcraft + CREOSOTEOIL("creosote"), + STEAM("steam"), + + // Thermal Foundation + REDSTONE("redstone"), + GLOWSTONE("glowstone"), + ENDER("ender"), + PYROTHEUM("pyrotheum"), + CRYOTHEUM("cryotheum"), + MANA("mana"), + COAL("coal"), + ; + public String liquidID; + public int iconIdx; + public boolean available = false; + public IIcon liquidIcon; + + private FluidType(String l) { + this.liquidID = l; + } + + public String getDisplayName() { + return LocalizationManager.getLocalizedString("liquid." + liquidID); + } } diff --git a/src/main/java/magicbees/item/types/HiveFrameType.java b/src/main/java/magicbees/item/types/HiveFrameType.java index 45eda1a..8a483a5 100644 --- a/src/main/java/magicbees/item/types/HiveFrameType.java +++ b/src/main/java/magicbees/item/types/HiveFrameType.java @@ -2,114 +2,126 @@ package magicbees.item.types; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeModifier; - import magicbees.main.utils.LocalizationManager; -public enum HiveFrameType implements IBeeModifier -{ - MAGIC("Magic", 240, 1f, 1f, 1f, 2f, 0.6f), - RESILIENT("Resilient", 800, 1f, 1f, 1f, 2f, 0.5f), - GENTLE("Gentle", 200, 1f, 0.7f, 1.5f, 1.4f, 0.01f), - METABOLIC("Metabolic", 130, 1f, 1.8f, 1f, 1.2f, 1f), - NECROTIC("Necrotic", 280, 1f, 1f, 0.3f, 0.75f, 1.2f), - TEMPORAL("Temporal", 300, 1f, 1f, 2.5f, 1f, 0.8f), - OBLIVION("Oblivion", 50, 1f, 1f, 0.0001f, 0f, 1f), - ; +public enum HiveFrameType implements IBeeModifier { + MAGIC("Magic", 240, 1f, 1f, 1f, 2f, 0.6f), + RESILIENT("Resilient", 800, 1f, 1f, 1f, 2f, 0.5f), + GENTLE("Gentle", 200, 1f, 0.7f, 1.5f, 1.4f, 0.01f), + METABOLIC("Metabolic", 130, 1f, 1.8f, 1f, 1.2f, 1f), + NECROTIC("Necrotic", 280, 1f, 1f, 0.3f, 0.75f, 1.2f), + TEMPORAL("Temporal", 300, 1f, 1f, 2.5f, 1f, 0.8f), + OBLIVION("Oblivion", 50, 1f, 1f, 0.0001f, 0f, 1f), + ; - private final String frameName; - public final int maxDamage; + private final String frameName; + public final int maxDamage; - private final float territoryMod; - private final float mutationMod; - private final float lifespanMod; - private final float productionMod; - private final float floweringMod; - private final float geneticDecayMod; - private final boolean isSealed; - private final boolean isLit; - private final boolean isSunlit; - private final boolean isHellish; - - HiveFrameType(String name, int damage, float territory, float mutation, float lifespan, float production, float geneticDecay) { - this(name, damage, territory, mutation, lifespan, production, 1f, geneticDecay, false, false, false, false); - } - - HiveFrameType(String name, int damage, - float territory, float mutation, float lifespan, float production, float flowering, float geneticDecay, - boolean sealed, boolean lit, boolean sunlit, boolean hellish) - { - this.frameName = name; - this.maxDamage = damage; - - this.territoryMod = territory; - this.mutationMod = mutation; - this.lifespanMod = lifespan; - this.productionMod = production; - this.floweringMod = flowering; - this.geneticDecayMod = geneticDecay; - this.isSealed = sealed; - this.isLit = lit; - this.isSunlit = sunlit; - this.isHellish = hellish; - } + private final float territoryMod; + private final float mutationMod; + private final float lifespanMod; + private final float productionMod; + private final float floweringMod; + private final float geneticDecayMod; + private final boolean isSealed; + private final boolean isLit; + private final boolean isSunlit; + private final boolean isHellish; - public String getName() - { - return this.frameName; - } - - public String getLocalizedName() - { - return LocalizationManager.getLocalizedString("frame." + this.frameName); - } + HiveFrameType( + String name, + int damage, + float territory, + float mutation, + float lifespan, + float production, + float geneticDecay) { + this(name, damage, territory, mutation, lifespan, production, 1f, geneticDecay, false, false, false, false); + } - @Override - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) { - return territoryMod; - } + HiveFrameType( + String name, + int damage, + float territory, + float mutation, + float lifespan, + float production, + float flowering, + float geneticDecay, + boolean sealed, + boolean lit, + boolean sunlit, + boolean hellish) { + this.frameName = name; + this.maxDamage = damage; - @Override - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { - return mutationMod; - } + this.territoryMod = territory; + this.mutationMod = mutation; + this.lifespanMod = lifespan; + this.productionMod = production; + this.floweringMod = flowering; + this.geneticDecayMod = geneticDecay; + this.isSealed = sealed; + this.isLit = lit; + this.isSunlit = sunlit; + this.isHellish = hellish; + } - @Override - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { - return lifespanMod; - } + public String getName() { + return this.frameName; + } - @Override - public float getProductionModifier(IBeeGenome genome, float currentModifier) { - return productionMod; - } + public String getLocalizedName() { + return LocalizationManager.getLocalizedString("frame." + this.frameName); + } - @Override - public float getFloweringModifier(IBeeGenome genome, float currentModifier) { - return floweringMod; - } + @Override + public float getTerritoryModifier(IBeeGenome genome, float currentModifier) { + return territoryMod; + } - @Override - public float getGeneticDecay(IBeeGenome genome, float currentModifier) { - return geneticDecayMod; - } + @Override + public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { + return mutationMod; + } - @Override - public boolean isSealed() { - return isSealed; - } + @Override + public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { + return lifespanMod; + } - @Override - public boolean isSelfLighted() { - return isLit; - } + @Override + public float getProductionModifier(IBeeGenome genome, float currentModifier) { + return productionMod; + } - @Override - public boolean isSunlightSimulated() { - return isSunlit; - } + @Override + public float getFloweringModifier(IBeeGenome genome, float currentModifier) { + return floweringMod; + } - @Override - public boolean isHellish() { - return isHellish; - } + @Override + public float getGeneticDecay(IBeeGenome genome, float currentModifier) { + return geneticDecayMod; + } + + @Override + public boolean isSealed() { + return isSealed; + } + + @Override + public boolean isSelfLighted() { + return isLit; + } + + @Override + public boolean isSunlightSimulated() { + return isSunlit; + } + + @Override + public boolean isHellish() { + return isHellish; + } } diff --git a/src/main/java/magicbees/item/types/NuggetType.java b/src/main/java/magicbees/item/types/NuggetType.java index a5d0bc7..9728724 100644 --- a/src/main/java/magicbees/item/types/NuggetType.java +++ b/src/main/java/magicbees/item/types/NuggetType.java @@ -3,49 +3,42 @@ package magicbees.item.types; import magicbees.main.utils.LocalizationManager; import net.minecraft.item.Item; -public enum NuggetType -{ - IRON, - COPPER, - TIN, - SILVER, - LEAD, - DIAMOND, - EMERALD, - APATITE, - ; - - private Item targetIngot; - private boolean active; - - private NuggetType() - { - this.active = true; - } - - public void setIngotItem(Item target) - { - this.targetIngot = target; - } - - public Item getIngotItem() - { - return this.targetIngot; - } - - public void setInactive() - { - this.active = false; - } - - public boolean isActive() - { - return this.active; - } +public enum NuggetType { + IRON, + COPPER, + TIN, + SILVER, + LEAD, + DIAMOND, + EMERALD, + APATITE, + ; - public String getName() - { - return LocalizationManager.getLocalizedString("nugget." + this.toString().toLowerCase()); - } + private Item targetIngot; + private boolean active; + private NuggetType() { + this.active = true; + } + + public void setIngotItem(Item target) { + this.targetIngot = target; + } + + public Item getIngotItem() { + return this.targetIngot; + } + + public void setInactive() { + this.active = false; + } + + public boolean isActive() { + return this.active; + } + + public String getName() { + return LocalizationManager.getLocalizedString( + "nugget." + this.toString().toLowerCase()); + } } diff --git a/src/main/java/magicbees/item/types/PollenType.java b/src/main/java/magicbees/item/types/PollenType.java index 2681e54..501e7f0 100644 --- a/src/main/java/magicbees/item/types/PollenType.java +++ b/src/main/java/magicbees/item/types/PollenType.java @@ -2,24 +2,21 @@ package magicbees.item.types; import magicbees.main.utils.LocalizationManager; -public enum PollenType -{ - UNUSUAL("unusual", 0xD8417B, 0xA03059), - PHASED("phased", 0x4974B4, 0x456BA5), - ; - - private PollenType(String pName, int colourA, int colourB) - { - this.name = pName; - this.colour[0] = colourA; - this.colour[1] = colourB; - } - - private String name; - public int[] colour = new int[2]; - - public String getName() - { - return LocalizationManager.getLocalizedString("pollen." + this.name); - } -} \ No newline at end of file +public enum PollenType { + UNUSUAL("unusual", 0xD8417B, 0xA03059), + PHASED("phased", 0x4974B4, 0x456BA5), + ; + + private PollenType(String pName, int colourA, int colourB) { + this.name = pName; + this.colour[0] = colourA; + this.colour[1] = colourB; + } + + private String name; + public int[] colour = new int[2]; + + public String getName() { + return LocalizationManager.getLocalizedString("pollen." + this.name); + } +} diff --git a/src/main/java/magicbees/item/types/PropolisType.java b/src/main/java/magicbees/item/types/PropolisType.java index b7c08ea..28a122c 100644 --- a/src/main/java/magicbees/item/types/PropolisType.java +++ b/src/main/java/magicbees/item/types/PropolisType.java @@ -2,29 +2,26 @@ package magicbees.item.types; import magicbees.main.utils.LocalizationManager; -public enum PropolisType -{ - UNSTABLE("unstable", 0xEFB492), - - AIR("air", 0xA19E10), - FIRE("fire", 0x95132F), - WATER("water", 0x1054A1), - EARTH("earth", 0x00a000), - ORDER("dull", 0xDDDDFF), - CHAOS("magic", 0x555577), - ; - - private PropolisType(String pName, int overlayColour) - { - this.name = pName; - this.colour = overlayColour; - } - - private String name; - public int colour; - - public String getName() - { - return LocalizationManager.getLocalizedString("propolis." + this.name); - } +public enum PropolisType { + UNSTABLE("unstable", 0xEFB492), + + AIR("air", 0xA19E10), + FIRE("fire", 0x95132F), + WATER("water", 0x1054A1), + EARTH("earth", 0x00a000), + ORDER("dull", 0xDDDDFF), + CHAOS("magic", 0x555577), + ; + + private PropolisType(String pName, int overlayColour) { + this.name = pName; + this.colour = overlayColour; + } + + private String name; + public int colour; + + public String getName() { + return LocalizationManager.getLocalizedString("propolis." + this.name); + } } diff --git a/src/main/java/magicbees/item/types/ResourceType.java b/src/main/java/magicbees/item/types/ResourceType.java index e34781e..1989118 100644 --- a/src/main/java/magicbees/item/types/ResourceType.java +++ b/src/main/java/magicbees/item/types/ResourceType.java @@ -2,60 +2,55 @@ package magicbees.item.types; import magicbees.main.utils.LocalizationManager; -public enum ResourceType -{ - LORE_FRAGMENT("fragment", true), - AROMATIC_LUMP("lump", true), - EXTENDED_FERTILIZER("fertilizer", true), - SKULL_CHIP("skullChip", true), - SKULL_FRAGMENT("skullFragment", true), - DRAGON_DUST("dragonDust", true), - DRAGON_CHUNK("dragonChunk", true), - ESSENCE_FALSE_LIFE("essenceLife", true),// - ESSENCE_SHALLOW_GRAVE("essenceDeath", true),// - ESSENCE_LOST_TIME("essenceTime", true), - ESSENCE_EVERLASTING_DURABILITY("essenceDurability", true),// - ESSENCE_SCORNFUL_OBLIVION("essenceOblivion", true), - ESSENCE_FICKLE_PERMANENCE("essenceMutable", true),// - z_2("lump", false), // Using lump for the name to avoid missing texture warnings. - z_3("lump", false), - z_4("lump", false), - z_5("lump", false), - DIMENSIONAL_SINGULARITY("dimensionalSingularity", true), - TC_DUST_AIR("TCairDust", true), - TC_DUST_WATER("TCwaterDust", true), - TC_DUST_FIRE("TCfireDust", true), - TC_DUST_EARTH("TCearthDust", true), - TC_DUST_ORDER("TCorderDust", true), - TC_DUST_CHAOS("TCchaosDust", true), - - - // Dummy items for Thaumanomicon research icons. - // These won't ever actually exist in-game, and so they can be moved around. - RESEARCH_STARTNODE("startNode", false), - RESEARCH_BEEINFUSION("beeInfusion", false), - ; - - private ResourceType(String n, boolean show) - { - this.name = n; - this.showInList = show; - } - private String name; - public boolean showInList; - - public void setHidden() - { - this.showInList = false; - } - - public String getName() - { - return this.name; - } - - public String getLocalizedName() - { - return LocalizationManager.getLocalizedString("resource." + this.name); - } +public enum ResourceType { + LORE_FRAGMENT("fragment", true), + AROMATIC_LUMP("lump", true), + EXTENDED_FERTILIZER("fertilizer", true), + SKULL_CHIP("skullChip", true), + SKULL_FRAGMENT("skullFragment", true), + DRAGON_DUST("dragonDust", true), + DRAGON_CHUNK("dragonChunk", true), + ESSENCE_FALSE_LIFE("essenceLife", true), // + ESSENCE_SHALLOW_GRAVE("essenceDeath", true), // + ESSENCE_LOST_TIME("essenceTime", true), + ESSENCE_EVERLASTING_DURABILITY("essenceDurability", true), // + ESSENCE_SCORNFUL_OBLIVION("essenceOblivion", true), + ESSENCE_FICKLE_PERMANENCE("essenceMutable", true), // + z_2("lump", false), // Using lump for the name to avoid missing texture warnings. + z_3("lump", false), + z_4("lump", false), + z_5("lump", false), + DIMENSIONAL_SINGULARITY("dimensionalSingularity", true), + TC_DUST_AIR("TCairDust", true), + TC_DUST_WATER("TCwaterDust", true), + TC_DUST_FIRE("TCfireDust", true), + TC_DUST_EARTH("TCearthDust", true), + TC_DUST_ORDER("TCorderDust", true), + TC_DUST_CHAOS("TCchaosDust", true), + + // Dummy items for Thaumanomicon research icons. + // These won't ever actually exist in-game, and so they can be moved around. + RESEARCH_STARTNODE("startNode", false), + RESEARCH_BEEINFUSION("beeInfusion", false), + ; + + private ResourceType(String n, boolean show) { + this.name = n; + this.showInList = show; + } + + private String name; + public boolean showInList; + + public void setHidden() { + this.showInList = false; + } + + public String getName() { + return this.name; + } + + public String getLocalizedName() { + return LocalizationManager.getLocalizedString("resource." + this.name); + } } diff --git a/src/main/java/magicbees/item/types/WaxType.java b/src/main/java/magicbees/item/types/WaxType.java index 81fe078..262edf9 100644 --- a/src/main/java/magicbees/item/types/WaxType.java +++ b/src/main/java/magicbees/item/types/WaxType.java @@ -2,26 +2,22 @@ package magicbees.item.types; import magicbees.main.utils.LocalizationManager; -public enum WaxType -{ - MAGIC("magic", true, 0xd242df), - SOUL("soul", false, 0x967C63), - AMNESIC("amnesic", true, 0x856DFF) - ; - - private WaxType(String n, boolean sp, int c) - { - this.name = n; - this.sparkly = sp; - this.colour = c; - } - - private String name; - public boolean sparkly; - public int colour; - - public String getName() - { - return LocalizationManager.getLocalizedString("wax." + this.name); - } -} \ No newline at end of file +public enum WaxType { + MAGIC("magic", true, 0xd242df), + SOUL("soul", false, 0x967C63), + AMNESIC("amnesic", true, 0x856DFF); + + private WaxType(String n, boolean sp, int c) { + this.name = n; + this.sparkly = sp; + this.colour = c; + } + + private String name; + public boolean sparkly; + public int colour; + + public String getName() { + return LocalizationManager.getLocalizedString("wax." + this.name); + } +} diff --git a/src/main/java/magicbees/main/ClientProxy.java b/src/main/java/magicbees/main/ClientProxy.java index f8f9c2e..2179d8c 100644 --- a/src/main/java/magicbees/main/ClientProxy.java +++ b/src/main/java/magicbees/main/ClientProxy.java @@ -1,30 +1,29 @@ package magicbees.main; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.client.render.RendererEffectJar; import magicbees.client.render.RendererVisAuraProvider; import magicbees.tileentity.TileEntityEffectJar; import magicbees.tileentity.TileEntityVisAuraProvider; import net.minecraft.item.Item; import net.minecraftforge.client.MinecraftForgeClient; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) -public class ClientProxy extends CommonProxy -{ - @Override - public void registerRenderers() - { - super.registerRenderers(); - - RenderIdEffectJar = RenderingRegistry.getNextAvailableRenderId(); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Config.effectJar), RendererEffectJar.instance); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEffectJar.class, RendererEffectJar.instance); - - RenderIdVisAuraProvider = RenderingRegistry.getNextAvailableRenderId(); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Config.visAuraProvider), RendererVisAuraProvider.instance); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVisAuraProvider.class, RendererVisAuraProvider.instance); - } +public class ClientProxy extends CommonProxy { + @Override + public void registerRenderers() { + super.registerRenderers(); + + RenderIdEffectJar = RenderingRegistry.getNextAvailableRenderId(); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Config.effectJar), RendererEffectJar.instance); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEffectJar.class, RendererEffectJar.instance); + + RenderIdVisAuraProvider = RenderingRegistry.getNextAvailableRenderId(); + MinecraftForgeClient.registerItemRenderer( + Item.getItemFromBlock(Config.visAuraProvider), RendererVisAuraProvider.instance); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVisAuraProvider.class, RendererVisAuraProvider.instance); + } } diff --git a/src/main/java/magicbees/main/CommonProxy.java b/src/main/java/magicbees/main/CommonProxy.java index fe6c42f..fbd32ab 100644 --- a/src/main/java/magicbees/main/CommonProxy.java +++ b/src/main/java/magicbees/main/CommonProxy.java @@ -1,20 +1,18 @@ package magicbees.main; -public class CommonProxy -{ - public static final String DOMAIN = "magicbees"; - public static final String TEXTURE = "textures/"; - public static final String GUI_TEXTURE = TEXTURE + "gui/"; - public static final String ITEM_TEXTURE = TEXTURE + "items/"; - public static final String MODEL = "model/"; - public static final String LANGS = "lang/"; - - public static String FORESTRY_GFX_ITEMS; - public static String FORESTRY_GFX_BEEEFFECTS; - - public static int RenderIdEffectJar; - public static int RenderIdVisAuraProvider; - - public void registerRenderers() { } +public class CommonProxy { + public static final String DOMAIN = "magicbees"; + public static final String TEXTURE = "textures/"; + public static final String GUI_TEXTURE = TEXTURE + "gui/"; + public static final String ITEM_TEXTURE = TEXTURE + "items/"; + public static final String MODEL = "model/"; + public static final String LANGS = "lang/"; + public static String FORESTRY_GFX_ITEMS; + public static String FORESTRY_GFX_BEEEFFECTS; + + public static int RenderIdEffectJar; + public static int RenderIdVisAuraProvider; + + public void registerRenderers() {} } diff --git a/src/main/java/magicbees/main/Config.java b/src/main/java/magicbees/main/Config.java index 4f2d3b8..eab767e 100644 --- a/src/main/java/magicbees/main/Config.java +++ b/src/main/java/magicbees/main/Config.java @@ -1,8 +1,14 @@ package magicbees.main; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import forestry.api.apiculture.BeeManager; +import forestry.api.storage.BackpackManager; +import forestry.api.storage.EnumBackpackType; import java.io.File; import java.lang.reflect.Field; - import magicbees.block.BlockEffectJar; import magicbees.block.BlockEnchantedEarth; import magicbees.block.BlockHive; @@ -52,465 +58,462 @@ import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; import net.minecraftforge.oredict.OreDictionary; -import cpw.mods.fml.client.event.ConfigChangedEvent; -import cpw.mods.fml.common.event.FMLInterModComms; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import forestry.api.apiculture.BeeManager; -import forestry.api.storage.BackpackManager; -import forestry.api.storage.EnumBackpackType; /** * A class to hold some data related to mod state & functions. * * @author MysteriousAges */ -public class Config -{ - public static final String CATEGORY_GENERAL = "general"; - public static final String CATEGORY_CLIENT = "client"; - public static final String CATEGORY_DEBUG = "debug"; - public static final String CATEGORY_MODULES = "modules"; - public static final String CATEGORY_BOTANIA = "botaniaPlugin"; - - public static boolean drawParticleEffects; - public static boolean beeInfusionsAdded; - public static boolean thaumaturgeBackpackActive; - public static boolean addThaumcraftItemsToBackpacks; - public static boolean disableUpdateNotification; - public static boolean areMagicPlanksFlammable; - public static boolean useImpregnatedStickInTools; - public static boolean moonDialShowsPhaseInText; - public static boolean doSpecialHiveGen; - public static String thaumaturgeExtraItems; - public static int capsuleStackSizeMax; - public static boolean logHiveSpawns; - public static double thaumcraftSaplingDroprate; - public static int aromaticLumpSwarmerRate; - public static int thaumcraftNodeMaxSize; +public class Config { + public static final String CATEGORY_GENERAL = "general"; + public static final String CATEGORY_CLIENT = "client"; + public static final String CATEGORY_DEBUG = "debug"; + public static final String CATEGORY_MODULES = "modules"; + public static final String CATEGORY_BOTANIA = "botaniaPlugin"; - public static boolean arsMagicaActive; - public static boolean bloodMagicActive; - public static boolean equivalentExchangeActive; - public static boolean extraBeesActive; - public static boolean redstoneArsenalActive; - public static boolean thaumcraftActive; - public static boolean thermalFoundationActive; - public static boolean botaniaActive; - public static boolean ae2Active; + public static boolean drawParticleEffects; + public static boolean beeInfusionsAdded; + public static boolean thaumaturgeBackpackActive; + public static boolean addThaumcraftItemsToBackpacks; + public static boolean disableUpdateNotification; + public static boolean areMagicPlanksFlammable; + public static boolean useImpregnatedStickInTools; + public static boolean moonDialShowsPhaseInText; + public static boolean doSpecialHiveGen; + public static String thaumaturgeExtraItems; + public static int capsuleStackSizeMax; + public static boolean logHiveSpawns; + public static double thaumcraftSaplingDroprate; + public static int aromaticLumpSwarmerRate; + public static int thaumcraftNodeMaxSize; - public static float magnetBaseRange; - public static float magnetLevelMultiplier; - public static int magnetMaxLevel; + public static boolean arsMagicaActive; + public static boolean bloodMagicActive; + public static boolean equivalentExchangeActive; + public static boolean extraBeesActive; + public static boolean redstoneArsenalActive; + public static boolean thaumcraftActive; + public static boolean thermalFoundationActive; + public static boolean botaniaActive; + public static boolean ae2Active; - public static boolean forestryDebugEnabled; + public static float magnetBaseRange; + public static float magnetLevelMultiplier; + public static int magnetMaxLevel; - public static BlockEnchantedEarth enchantedEarth; - public static BlockEffectJar effectJar; - public static BlockHive hive; + public static boolean forestryDebugEnabled; + + public static BlockEnchantedEarth enchantedEarth; + public static BlockEffectJar effectJar; + public static BlockHive hive; public static BlockMagicApiary magicApiary; public static BlockManaAuraProvider manaAuraProvider; public static BlockVisAuraProvider visAuraProvider; - - public static ItemComb combs; - public static ItemWax wax; - public static ItemPropolis propolis; - public static ItemDrop drops; - public static ItemPollen pollen; - public static ItemMiscResources miscResources; - public static ItemFood jellyBaby; - public static Item manasteelScoop; - public static Item thaumiumScoop; - public static Item manasteelGrafter; - public static Item thaumiumGrafter; - public static ItemNugget nuggets; - public static ItemMoonDial moonDial; - public static ItemMysteriousMagnet magnet; - - public static Item voidScoop; - public static Item voidGrafter; - - public static boolean disableMagnetSound; - - //----- Liquid Capsules -------------------- - public static ItemCapsule magicCapsule; - public static ItemCapsule voidCapsule; - - //----- Apiary Frames ---------------------- - public static ItemMagicHiveFrame hiveFrameMagic; - public static ItemMagicHiveFrame hiveFrameResilient; - public static ItemMagicHiveFrame hiveFrameGentle; - public static ItemMagicHiveFrame hiveFrameMetabolic; - public static ItemMagicHiveFrame hiveFrameNecrotic; - public static ItemMagicHiveFrame hiveFrameTemporal; - public static ItemMagicHiveFrame hiveFrameOblivion; - - //----- Backpacks ------------------------------------------ - public static Item thaumaturgeBackpackT1; - public static Item thaumaturgeBackpackT2; - public static BackpackDefinition thaumaturgeBackpackDef; - //----- Config State info ---------------------------------- - public static Configuration configuration; - - public Config(File configFile) - { - configuration = new Configuration(configFile); - configuration.load(); - processConfigFile(); - - forestryDebugEnabled = (new File("./config/forestry/DEBUG.ON")).exists(); - configuration.save(); - } + public static ItemComb combs; + public static ItemWax wax; + public static ItemPropolis propolis; + public static ItemDrop drops; + public static ItemPollen pollen; + public static ItemMiscResources miscResources; + public static ItemFood jellyBaby; + public static Item manasteelScoop; + public static Item thaumiumScoop; + public static Item manasteelGrafter; + public static Item thaumiumGrafter; + public static ItemNugget nuggets; + public static ItemMoonDial moonDial; + public static ItemMysteriousMagnet magnet; - @SubscribeEvent - public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) - { - if (event.modID.equalsIgnoreCase(VersionInfo.ModName)) - { - if (configuration.hasChanged()) - { - configuration.save(); - } - syncConfigs(); - } - } + public static Item voidScoop; + public static Item voidGrafter; - public void saveConfigs() - { - configuration.save(); - } + public static boolean disableMagnetSound; - public void setupBlocks() - { - enchantedEarth = new BlockEnchantedEarth(); - GameRegistry.registerBlock(enchantedEarth, "magicbees.enchantedEarth"); - - setupHives(); - - setupEffectJar(); - setupApiary(); - - setupBotaniaBlocks(); - setupThaumcraftBlocks(); - } - - public void setupItems() - { - combs = new ItemComb(); - wax = new ItemWax(); - propolis = new ItemPropolis(); - drops = new ItemDrop(); - miscResources = new ItemMiscResources(); - pollen = new ItemPollen(); - moonDial = new ItemMoonDial(); - setupJellyBaby(); - setupNuggets(); - setupMysteriousMagnet(); - setupFrames(); - magicCapsule = new ItemCapsule(CapsuleType.MAGIC, capsuleStackSizeMax); - voidCapsule = new ItemCapsule(CapsuleType.VOID, capsuleStackSizeMax); - - setupThaumcraftItems(); - setupBotaniaItems(); - - setupOreDictionaryEntries(); - setupMiscForestryItemHooks(); - } + // ----- Liquid Capsules -------------------- + public static ItemCapsule magicCapsule; + public static ItemCapsule voidCapsule; - private void processConfigFile() - { - // Pull config from Forestry via reflection - Field f; - try - { - f = Class.forName("forestry.core.config.Config").getField("enableParticleFX"); - drawParticleEffects = f.getBoolean(null); - } - catch (Exception e) - { - LogHelper.warn("Failed to retrieve Forestry's bee particle FX setting. This is not critical, but should be reported so it can be fixed."); - LogHelper.debug(e); - } + // ----- Apiary Frames ---------------------- + public static ItemMagicHiveFrame hiveFrameMagic; + public static ItemMagicHiveFrame hiveFrameResilient; + public static ItemMagicHiveFrame hiveFrameGentle; + public static ItemMagicHiveFrame hiveFrameMetabolic; + public static ItemMagicHiveFrame hiveFrameNecrotic; + public static ItemMagicHiveFrame hiveFrameTemporal; + public static ItemMagicHiveFrame hiveFrameOblivion; - syncConfigs(); - } - - private void syncConfigs() { - doGeneralConfigs(); - doModuleConfigs(); - doDebugConfigs(); - } + // ----- Backpacks ------------------------------------------ + public static Item thaumaturgeBackpackT1; + public static Item thaumaturgeBackpackT2; + public static BackpackDefinition thaumaturgeBackpackDef; - private void doDebugConfigs() { - Property p; - p = configuration.get(CATEGORY_DEBUG, "logHiveSpawns", false); - p.comment = "Enable to see exact locations of MagicBees hive spawns."; - logHiveSpawns = p.getBoolean(); - } + // ----- Config State info ---------------------------------- + public static Configuration configuration; - private void doModuleConfigs() { - Property p; - //Modules - p = configuration.get(CATEGORY_MODULES, "ArsMagica", true); - arsMagicaActive = p.getBoolean(); + public Config(File configFile) { + configuration = new Configuration(configFile); + configuration.load(); + processConfigFile(); - p = configuration.get(CATEGORY_MODULES, "BloodMagic", true); - bloodMagicActive = p.getBoolean(); + forestryDebugEnabled = (new File("./config/forestry/DEBUG.ON")).exists(); + configuration.save(); + } - p = configuration.get(CATEGORY_MODULES, "EquivalentExchange", true); - equivalentExchangeActive = p.getBoolean(); + @SubscribeEvent + public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) { + if (event.modID.equalsIgnoreCase(VersionInfo.ModName)) { + if (configuration.hasChanged()) { + configuration.save(); + } + syncConfigs(); + } + } - p = configuration.get(CATEGORY_MODULES, "ExtraBees", true); - extraBeesActive = p.getBoolean(); + public void saveConfigs() { + configuration.save(); + } - p = configuration.get(CATEGORY_MODULES, "RedstoneArsenal", true); - redstoneArsenalActive = p.getBoolean(); + public void setupBlocks() { + enchantedEarth = new BlockEnchantedEarth(); + GameRegistry.registerBlock(enchantedEarth, "magicbees.enchantedEarth"); - p = configuration.get(CATEGORY_MODULES, "Thaumcraft", true); - thaumcraftActive = p.getBoolean(); + setupHives(); - p = configuration.get(CATEGORY_MODULES, "ThermalExpansion", true); - thermalFoundationActive = p.getBoolean(); - - p = configuration.get(CATEGORY_MODULES, "Botania", true); - botaniaActive = p.getBoolean(); - BotaniaHelper.doBotaniaModuleConfigs(configuration); - - p = configuration.get(CATEGORY_MODULES, "AppliedEnergistics2", true); - ae2Active = p.getBoolean(); - } + setupEffectJar(); + setupApiary(); - private void doGeneralConfigs() { - Property p; - p = configuration.get(CATEGORY_GENERAL, "backpack.thaumaturge.active", true); - p.comment = "Set to false to disable the Thaumaturge backpack"; - thaumaturgeBackpackActive = p.getBoolean(true); + setupBotaniaBlocks(); + setupThaumcraftBlocks(); + } - p = configuration.get(CATEGORY_GENERAL, "backpack.thaumaturge.additionalItems", ""); - p.comment = "Add additional items to the Thaumaturge's Backpack." + - "\n Format is the same as Forestry's: id:meta;id;id:meta (etc)"; - thaumaturgeExtraItems = p.getString(); - - p = configuration.get(CATEGORY_GENERAL, "backpack.forestry.addThaumcraftItems", true); - p.comment = "Set to true if you want MagicBees to add several Thaumcraft blocks & items to Forestry backpacks." + - "\n Set to false to disable."; - addThaumcraftItemsToBackpacks = p.getBoolean(true); - - p = configuration.get(CATEGORY_GENERAL, "capsuleStackSize", 64); - p.comment = "Allows you to edit the stack size of the capsules in MagicBees if using GregTech, \n" + - "or the reduced capsule size in Forestry & Railcraft. Default: 64"; - capsuleStackSizeMax = p.getInt(); - - p = configuration.get(CATEGORY_GENERAL, "disableVersionNotification", false); - p.comment = "Set to true to stop Magic Bees from notifying you when new updates are available. (Does not supress critical updates)"; - disableUpdateNotification = p.getBoolean(false); - - p = configuration.get(CATEGORY_GENERAL, "areMagicPlanksFlammable", false); - p.comment = "Set to true to allow Greatwood & Silverwood planks to burn in a fire."; - areMagicPlanksFlammable = p.getBoolean(false); - - p = configuration.get(CATEGORY_GENERAL, "useImpregnatedStickInTools", false); - p.comment = "Set to true to make Thaumium Grafter & Scoop require impregnated sticks in the recipe."; - useImpregnatedStickInTools = p.getBoolean(false); + public void setupItems() { + combs = new ItemComb(); + wax = new ItemWax(); + propolis = new ItemPropolis(); + drops = new ItemDrop(); + miscResources = new ItemMiscResources(); + pollen = new ItemPollen(); + moonDial = new ItemMoonDial(); + setupJellyBaby(); + setupNuggets(); + setupMysteriousMagnet(); + setupFrames(); + magicCapsule = new ItemCapsule(CapsuleType.MAGIC, capsuleStackSizeMax); + voidCapsule = new ItemCapsule(CapsuleType.VOID, capsuleStackSizeMax); - p = configuration.get(CATEGORY_GENERAL, "thaumcraftSaplingDroprate", 0.1, "The chance for thaumcraft saplings using the thaumium grafter", 0.0, 1.0); - thaumcraftSaplingDroprate = p.getDouble(0.1); - - p = configuration.get(CATEGORY_GENERAL, "thaumcraftNodeMaxSize", 256, "The maximum aspect amount Nexus bees can grow a node to", 64, 32767); - thaumcraftNodeMaxSize = p.getInt(256); + setupThaumcraftItems(); + setupBotaniaItems(); - p = configuration.get(CATEGORY_GENERAL, "moonDialShowText", false); - p.comment = "set to true to show the current moon phase in mouse-over text."; - moonDialShowsPhaseInText = p.getBoolean(false); - - p = configuration.get(CATEGORY_GENERAL, "doSpecialHiveGen", true); - p.comment = "Set to false if you hate fun and do not want special hives generating in Magic biomes."; - doSpecialHiveGen = p.getBoolean(true); + setupOreDictionaryEntries(); + setupMiscForestryItemHooks(); + } - p = configuration.get(CATEGORY_GENERAL, "magnetRangeBase", 3.0); - p.comment = "Base range (in blocks) of the Mysterious Magnet"; - magnetBaseRange = (float)p.getDouble(3.0); - - p = configuration.get(CATEGORY_GENERAL, "magnetRangeMultiplier", 0.75); - p.comment = "Range multiplier per level of the Mysterious Magnet. Total range = base range + level * multiplier"; - magnetLevelMultiplier = (float)p.getDouble(0.75); - - p = configuration.get(CATEGORY_GENERAL, "magnetMaximumLevel", 8); - p.comment = "Maximum level of the magnets."; - magnetMaxLevel = p.getInt(); - - p = configuration.get(CATEGORY_GENERAL, "aromaticLumpSwarmerRate", 95); - p.comment = "Aromatic lump swarmer rate. Final value is X/1000. 0 will disable, values outside of [0,1000] will be clamped to range. Default: 95"; - aromaticLumpSwarmerRate = p.getInt(); - - p = configuration.get(CATEGORY_CLIENT, "disableMagnetSound", false); - p.comment = "set to true to disable the magnet from making noise on item pickup"; - disableMagnetSound = p.getBoolean(); - } + private void processConfigFile() { + // Pull config from Forestry via reflection + Field f; + try { + f = Class.forName("forestry.core.config.Config").getField("enableParticleFX"); + drawParticleEffects = f.getBoolean(null); + } catch (Exception e) { + LogHelper.warn( + "Failed to retrieve Forestry's bee particle FX setting. This is not critical, but should be reported so it can be fixed."); + LogHelper.debug(e); + } - private void setupEffectJar() { - effectJar = new BlockEffectJar(); - GameRegistry.registerBlock(effectJar, "effectJar"); - GameRegistry.registerTileEntity(TileEntityEffectJar.class, TileEntityEffectJar.tileEntityName); - } - - private void setupApiary() { + syncConfigs(); + } + + private void syncConfigs() { + doGeneralConfigs(); + doModuleConfigs(); + doDebugConfigs(); + } + + private void doDebugConfigs() { + Property p; + p = configuration.get(CATEGORY_DEBUG, "logHiveSpawns", false); + p.comment = "Enable to see exact locations of MagicBees hive spawns."; + logHiveSpawns = p.getBoolean(); + } + + private void doModuleConfigs() { + Property p; + // Modules + p = configuration.get(CATEGORY_MODULES, "ArsMagica", true); + arsMagicaActive = p.getBoolean(); + + p = configuration.get(CATEGORY_MODULES, "BloodMagic", true); + bloodMagicActive = p.getBoolean(); + + p = configuration.get(CATEGORY_MODULES, "EquivalentExchange", true); + equivalentExchangeActive = p.getBoolean(); + + p = configuration.get(CATEGORY_MODULES, "ExtraBees", true); + extraBeesActive = p.getBoolean(); + + p = configuration.get(CATEGORY_MODULES, "RedstoneArsenal", true); + redstoneArsenalActive = p.getBoolean(); + + p = configuration.get(CATEGORY_MODULES, "Thaumcraft", true); + thaumcraftActive = p.getBoolean(); + + p = configuration.get(CATEGORY_MODULES, "ThermalExpansion", true); + thermalFoundationActive = p.getBoolean(); + + p = configuration.get(CATEGORY_MODULES, "Botania", true); + botaniaActive = p.getBoolean(); + BotaniaHelper.doBotaniaModuleConfigs(configuration); + + p = configuration.get(CATEGORY_MODULES, "AppliedEnergistics2", true); + ae2Active = p.getBoolean(); + } + + private void doGeneralConfigs() { + Property p; + p = configuration.get(CATEGORY_GENERAL, "backpack.thaumaturge.active", true); + p.comment = "Set to false to disable the Thaumaturge backpack"; + thaumaturgeBackpackActive = p.getBoolean(true); + + p = configuration.get(CATEGORY_GENERAL, "backpack.thaumaturge.additionalItems", ""); + p.comment = "Add additional items to the Thaumaturge's Backpack." + + "\n Format is the same as Forestry's: id:meta;id;id:meta (etc)"; + thaumaturgeExtraItems = p.getString(); + + p = configuration.get(CATEGORY_GENERAL, "backpack.forestry.addThaumcraftItems", true); + p.comment = "Set to true if you want MagicBees to add several Thaumcraft blocks & items to Forestry backpacks." + + "\n Set to false to disable."; + addThaumcraftItemsToBackpacks = p.getBoolean(true); + + p = configuration.get(CATEGORY_GENERAL, "capsuleStackSize", 64); + p.comment = "Allows you to edit the stack size of the capsules in MagicBees if using GregTech, \n" + + "or the reduced capsule size in Forestry & Railcraft. Default: 64"; + capsuleStackSizeMax = p.getInt(); + + p = configuration.get(CATEGORY_GENERAL, "disableVersionNotification", false); + p.comment = + "Set to true to stop Magic Bees from notifying you when new updates are available. (Does not supress critical updates)"; + disableUpdateNotification = p.getBoolean(false); + + p = configuration.get(CATEGORY_GENERAL, "areMagicPlanksFlammable", false); + p.comment = "Set to true to allow Greatwood & Silverwood planks to burn in a fire."; + areMagicPlanksFlammable = p.getBoolean(false); + + p = configuration.get(CATEGORY_GENERAL, "useImpregnatedStickInTools", false); + p.comment = "Set to true to make Thaumium Grafter & Scoop require impregnated sticks in the recipe."; + useImpregnatedStickInTools = p.getBoolean(false); + + p = configuration.get( + CATEGORY_GENERAL, + "thaumcraftSaplingDroprate", + 0.1, + "The chance for thaumcraft saplings using the thaumium grafter", + 0.0, + 1.0); + thaumcraftSaplingDroprate = p.getDouble(0.1); + + p = configuration.get( + CATEGORY_GENERAL, + "thaumcraftNodeMaxSize", + 256, + "The maximum aspect amount Nexus bees can grow a node to", + 64, + 32767); + thaumcraftNodeMaxSize = p.getInt(256); + + p = configuration.get(CATEGORY_GENERAL, "moonDialShowText", false); + p.comment = "set to true to show the current moon phase in mouse-over text."; + moonDialShowsPhaseInText = p.getBoolean(false); + + p = configuration.get(CATEGORY_GENERAL, "doSpecialHiveGen", true); + p.comment = "Set to false if you hate fun and do not want special hives generating in Magic biomes."; + doSpecialHiveGen = p.getBoolean(true); + + p = configuration.get(CATEGORY_GENERAL, "magnetRangeBase", 3.0); + p.comment = "Base range (in blocks) of the Mysterious Magnet"; + magnetBaseRange = (float) p.getDouble(3.0); + + p = configuration.get(CATEGORY_GENERAL, "magnetRangeMultiplier", 0.75); + p.comment = + "Range multiplier per level of the Mysterious Magnet. Total range = base range + level * multiplier"; + magnetLevelMultiplier = (float) p.getDouble(0.75); + + p = configuration.get(CATEGORY_GENERAL, "magnetMaximumLevel", 8); + p.comment = "Maximum level of the magnets."; + magnetMaxLevel = p.getInt(); + + p = configuration.get(CATEGORY_GENERAL, "aromaticLumpSwarmerRate", 95); + p.comment = + "Aromatic lump swarmer rate. Final value is X/1000. 0 will disable, values outside of [0,1000] will be clamped to range. Default: 95"; + aromaticLumpSwarmerRate = p.getInt(); + + p = configuration.get(CATEGORY_CLIENT, "disableMagnetSound", false); + p.comment = "set to true to disable the magnet from making noise on item pickup"; + disableMagnetSound = p.getBoolean(); + } + + private void setupEffectJar() { + effectJar = new BlockEffectJar(); + GameRegistry.registerBlock(effectJar, "effectJar"); + GameRegistry.registerTileEntity(TileEntityEffectJar.class, TileEntityEffectJar.tileEntityName); + } + + private void setupApiary() { magicApiary = new BlockMagicApiary(); GameRegistry.registerBlock(magicApiary, "magicApiary"); GameRegistry.registerTileEntity(TileEntityMagicApiary.class, TileEntityMagicApiary.tileEntityName); - } + } - private void setupFrames() { - hiveFrameMagic = new ItemMagicHiveFrame(HiveFrameType.MAGIC); - hiveFrameResilient = new ItemMagicHiveFrame(HiveFrameType.RESILIENT); - hiveFrameGentle = new ItemMagicHiveFrame(HiveFrameType.GENTLE); - hiveFrameMetabolic = new ItemMagicHiveFrame(HiveFrameType.METABOLIC); - hiveFrameNecrotic = new ItemMagicHiveFrame(HiveFrameType.NECROTIC); - hiveFrameTemporal = new ItemMagicHiveFrame(HiveFrameType.TEMPORAL); - hiveFrameOblivion = new ItemMagicHiveFrame(HiveFrameType.OBLIVION); - - ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_CORRIDOR, new WeightedRandomChestContent(new ItemStack(hiveFrameOblivion), 1, 1, 18)); - ChestGenHooks.addItem(ChestGenHooks.STRONGHOLD_LIBRARY, new WeightedRandomChestContent(new ItemStack(hiveFrameOblivion), 1, 3, 23)); - } + private void setupFrames() { + hiveFrameMagic = new ItemMagicHiveFrame(HiveFrameType.MAGIC); + hiveFrameResilient = new ItemMagicHiveFrame(HiveFrameType.RESILIENT); + hiveFrameGentle = new ItemMagicHiveFrame(HiveFrameType.GENTLE); + hiveFrameMetabolic = new ItemMagicHiveFrame(HiveFrameType.METABOLIC); + hiveFrameNecrotic = new ItemMagicHiveFrame(HiveFrameType.NECROTIC); + hiveFrameTemporal = new ItemMagicHiveFrame(HiveFrameType.TEMPORAL); + hiveFrameOblivion = new ItemMagicHiveFrame(HiveFrameType.OBLIVION); - private void setupHives() { - hive = new BlockHive(); - GameRegistry.registerBlock(hive, ItemMagicHive.class, "hive"); + ChestGenHooks.addItem( + ChestGenHooks.STRONGHOLD_CORRIDOR, + new WeightedRandomChestContent(new ItemStack(hiveFrameOblivion), 1, 1, 18)); + ChestGenHooks.addItem( + ChestGenHooks.STRONGHOLD_LIBRARY, + new WeightedRandomChestContent(new ItemStack(hiveFrameOblivion), 1, 3, 23)); + } - for (HiveType t : HiveType.values()) - { - hive.setHarvestLevel("scoop", 0, t.ordinal()); - } - } + private void setupHives() { + hive = new BlockHive(); + GameRegistry.registerBlock(hive, ItemMagicHive.class, "hive"); - private void setupMysteriousMagnet() { - magnet = new ItemMysteriousMagnet(); - GameRegistry.registerItem(magnet, "magnet", CommonProxy.DOMAIN); - } + for (HiveType t : HiveType.values()) { + hive.setHarvestLevel("scoop", 0, t.ordinal()); + } + } - private void setupJellyBaby() { - jellyBaby = new ItemFood(1, false).setAlwaysEdible().setPotionEffect(Potion.moveSpeed.id, 5, 1, 1f); - jellyBaby.setUnlocalizedName(CommonProxy.DOMAIN + ":jellyBabies").setTextureName(CommonProxy.DOMAIN + ":jellyBabies"); - GameRegistry.registerItem(jellyBaby, "jellyBabies"); - } + private void setupMysteriousMagnet() { + magnet = new ItemMysteriousMagnet(); + GameRegistry.registerItem(magnet, "magnet", CommonProxy.DOMAIN); + } - private void setupNuggets() { - nuggets = new ItemNugget(); - String item; - for (NuggetType type : NuggetType.values()) { - LogHelper.info("Found nugget of type " + type.toString()); - item = type.toString().toLowerCase(); - item = Character.toString(item.charAt(0)).toUpperCase() + item.substring(1); - if (OreDictionary.getOres("ingot" + item).size() <= 0) { - if (OreDictionary.getOres("nugget" + item).size() <= 0) { - LogHelper.info("Disabled nugget " + type.toString()); - type.setInactive(); - } - } - } + private void setupJellyBaby() { + jellyBaby = new ItemFood(1, false).setAlwaysEdible().setPotionEffect(Potion.moveSpeed.id, 5, 1, 1f); + jellyBaby + .setUnlocalizedName(CommonProxy.DOMAIN + ":jellyBabies") + .setTextureName(CommonProxy.DOMAIN + ":jellyBabies"); + GameRegistry.registerItem(jellyBaby, "jellyBabies"); + } - GameRegistry.registerItem(nuggets, "beeNugget"); - } + private void setupNuggets() { + nuggets = new ItemNugget(); + String item; + for (NuggetType type : NuggetType.values()) { + LogHelper.info("Found nugget of type " + type.toString()); + item = type.toString().toLowerCase(); + item = Character.toString(item.charAt(0)).toUpperCase() + item.substring(1); + if (OreDictionary.getOres("ingot" + item).size() <= 0) { + if (OreDictionary.getOres("nugget" + item).size() <= 0) { + LogHelper.info("Disabled nugget " + type.toString()); + type.setInactive(); + } + } + } - private void setupOreDictionaryEntries() { - for (int level = 0; level <= 8; level++) { - OreDictionary.registerOre("mb.magnet.level" + level, new ItemStack(magnet, 1, level * 2)); - OreDictionary.registerOre("mb.magnet.level" + level, new ItemStack(magnet, 1, level * 2 + 1)); - } - - OreDictionary.registerOre("beeComb", new ItemStack(combs, 1, OreDictionary.WILDCARD_VALUE)); - OreDictionary.registerOre("waxMagical", wax.getStackForType(WaxType.MAGIC)); - OreDictionary.registerOre("waxMagical", wax.getStackForType(WaxType.AMNESIC)); - OreDictionary.registerOre("nuggetIron", nuggets.getStackForType(NuggetType.IRON)); - OreDictionary.registerOre("nuggetCopper", nuggets.getStackForType(NuggetType.COPPER)); - OreDictionary.registerOre("nuggetTin", nuggets.getStackForType(NuggetType.TIN)); - OreDictionary.registerOre("nuggetSilver", nuggets.getStackForType(NuggetType.SILVER)); - OreDictionary.registerOre("nuggetLead", nuggets.getStackForType(NuggetType.LEAD)); - OreDictionary.registerOre("nuggetDiamond", nuggets.getStackForType(NuggetType.DIAMOND)); - OreDictionary.registerOre("nuggetEmerald", nuggets.getStackForType(NuggetType.EMERALD)); - OreDictionary.registerOre("nuggetApatite", nuggets.getStackForType(NuggetType.APATITE)); - } - - private void setupBotaniaItems() { - if (BotaniaHelper.isActive()) { - manasteelScoop = new ItemManasteelScoop(); - GameRegistry.registerItem(manasteelScoop, manasteelScoop.getUnlocalizedName(), CommonProxy.DOMAIN); - - manasteelGrafter = new ItemManasteelGrafter(); - GameRegistry.registerItem(manasteelGrafter, manasteelGrafter.getUnlocalizedName(), CommonProxy.DOMAIN); - } - } - - private void setupBotaniaBlocks() { - if (BotaniaHelper.isActive()) { - manaAuraProvider = new BlockManaAuraProvider(); - GameRegistry.registerBlock(manaAuraProvider, "manaAuraProvider"); - GameRegistry.registerTileEntity(TileEntityManaAuraProvider.class, "manaAuraProvider"); - } - } - - private void setupThaumcraftBlocks() { - if (ThaumcraftHelper.isActive()) { - visAuraProvider = new BlockVisAuraProvider(); - GameRegistry.registerBlock(visAuraProvider, "visAuraProvider"); - GameRegistry.registerTileEntity(TileEntityVisAuraProvider.class, "visAuraProvider"); - } - } + GameRegistry.registerItem(nuggets, "beeNugget"); + } + + private void setupOreDictionaryEntries() { + for (int level = 0; level <= 8; level++) { + OreDictionary.registerOre("mb.magnet.level" + level, new ItemStack(magnet, 1, level * 2)); + OreDictionary.registerOre("mb.magnet.level" + level, new ItemStack(magnet, 1, level * 2 + 1)); + } + + OreDictionary.registerOre("beeComb", new ItemStack(combs, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("waxMagical", wax.getStackForType(WaxType.MAGIC)); + OreDictionary.registerOre("waxMagical", wax.getStackForType(WaxType.AMNESIC)); + OreDictionary.registerOre("nuggetIron", nuggets.getStackForType(NuggetType.IRON)); + OreDictionary.registerOre("nuggetCopper", nuggets.getStackForType(NuggetType.COPPER)); + OreDictionary.registerOre("nuggetTin", nuggets.getStackForType(NuggetType.TIN)); + OreDictionary.registerOre("nuggetSilver", nuggets.getStackForType(NuggetType.SILVER)); + OreDictionary.registerOre("nuggetLead", nuggets.getStackForType(NuggetType.LEAD)); + OreDictionary.registerOre("nuggetDiamond", nuggets.getStackForType(NuggetType.DIAMOND)); + OreDictionary.registerOre("nuggetEmerald", nuggets.getStackForType(NuggetType.EMERALD)); + OreDictionary.registerOre("nuggetApatite", nuggets.getStackForType(NuggetType.APATITE)); + } + + private void setupBotaniaItems() { + if (BotaniaHelper.isActive()) { + manasteelScoop = new ItemManasteelScoop(); + GameRegistry.registerItem(manasteelScoop, manasteelScoop.getUnlocalizedName(), CommonProxy.DOMAIN); + + manasteelGrafter = new ItemManasteelGrafter(); + GameRegistry.registerItem(manasteelGrafter, manasteelGrafter.getUnlocalizedName(), CommonProxy.DOMAIN); + } + } + + private void setupBotaniaBlocks() { + if (BotaniaHelper.isActive()) { + manaAuraProvider = new BlockManaAuraProvider(); + GameRegistry.registerBlock(manaAuraProvider, "manaAuraProvider"); + GameRegistry.registerTileEntity(TileEntityManaAuraProvider.class, "manaAuraProvider"); + } + } + + private void setupThaumcraftBlocks() { + if (ThaumcraftHelper.isActive()) { + visAuraProvider = new BlockVisAuraProvider(); + GameRegistry.registerBlock(visAuraProvider, "visAuraProvider"); + GameRegistry.registerTileEntity(TileEntityVisAuraProvider.class, "visAuraProvider"); + } + } + + private void setupThaumcraftItems() { + if (ThaumcraftHelper.isActive()) { + setupThaumcraftBackpacks(); - private void setupThaumcraftItems() { - if (ThaumcraftHelper.isActive()) - { - setupThaumcraftBackpacks(); - // Items - thaumiumScoop = new ItemThaumiumScoop(); - GameRegistry.registerItem(thaumiumScoop, thaumiumScoop.getUnlocalizedName(), CommonProxy.DOMAIN); - - thaumiumGrafter = new ItemThaumiumGrafter(); - GameRegistry.registerItem(thaumiumGrafter, thaumiumGrafter.getUnlocalizedName(), CommonProxy.DOMAIN); - - voidScoop = new ItemVoidScoop(); - GameRegistry.registerItem(voidScoop, voidScoop.getUnlocalizedName(), CommonProxy.DOMAIN); - - voidGrafter = new ItemVoidGrafter(); - GameRegistry.registerItem(voidGrafter, voidGrafter.getUnlocalizedName(), CommonProxy.DOMAIN); - - - - - - } - } - - private void setupThaumcraftBackpacks() { - try { - // 0x8700C6 is a purple-y colour, which is associated with Thaumcraft. - String backpackName = LocalizationManager.getLocalizedString("backpack.thaumaturge"); - BackpackDefinition def = new BackpackDefinition("thaumaturge", backpackName, 0x8700C6); - thaumaturgeBackpackT1 = BackpackManager.backpackInterface.addBackpack(def, EnumBackpackType.T1); - thaumaturgeBackpackT1.setUnlocalizedName("backpack.thaumaturgeT1"); - GameRegistry.registerItem(thaumaturgeBackpackT1, "backpack.thaumaturgeT1"); - thaumaturgeBackpackT2 = BackpackManager.backpackInterface.addBackpack(def, EnumBackpackType.T2); - thaumaturgeBackpackT2.setUnlocalizedName("backpack.thaumaturgeT2"); - GameRegistry.registerItem(thaumaturgeBackpackT2, "backpack.thaumaturgeT2"); - // Add additional items from configs to backpack. - if (thaumaturgeExtraItems.length() > 0) { - LogHelper.info("Attempting to add extra items to Thaumaturge's backpack. If you get an error, check your MagicBees.conf."); - FMLInterModComms.sendMessage("Forestry", "add-backpack-items", "thaumaturge@" + thaumaturgeExtraItems); - } - } - catch (Exception e) { - LogHelper.error("MagicBees encountered a problem during loading!"); - LogHelper.error("Could not register backpacks via Forestry. Check your FML Client log and see if Forestry crashed silently."); - } - } + thaumiumScoop = new ItemThaumiumScoop(); + GameRegistry.registerItem(thaumiumScoop, thaumiumScoop.getUnlocalizedName(), CommonProxy.DOMAIN); - private void setupMiscForestryItemHooks() { - // Make Aromatic Lumps a swarmer inducer. Chance is /1000. - if (aromaticLumpSwarmerRate > 0) { - aromaticLumpSwarmerRate = (aromaticLumpSwarmerRate >= 1000) ? 1000: aromaticLumpSwarmerRate; - BeeManager.inducers.put(miscResources.getStackForType(ResourceType.AROMATIC_LUMP), aromaticLumpSwarmerRate); - } - } + thaumiumGrafter = new ItemThaumiumGrafter(); + GameRegistry.registerItem(thaumiumGrafter, thaumiumGrafter.getUnlocalizedName(), CommonProxy.DOMAIN); + + voidScoop = new ItemVoidScoop(); + GameRegistry.registerItem(voidScoop, voidScoop.getUnlocalizedName(), CommonProxy.DOMAIN); + + voidGrafter = new ItemVoidGrafter(); + GameRegistry.registerItem(voidGrafter, voidGrafter.getUnlocalizedName(), CommonProxy.DOMAIN); + } + } + + private void setupThaumcraftBackpacks() { + try { + // 0x8700C6 is a purple-y colour, which is associated with Thaumcraft. + String backpackName = LocalizationManager.getLocalizedString("backpack.thaumaturge"); + BackpackDefinition def = new BackpackDefinition("thaumaturge", backpackName, 0x8700C6); + thaumaturgeBackpackT1 = BackpackManager.backpackInterface.addBackpack(def, EnumBackpackType.T1); + thaumaturgeBackpackT1.setUnlocalizedName("backpack.thaumaturgeT1"); + GameRegistry.registerItem(thaumaturgeBackpackT1, "backpack.thaumaturgeT1"); + thaumaturgeBackpackT2 = BackpackManager.backpackInterface.addBackpack(def, EnumBackpackType.T2); + thaumaturgeBackpackT2.setUnlocalizedName("backpack.thaumaturgeT2"); + GameRegistry.registerItem(thaumaturgeBackpackT2, "backpack.thaumaturgeT2"); + // Add additional items from configs to backpack. + if (thaumaturgeExtraItems.length() > 0) { + LogHelper.info( + "Attempting to add extra items to Thaumaturge's backpack. If you get an error, check your MagicBees.conf."); + FMLInterModComms.sendMessage("Forestry", "add-backpack-items", "thaumaturge@" + thaumaturgeExtraItems); + } + } catch (Exception e) { + LogHelper.error("MagicBees encountered a problem during loading!"); + LogHelper.error( + "Could not register backpacks via Forestry. Check your FML Client log and see if Forestry crashed silently."); + } + } + + private void setupMiscForestryItemHooks() { + // Make Aromatic Lumps a swarmer inducer. Chance is /1000. + if (aromaticLumpSwarmerRate > 0) { + aromaticLumpSwarmerRate = (aromaticLumpSwarmerRate >= 1000) ? 1000 : aromaticLumpSwarmerRate; + BeeManager.inducers.put(miscResources.getStackForType(ResourceType.AROMATIC_LUMP), aromaticLumpSwarmerRate); + } + } } diff --git a/src/main/java/magicbees/main/MagicBees.java b/src/main/java/magicbees/main/MagicBees.java index 35e24e3..ea5a0ce 100644 --- a/src/main/java/magicbees/main/MagicBees.java +++ b/src/main/java/magicbees/main/MagicBees.java @@ -1,13 +1,5 @@ package magicbees.main; -import magicbees.bees.BeeManager; -import magicbees.client.gui.GUIHandler; -import magicbees.main.utils.CraftingManager; -import magicbees.main.utils.IMCManager; -import magicbees.main.utils.LogHelper; -import magicbees.main.utils.VersionInfo; -import magicbees.main.utils.compat.ModHelperManager; -import magicbees.main.utils.net.NetworkEventHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; @@ -18,87 +10,88 @@ import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; +import magicbees.bees.BeeManager; +import magicbees.client.gui.GUIHandler; +import magicbees.main.utils.CraftingManager; +import magicbees.main.utils.IMCManager; +import magicbees.main.utils.LogHelper; +import magicbees.main.utils.VersionInfo; +import magicbees.main.utils.compat.ModHelperManager; +import magicbees.main.utils.net.NetworkEventHandler; @Mod( - modid = VersionInfo.ModName, - name = "Magic Bees", - version = VersionInfo.Version, - dependencies = VersionInfo.Depends, - guiFactory = VersionInfo.GUI_FACTORY_CLASS -) -public class MagicBees -{ + modid = VersionInfo.ModName, + name = "Magic Bees", + version = VersionInfo.Version, + dependencies = VersionInfo.Depends, + guiFactory = VersionInfo.GUI_FACTORY_CLASS) +public class MagicBees { - @Mod.Instance(VersionInfo.ModName) - public static MagicBees object; + @Mod.Instance(VersionInfo.ModName) + public static MagicBees object; - @SidedProxy(serverSide = "magicbees.main.CommonProxy", clientSide = "magicbees.main.ClientProxy") - public static CommonProxy proxy; + @SidedProxy(serverSide = "magicbees.main.CommonProxy", clientSide = "magicbees.main.ClientProxy") + public static CommonProxy proxy; - public GUIHandler guiHandler; - private Config modConfig; - public final NetworkEventHandler netHandler = new NetworkEventHandler(); + public GUIHandler guiHandler; + private Config modConfig; + public final NetworkEventHandler netHandler = new NetworkEventHandler(); - @Mod.EventHandler - public void preInit(FMLPreInitializationEvent event) - { - LogHelper.info("Preinit started"); - this.modConfig = new Config(event.getSuggestedConfigurationFile()); - FMLCommonHandler.instance().bus().register(modConfig); + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent event) { + LogHelper.info("Preinit started"); + this.modConfig = new Config(event.getSuggestedConfigurationFile()); + FMLCommonHandler.instance().bus().register(modConfig); - // Compatibility Helpers setup time. - ModHelperManager.preInit(); - - this.modConfig.setupBlocks(); - this.modConfig.setupItems(); + // Compatibility Helpers setup time. + ModHelperManager.preInit(); - LogHelper.info("Preinit completed"); - } + this.modConfig.setupBlocks(); + this.modConfig.setupItems(); - @Mod.EventHandler - public void init(FMLInitializationEvent event) - { - ModHelperManager.init(); - LogHelper.info("Init completed"); - - BeeManager.getBeeRoot(); - BeeManager.setupAlleles(); - } + LogHelper.info("Preinit completed"); + } - @Mod.EventHandler - public void postInit(FMLPostInitializationEvent event) - { - ModHelperManager.postInit(); - - BeeManager.lateBeeInit(); + @Mod.EventHandler + public void init(FMLInitializationEvent event) { + ModHelperManager.init(); + LogHelper.info("Init completed"); - this.guiHandler = new GUIHandler(); - NetworkRegistry.INSTANCE.registerGuiHandler(this, this.guiHandler); + BeeManager.getBeeRoot(); + BeeManager.setupAlleles(); + } - proxy.registerRenderers(); + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent event) { + ModHelperManager.postInit(); - this.modConfig.saveConfigs(); + BeeManager.lateBeeInit(); - CraftingManager.setupCrafting(); - CraftingManager.registerLiquidContainers(); + this.guiHandler = new GUIHandler(); + NetworkRegistry.INSTANCE.registerGuiHandler(this, this.guiHandler); - VersionInfo.doVersionCheck(); - LogHelper.info("Postinit completed"); - } + proxy.registerRenderers(); - @Mod.EventHandler - public void handleIMCMessage(IMCEvent event) - { - IMCManager.handle(event); - } - - @Mod.EventHandler - public void handleMissingMapping(FMLMissingMappingsEvent event) { - for (MissingMapping mapping : event.get()) { - // TODO: ... maybe not this. - LogHelper.info(String.format("Missing mapping: %s - ignoring.", mapping.name)); - mapping.ignore(); - } - } + this.modConfig.saveConfigs(); + CraftingManager.setupCrafting(); + CraftingManager.registerLiquidContainers(); + + VersionInfo.doVersionCheck(); + LogHelper.info("Postinit completed"); + } + + @Mod.EventHandler + public void handleIMCMessage(IMCEvent event) { + IMCManager.handle(event); + } + + @Mod.EventHandler + public void handleMissingMapping(FMLMissingMappingsEvent event) { + for (MissingMapping mapping : event.get()) { + // TODO: ... maybe not this. + LogHelper.info(String.format("Missing mapping: %s - ignoring.", mapping.name)); + mapping.ignore(); + } + } } diff --git a/src/main/java/magicbees/main/utils/BlockInterface.java b/src/main/java/magicbees/main/utils/BlockInterface.java index 398d9da..a1cc6e7 100644 --- a/src/main/java/magicbees/main/utils/BlockInterface.java +++ b/src/main/java/magicbees/main/utils/BlockInterface.java @@ -3,15 +3,12 @@ package magicbees.main.utils; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; -public class BlockInterface -{ - public static Block getBlock(String item) - { - return GameRegistry.findBlock("Forestry", item); - } +public class BlockInterface { + public static Block getBlock(String item) { + return GameRegistry.findBlock("Forestry", item); + } - public static Block getBlock(String modId, String item) - { - return GameRegistry.findBlock(modId, item); - } + public static Block getBlock(String modId, String item) { + return GameRegistry.findBlock(modId, item); + } } diff --git a/src/main/java/magicbees/main/utils/BlockUtil.java b/src/main/java/magicbees/main/utils/BlockUtil.java index 493d1c3..d0c6b8c 100644 --- a/src/main/java/magicbees/main/utils/BlockUtil.java +++ b/src/main/java/magicbees/main/utils/BlockUtil.java @@ -2,77 +2,66 @@ package magicbees.main.utils; import java.util.ArrayList; import java.util.List; - import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; public class BlockUtil { - public static int getSurroundCount(World world, int x, int y, int z, Block blockType) - { - int surroundCount = 0; + public static int getSurroundCount(World world, int x, int y, int z, Block blockType) { + int surroundCount = 0; - if (canBlockReplaceAt(world, x + 1, y, z, blockType)) - { - ++surroundCount; - } + if (canBlockReplaceAt(world, x + 1, y, z, blockType)) { + ++surroundCount; + } - if (canBlockReplaceAt(world, x - 1, y, z, blockType)) - { - ++surroundCount; - } + if (canBlockReplaceAt(world, x - 1, y, z, blockType)) { + ++surroundCount; + } - if (canBlockReplaceAt(world, x, y + 1, z, blockType)) - { - ++surroundCount; - } + if (canBlockReplaceAt(world, x, y + 1, z, blockType)) { + ++surroundCount; + } - if (canBlockReplaceAt(world, x, y - 1, z, blockType)) - { - ++surroundCount; - } + if (canBlockReplaceAt(world, x, y - 1, z, blockType)) { + ++surroundCount; + } - if (canBlockReplaceAt(world, x, y, z + 1, blockType)) - { - ++surroundCount; - } + if (canBlockReplaceAt(world, x, y, z + 1, blockType)) { + ++surroundCount; + } - if (canBlockReplaceAt(world, x, y, z - 1, blockType)) - { - ++surroundCount; - } + if (canBlockReplaceAt(world, x, y, z - 1, blockType)) { + ++surroundCount; + } - return surroundCount; - } + return surroundCount; + } - public static boolean canBlockReplaceAt(World world, int x, int y, int z, Block target) - { - // don't cause new chunks to load - if (!world.blockExists(x, y, z)) - { - return true; - } - Block block = world.getBlock(x, y, z); - return block.isReplaceableOreGen(world, x, y, z, target); - } + public static boolean canBlockReplaceAt(World world, int x, int y, int z, Block target) { + // don't cause new chunks to load + if (!world.blockExists(x, y, z)) { + return true; + } + Block block = world.getBlock(x, y, z); + return block.isReplaceableOreGen(world, x, y, z, target); + } - public static List getChunksInSearchRange(World world, int xCoord, int zCoord, int searchRadius) { - List searchChunks = new ArrayList(); - int chunkRange = (int)Math.ceil(searchRadius / 16.0); - int minChunkX = xCoord / 16 - chunkRange; - int maxChunkX = xCoord / 16 + chunkRange; - int minChunkZ = zCoord / 16 - chunkRange; - int maxChunkZ = zCoord / 16 + chunkRange; - - for (int chunkX = minChunkX; chunkX <= maxChunkX; ++chunkX) { - for (int chunkZ = minChunkZ; chunkZ <= maxChunkZ; ++chunkZ) { + public static List getChunksInSearchRange(World world, int xCoord, int zCoord, int searchRadius) { + List searchChunks = new ArrayList(); + int chunkRange = (int) Math.ceil(searchRadius / 16.0); + int minChunkX = xCoord / 16 - chunkRange; + int maxChunkX = xCoord / 16 + chunkRange; + int minChunkZ = zCoord / 16 - chunkRange; + int maxChunkZ = zCoord / 16 + chunkRange; + + for (int chunkX = minChunkX; chunkX <= maxChunkX; ++chunkX) { + for (int chunkZ = minChunkZ; chunkZ <= maxChunkZ; ++chunkZ) { Chunk chunk = world.getChunkFromChunkCoords(chunkX, chunkZ); - if (chunk != null) - searchChunks.add(chunk); - } - } - - return searchChunks; - } + if (chunk != null) searchChunks.add(chunk); + } + } + + return searchChunks; + } } diff --git a/src/main/java/magicbees/main/utils/ChunkCoords.java b/src/main/java/magicbees/main/utils/ChunkCoords.java index d88d2b5..07ece5b 100644 --- a/src/main/java/magicbees/main/utils/ChunkCoords.java +++ b/src/main/java/magicbees/main/utils/ChunkCoords.java @@ -5,89 +5,85 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -public class ChunkCoords -{ - public final int dimension; - public final int x; - public final int y; - public final int z; - - public ChunkCoords(TileEntity entity) { - this(entity.getWorldObj(), entity.xCoord, entity.yCoord, entity.zCoord); - } - - public ChunkCoords(Entity entity) { - this(entity.worldObj, entity.chunkCoordX, entity.chunkCoordY, entity.chunkCoordZ); - } +public class ChunkCoords { + public final int dimension; + public final int x; + public final int y; + public final int z; - public ChunkCoords(World world, int xCoord, int yCoord, int zCoord) - { - this(world.provider.dimensionId, xCoord, yCoord, zCoord); - } - - public ChunkCoords(int dimId, int xCoord, int yCoord, int zCoord) - { - this.dimension = dimId; - this.x = xCoord; - this.y = yCoord; - this.z = zCoord; - } - - /** - * Adds chunk coords together & returns the result within the same dimension. - */ - public ChunkCoords add(ChunkCoords coords) { - return new ChunkCoords(coords.dimension, this.x + coords.x, this.y + coords.y, this.z + coords.z); - } - - /** - * Subtracts chunk coords (a.subtract(b) == a - b) & returns the result within the same dimension. - */ - public ChunkCoords subtract(ChunkCoords coords) { - return new ChunkCoords(coords.dimension, this.x - coords.x, this.y - coords.y, this.z - coords.z); - } - - /** - * Returns a new ChunkCoords in the specified dimension. - */ - public ChunkCoords inDimension(int dimId) { - return new ChunkCoords(dimId, x, y, z); - } + public ChunkCoords(TileEntity entity) { + this(entity.getWorldObj(), entity.xCoord, entity.yCoord, entity.zCoord); + } - /** - * Returns a new ChunkCoords in the specified world. - */ - public ChunkCoords inDimension(World world) { - return new ChunkCoords(world.provider.dimensionId, x, y, z); - } - - /** - * Writes obj to the given tag compound as a subtag. Writes nothing if obj is null. - */ - public static void writeToNBT(ChunkCoords obj, NBTTagCompound tagRoot) { - if (obj != null) { - NBTTagCompound coordsTag = new NBTTagCompound(); - coordsTag.setInteger("dim", obj.dimension); - coordsTag.setInteger("xPos", obj.x); - coordsTag.setInteger("yPos", obj.y); - coordsTag.setInteger("zPos", obj.z); - tagRoot.setTag("chunkCoords", coordsTag); - } - } - - /** - * Reads a ChunkCoords from an NBT tag. If no ChunkCoords subtag exists, returns null. - */ - public static ChunkCoords readFromNBT(NBTTagCompound tagRoot) { - if (tagRoot.hasKey("chunkCoords")) { - NBTTagCompound coordsTag = (NBTTagCompound)tagRoot.getTag("chunkCoords"); - int dim = coordsTag.getInteger("dim"); - int x = coordsTag.getInteger("xPos"); - int y = coordsTag.getInteger("yPos"); - int z = coordsTag.getInteger("zPos"); - return new ChunkCoords(dim, x, y, z); - } - return null; - } - + public ChunkCoords(Entity entity) { + this(entity.worldObj, entity.chunkCoordX, entity.chunkCoordY, entity.chunkCoordZ); + } + + public ChunkCoords(World world, int xCoord, int yCoord, int zCoord) { + this(world.provider.dimensionId, xCoord, yCoord, zCoord); + } + + public ChunkCoords(int dimId, int xCoord, int yCoord, int zCoord) { + this.dimension = dimId; + this.x = xCoord; + this.y = yCoord; + this.z = zCoord; + } + + /** + * Adds chunk coords together & returns the result within the same dimension. + */ + public ChunkCoords add(ChunkCoords coords) { + return new ChunkCoords(coords.dimension, this.x + coords.x, this.y + coords.y, this.z + coords.z); + } + + /** + * Subtracts chunk coords (a.subtract(b) == a - b) & returns the result within the same dimension. + */ + public ChunkCoords subtract(ChunkCoords coords) { + return new ChunkCoords(coords.dimension, this.x - coords.x, this.y - coords.y, this.z - coords.z); + } + + /** + * Returns a new ChunkCoords in the specified dimension. + */ + public ChunkCoords inDimension(int dimId) { + return new ChunkCoords(dimId, x, y, z); + } + + /** + * Returns a new ChunkCoords in the specified world. + */ + public ChunkCoords inDimension(World world) { + return new ChunkCoords(world.provider.dimensionId, x, y, z); + } + + /** + * Writes obj to the given tag compound as a subtag. Writes nothing if obj is null. + */ + public static void writeToNBT(ChunkCoords obj, NBTTagCompound tagRoot) { + if (obj != null) { + NBTTagCompound coordsTag = new NBTTagCompound(); + coordsTag.setInteger("dim", obj.dimension); + coordsTag.setInteger("xPos", obj.x); + coordsTag.setInteger("yPos", obj.y); + coordsTag.setInteger("zPos", obj.z); + tagRoot.setTag("chunkCoords", coordsTag); + } + } + + /** + * Reads a ChunkCoords from an NBT tag. If no ChunkCoords subtag exists, returns null. + */ + public static ChunkCoords readFromNBT(NBTTagCompound tagRoot) { + if (tagRoot.hasKey("chunkCoords")) { + NBTTagCompound coordsTag = (NBTTagCompound) tagRoot.getTag("chunkCoords"); + int dim = coordsTag.getInteger("dim"); + int x = coordsTag.getInteger("xPos"); + int y = coordsTag.getInteger("yPos"); + int z = coordsTag.getInteger("zPos"); + return new ChunkCoords(dim, x, y, z); + } + return null; + } } diff --git a/src/main/java/magicbees/main/utils/CraftingManager.java b/src/main/java/magicbees/main/utils/CraftingManager.java index 3843118..44b254c 100644 --- a/src/main/java/magicbees/main/utils/CraftingManager.java +++ b/src/main/java/magicbees/main/utils/CraftingManager.java @@ -1,8 +1,9 @@ package magicbees.main.utils; +import cpw.mods.fml.common.registry.GameRegistry; +import forestry.api.recipes.RecipeManagers; import java.util.Hashtable; import java.util.Map; - import magicbees.item.ItemCapsule; import magicbees.item.types.CombType; import magicbees.item.types.DropType; @@ -25,658 +26,786 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; -import cpw.mods.fml.common.registry.GameRegistry; -import forestry.api.recipes.RecipeManagers; public class CraftingManager { - - public static void registerLiquidContainers() { - registerLiquidContainer(Config.magicCapsule); - registerLiquidContainer(Config.voidCapsule); - } - public static void setupCrafting() { - // Broken up into seperate sections to make things a bit easier to find. - setupVanillaCrafting(); - setupCentrifugeRecipes(); - setupCarpenterRecipes(); - } + public static void registerLiquidContainers() { + registerLiquidContainer(Config.magicCapsule); + registerLiquidContainer(Config.voidCapsule); + } - private static void setupVanillaCrafting() { - ItemStack input; - ItemStack output; + public static void setupCrafting() { + // Broken up into seperate sections to make things a bit easier to find. + setupVanillaCrafting(); + setupCentrifugeRecipes(); + setupCarpenterRecipes(); + } - // Magic capsules - output = new ItemStack(Config.magicCapsule); - output.stackSize = 4; - GameRegistry.addRecipe(new ShapedOreRecipe(output, - "WWW", - 'W', "waxMagical" - )); + private static void setupVanillaCrafting() { + ItemStack input; + ItemStack output; - // Concentrated Fertilizer -> Forestry fertilizer - input = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER); - output = ItemInterface.getItemStack("Forestry", "fertilizerCompound", 6); - GameRegistry.addRecipe(output, - " S ", " F ", " S ", - 'F', input, - 'S', Blocks.sand - ); - GameRegistry.addRecipe(output, - " ", "SFS", " ", - 'F', input, - 'S', Blocks.sand - ); + // Magic capsules + output = new ItemStack(Config.magicCapsule); + output.stackSize = 4; + GameRegistry.addRecipe(new ShapedOreRecipe(output, "WWW", 'W', "waxMagical")); - output = output.copy(); - output.stackSize = 12; - GameRegistry.addRecipe(output, - "aaa", "aFa", "aaa", - 'F', input, - 'a', ItemInterface.getItemStack("ash") - ); + // Concentrated Fertilizer -> Forestry fertilizer + input = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER); + output = ItemInterface.getItemStack("Forestry", "fertilizerCompound", 6); + GameRegistry.addRecipe(output, " S ", " F ", " S ", 'F', input, 'S', Blocks.sand); + GameRegistry.addRecipe(output, " ", "SFS", " ", 'F', input, 'S', Blocks.sand); - // "bottling" Intellect drops - GameRegistry.addRecipe(new ItemStack(Items.experience_bottle), - "DDD", "DBD", "DDD", - 'D', Config.drops.getStackForType(DropType.INTELLECT), - 'B', Items.glass_bottle - ); + output = output.copy(); + output.stackSize = 12; + GameRegistry.addRecipe(output, "aaa", "aFa", "aaa", 'F', input, 'a', ItemInterface.getItemStack("ash")); - GameRegistry.addRecipe(new ItemStack(Blocks.soul_sand, 4), - "SwS", "wDw", "SwS", - 'S', Blocks.sand, - 'D', Blocks.dirt, - 'w', Config.wax.getStackForType(WaxType.SOUL) - ); - GameRegistry.addRecipe(new ItemStack(Blocks.soul_sand, 4), - "wSw", "SDS", "wSw", - 'S', Blocks.sand, - 'D', Blocks.dirt, - 'w', Config.wax.getStackForType(WaxType.SOUL) - ); + // "bottling" Intellect drops + GameRegistry.addRecipe( + new ItemStack(Items.experience_bottle), + "DDD", + "DBD", + "DDD", + 'D', + Config.drops.getStackForType(DropType.INTELLECT), + 'B', + Items.glass_bottle); - output = new ItemStack(Config.hiveFrameMagic); - input = ItemInterface.getItemStack("frameUntreated"); - GameRegistry.addRecipe(output, - "www", "wfw", "www", - 'w', Config.wax.getStackForType(WaxType.MAGIC), - 'f', input - ); + GameRegistry.addRecipe( + new ItemStack(Blocks.soul_sand, 4), + "SwS", + "wDw", + "SwS", + 'S', + Blocks.sand, + 'D', + Blocks.dirt, + 'w', + Config.wax.getStackForType(WaxType.SOUL)); + GameRegistry.addRecipe( + new ItemStack(Blocks.soul_sand, 4), + "wSw", + "SDS", + "wSw", + 'S', + Blocks.sand, + 'D', + Blocks.dirt, + 'w', + Config.wax.getStackForType(WaxType.SOUL)); - GameRegistry.addRecipe(new ItemStack(Config.hiveFrameTemporal), - "sPs", "PfP", "sPs", - 's', Blocks.sand, - 'P', Config.pollen.getStackForType(PollenType.PHASED), - 'f', Config.hiveFrameMagic - ); + output = new ItemStack(Config.hiveFrameMagic); + input = ItemInterface.getItemStack("frameUntreated"); + GameRegistry.addRecipe(output, "www", "wfw", "www", 'w', Config.wax.getStackForType(WaxType.MAGIC), 'f', input); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Config.effectJar), - "GSG", "QPQ", "GGG", - 'G', Blocks.glass, - 'S', "slabWood", - 'P', Config.pollen.getStackForType(PollenType.UNUSUAL), - 'Q', Items.quartz - )); + GameRegistry.addRecipe( + new ItemStack(Config.hiveFrameTemporal), + "sPs", + "PfP", + "sPs", + 's', + Blocks.sand, + 'P', + Config.pollen.getStackForType(PollenType.PHASED), + 'f', + Config.hiveFrameMagic); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Config.moonDial), - "DqD", "qrq", "DqD", - 'r', Items.redstone, - 'q', Items.quartz, - 'D', "dyeGreen" - )); + GameRegistry.addRecipe(new ShapedOreRecipe( + new ItemStack(Config.effectJar), + "GSG", + "QPQ", + "GGG", + 'G', + Blocks.glass, + 'S', + "slabWood", + 'P', + Config.pollen.getStackForType(PollenType.UNUSUAL), + 'Q', + Items.quartz)); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.SKULL_FRAGMENT), - "xxx", "xxx", "xxx", - 'x', Config.miscResources.getStackForType(ResourceType.SKULL_CHIP) - ); + GameRegistry.addRecipe(new ShapedOreRecipe( + new ItemStack(Config.moonDial), + "DqD", + "qrq", + "DqD", + 'r', + Items.redstone, + 'q', + Items.quartz, + 'D', + "dyeGreen")); - GameRegistry.addRecipe(new ItemStack(Items.skull, 1, 1), - "xxx", "xxx", - 'x', Config.miscResources.getStackForType(ResourceType.SKULL_FRAGMENT) - ); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.SKULL_FRAGMENT), + "xxx", + "xxx", + "xxx", + 'x', + Config.miscResources.getStackForType(ResourceType.SKULL_CHIP)); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.DRAGON_CHUNK), - "xxx", "xxx", - 'x', Config.miscResources.getStackForType(ResourceType.DRAGON_DUST) - ); + GameRegistry.addRecipe( + new ItemStack(Items.skull, 1, 1), + "xxx", + "xxx", + 'x', + Config.miscResources.getStackForType(ResourceType.SKULL_FRAGMENT)); - GameRegistry.addRecipe(new ItemStack(Blocks.dragon_egg, 1), - "ccc", "cec", "ccc", - 'c', Config.miscResources.getStackForType(ResourceType.DRAGON_CHUNK), - 'e', Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE) - ); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.DRAGON_CHUNK), + "xxx", + "xxx", + 'x', + Config.miscResources.getStackForType(ResourceType.DRAGON_DUST)); - GameRegistry.addRecipe(new ShapedOreRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY), - "gwg", "wiw", "gwg", - 'g', Blocks.glass, - 'w', "waxMagical", - 'i', Blocks.iron_block - )); - GameRegistry.addRecipe(new ShapedOreRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY), - "wgw", "gig", "wgw", - 'g', Blocks.glass, - 'w', "waxMagical", - 'i', Blocks.iron_block - )); + GameRegistry.addRecipe( + new ItemStack(Blocks.dragon_egg, 1), + "ccc", + "cec", + "ccc", + 'c', + Config.miscResources.getStackForType(ResourceType.DRAGON_CHUNK), + 'e', + Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE)); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE), - "gwg", "wfw", "gwg", - 'g', Blocks.glass, - 'w', Config.wax.getStackForType(WaxType.SOUL), - 'f', Blocks.red_flower - ); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE), - "wgw", "gfg", "wgw", - 'g', Blocks.glass, - 'w', Config.wax.getStackForType(WaxType.SOUL), - 'f', Blocks.red_flower - ); + GameRegistry.addRecipe(new ShapedOreRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY), + "gwg", + "wiw", + "gwg", + 'g', + Blocks.glass, + 'w', + "waxMagical", + 'i', + Blocks.iron_block)); + GameRegistry.addRecipe(new ShapedOreRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY), + "wgw", + "gig", + "wgw", + 'g', + Blocks.glass, + 'w', + "waxMagical", + 'i', + Blocks.iron_block)); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), - "gwg", "wfw", "gwg", - 'g', Blocks.glass, - 'w', Config.wax.getStackForType(WaxType.SOUL), - 'f', Items.rotten_flesh - ); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), - "wgw", "gfg", "wgw", - 'g', Blocks.glass, - 'w', Config.wax.getStackForType(WaxType.SOUL), - 'f', Items.rotten_flesh - ); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE), + "gwg", + "wfw", + "gwg", + 'g', + Blocks.glass, + 'w', + Config.wax.getStackForType(WaxType.SOUL), + 'f', + Blocks.red_flower); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE), + "wgw", + "gfg", + "wgw", + 'g', + Blocks.glass, + 'w', + Config.wax.getStackForType(WaxType.SOUL), + 'f', + Blocks.red_flower); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), - "wgw", "gcg", "wgw", - 'g', Blocks.glass, - 'w', Config.wax.getStackForType(WaxType.SOUL), - 'c', Items.clock - ); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), - "gwg", "wcw", "gwg", - 'g', Blocks.glass, - 'w', Config.wax.getStackForType(WaxType.SOUL), - 'c', Items.clock - ); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), + "gwg", + "wfw", + "gwg", + 'g', + Blocks.glass, + 'w', + Config.wax.getStackForType(WaxType.SOUL), + 'f', + Items.rotten_flesh); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), + "wgw", + "gfg", + "wgw", + 'g', + Blocks.glass, + 'w', + Config.wax.getStackForType(WaxType.SOUL), + 'f', + Items.rotten_flesh); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE), - "wew", "gcg", "wew", - 'w', Config.wax.getStackForType(WaxType.SOUL), - 'c', Items.magma_cream, - 'e', Items.egg, - 'g', Blocks.glowstone - ); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE), - "wgw", "ece", "wgw", - 'w', Config.wax.getStackForType(WaxType.SOUL), - 'c', Items.magma_cream, - 'e', Items.egg, - 'g', Blocks.glowstone - ); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), + "wgw", + "gcg", + "wgw", + 'g', + Blocks.glass, + 'w', + Config.wax.getStackForType(WaxType.SOUL), + 'c', + Items.clock); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), + "gwg", + "wcw", + "gwg", + 'g', + Blocks.glass, + 'w', + Config.wax.getStackForType(WaxType.SOUL), + 'c', + Items.clock); - GameRegistry.addRecipe(Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION), - "gst", "sEs", "tsg", - 'g', Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), - 't', Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), - 's', new ItemStack(Items.skull, 1, 1), - 'E', Blocks.dragon_egg - ); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE), + "wew", + "gcg", + "wew", + 'w', + Config.wax.getStackForType(WaxType.SOUL), + 'c', + Items.magma_cream, + 'e', + Items.egg, + 'g', + Blocks.glowstone); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE), + "wgw", + "ece", + "wgw", + 'w', + Config.wax.getStackForType(WaxType.SOUL), + 'c', + Items.magma_cream, + 'e', + Items.egg, + 'g', + Blocks.glowstone); - // IF YOU UPDATE THESE, CHANGE THE RECIPES IN THAUMCRAFT HELPER, YOU IDIOT. - input = new ItemStack(Config.hiveFrameMagic); - GameRegistry.addShapelessRecipe(new ItemStack(Config.hiveFrameResilient), - Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY), - input - ); + GameRegistry.addRecipe( + Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION), + "gst", + "sEs", + "tsg", + 'g', + Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), + 't', + Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), + 's', + new ItemStack(Items.skull, 1, 1), + 'E', + Blocks.dragon_egg); - GameRegistry.addShapelessRecipe(new ItemStack(Config.hiveFrameGentle), - Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE), - input - ); + // IF YOU UPDATE THESE, CHANGE THE RECIPES IN THAUMCRAFT HELPER, YOU IDIOT. + input = new ItemStack(Config.hiveFrameMagic); + GameRegistry.addShapelessRecipe( + new ItemStack(Config.hiveFrameResilient), + Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY), + input); - GameRegistry.addShapelessRecipe(new ItemStack(Config.hiveFrameNecrotic), - Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), - input - ); + GameRegistry.addShapelessRecipe( + new ItemStack(Config.hiveFrameGentle), + Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE), + input); - GameRegistry.addShapelessRecipe(new ItemStack(Config.hiveFrameMetabolic), - Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE), - input - ); + GameRegistry.addShapelessRecipe( + new ItemStack(Config.hiveFrameNecrotic), + Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), + input); - GameRegistry.addShapelessRecipe(new ItemStack(Config.hiveFrameTemporal), - Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), - input - ); + GameRegistry.addShapelessRecipe( + new ItemStack(Config.hiveFrameMetabolic), + Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE), + input); - GameRegistry.addShapelessRecipe(new ItemStack(Config.hiveFrameOblivion), - Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION), - ItemInterface.getItemStack("frameProven") - ); - - output = new ItemStack(Config.magicApiary); - GameRegistry.addShapelessRecipe(output, - Config.pollen.getStackForType(PollenType.UNUSUAL, 2), - Config.drops.getStackForType(DropType.ENCHANTED, 2), - new ItemStack(ForestryHelper.apicultureBlock, 1, ForestryHelper.ApicultureBlock.APIARY.ordinal()) - ); + GameRegistry.addShapelessRecipe( + new ItemStack(Config.hiveFrameTemporal), + Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), + input); - GameRegistry.addRecipe(new ItemStack(Config.enchantedEarth), - "d d", " e ", "d d", - 'd', new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE), - 'e', Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE) - ); - GameRegistry.addRecipe(new ItemStack(Config.enchantedEarth), - " d ", "ded", " d ", - 'd', new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE), - 'e', Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE) - ); + GameRegistry.addShapelessRecipe( + new ItemStack(Config.hiveFrameOblivion), + Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION), + ItemInterface.getItemStack("frameProven")); - if (OreDictionary.getOres("ingotCopper").size() <= 0) { - NuggetType.COPPER.setInactive(); - } - else { - GameRegistry.addRecipe(new ShapedOreRecipe(OreDictionary.getOres("ingotCopper").get(0), - "xxx", "xxx", "xxx", - 'x', "nuggetCopper" - )); - } - - if (OreDictionary.getOres("ingotTin").size() <= 0) { - NuggetType.TIN.setInactive(); - } - else { - GameRegistry.addRecipe(new ShapedOreRecipe(OreDictionary.getOres("ingotTin").get(0), - "xxx", "xxx", "xxx", - 'x', "nuggetTin" - )); - } - - if (OreDictionary.getOres("ingotSilver").size() <= 0) { - NuggetType.SILVER.setInactive(); - } - else { - GameRegistry.addRecipe(new ShapedOreRecipe(OreDictionary.getOres("ingotSilver").get(0), - "xxx", "xxx", "xxx", - 'x', "nuggetSilver" - )); - } - - if (OreDictionary.getOres("ingotLead").size() <= 0) { - NuggetType.LEAD.setInactive(); - } - else { - GameRegistry.addRecipe(new ShapedOreRecipe(OreDictionary.getOres("ingotLead").get(0), - "xxx", "xxx", "xxx", - 'x', "nuggetLead" - )); - } + output = new ItemStack(Config.magicApiary); + GameRegistry.addShapelessRecipe( + output, + Config.pollen.getStackForType(PollenType.UNUSUAL, 2), + Config.drops.getStackForType(DropType.ENCHANTED, 2), + new ItemStack(ForestryHelper.apicultureBlock, 1, ForestryHelper.ApicultureBlock.APIARY.ordinal())); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.iron_ingot), - "xxx", "xxx", "xxx", - 'x', "nuggetIron" - )); + GameRegistry.addRecipe( + new ItemStack(Config.enchantedEarth), + "d d", + " e ", + "d d", + 'd', + new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE), + 'e', + Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE)); + GameRegistry.addRecipe( + new ItemStack(Config.enchantedEarth), + " d ", + "ded", + " d ", + 'd', + new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE), + 'e', + Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE)); - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.diamond), - "xxx", "xxx", "xxx", - 'x', "nuggetDiamond" - )); + if (OreDictionary.getOres("ingotCopper").size() <= 0) { + NuggetType.COPPER.setInactive(); + } else { + GameRegistry.addRecipe(new ShapedOreRecipe( + OreDictionary.getOres("ingotCopper").get(0), "xxx", "xxx", "xxx", 'x', "nuggetCopper")); + } - GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.emerald), - "xxx", "xxx", "xxx", - 'x', "nuggetEmerald" - )); + if (OreDictionary.getOres("ingotTin").size() <= 0) { + NuggetType.TIN.setInactive(); + } else { + GameRegistry.addRecipe(new ShapedOreRecipe( + OreDictionary.getOres("ingotTin").get(0), "xxx", "xxx", "xxx", 'x', "nuggetTin")); + } - GameRegistry.addRecipe(new ShapedOreRecipe(ItemInterface.getItemStack("apatite"), - "xxx", "xxx", "xxx", - 'x', Config.nuggets.getStackForType(NuggetType.APATITE) - )); + if (OreDictionary.getOres("ingotSilver").size() <= 0) { + NuggetType.SILVER.setInactive(); + } else { + GameRegistry.addRecipe(new ShapedOreRecipe( + OreDictionary.getOres("ingotSilver").get(0), "xxx", "xxx", "xxx", 'x', "nuggetSilver")); + } - output = Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY); - GameRegistry.addRecipe(output, - " G ", "QEQ", " W ", - 'E', Items.ender_eye, - 'Q', Blocks.quartz_block, - 'W', Blocks.end_stone, - 'G', Blocks.gold_block - ); + if (OreDictionary.getOres("ingotLead").size() <= 0) { + NuggetType.LEAD.setInactive(); + } else { + GameRegistry.addRecipe(new ShapedOreRecipe( + OreDictionary.getOres("ingotLead").get(0), "xxx", "xxx", "xxx", 'x', "nuggetLead")); + } - output = Config.voidCapsule.getCapsuleForLiquid(FluidType.EMPTY); - output.stackSize = 4; - GameRegistry.addRecipe(output, - "T T", "GFG", "T T", - 'G', Blocks.glass_pane, - 'F', Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY), - 'T', Items.gold_nugget - ); + GameRegistry.addRecipe( + new ShapedOreRecipe(new ItemStack(Items.iron_ingot), "xxx", "xxx", "xxx", 'x', "nuggetIron")); - output = new ItemStack(Config.magnet); - GameRegistry.addRecipe(output, - " i ", "cSc", " d ", - 'i', Items.iron_ingot, - 'c', Items.compass, - 'd', Items.diamond, - 'S', Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY) - ); + GameRegistry.addRecipe( + new ShapedOreRecipe(new ItemStack(Items.diamond), "xxx", "xxx", "xxx", 'x', "nuggetDiamond")); - for (int level = 1; level <= 8; level++) { - output = new ItemStack(Config.magnet, 1, level * 2); - GameRegistry.addRecipe(new ShapedOreRecipe(output, - " d ", "mSm", " B ", - 'd', Items.diamond, - 'm', "mb.magnet.level" + (level - 1), - 'B', Blocks.redstone_block, - 'S', Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY) - )); - } + GameRegistry.addRecipe( + new ShapedOreRecipe(new ItemStack(Items.emerald), "xxx", "xxx", "xxx", 'x', "nuggetEmerald")); - if (ThaumcraftHelper.isActive()) { - input = Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT); - output = new ItemStack(ThaumcraftHelper.miscResource, 1, ThaumcraftHelper.MiscResource.KNOWLEDGE_FRAGMENT.ordinal()); - GameRegistry.addShapelessRecipe(output, - input, input, input, input - ); + GameRegistry.addRecipe(new ShapedOreRecipe( + ItemInterface.getItemStack("apatite"), + "xxx", + "xxx", + "xxx", + 'x', + Config.nuggets.getStackForType(NuggetType.APATITE))); - if (Config.thaumaturgeBackpackActive) { - // T1 Thaumaturge's backpack - GameRegistry.addRecipe(new ItemStack(Config.thaumaturgeBackpackT1), - "SWS", "NCN", "SWS", - 'S', Items.string, - 'W', Blocks.wool, - 'N', new ItemStack(ThaumcraftHelper.miscResource, 1, ThaumcraftHelper.MiscResource.AMBER.ordinal()), - 'C', Blocks.chest - ); - } - } + output = Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY); + GameRegistry.addRecipe( + output, + " G ", + "QEQ", + " W ", + 'E', + Items.ender_eye, + 'Q', + Blocks.quartz_block, + 'W', + Blocks.end_stone, + 'G', + Blocks.gold_block); - if (ArsMagicaHelper.isActive()) { - input = ItemInterface.getItemStack("apatite"); - output = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER, 4); - GameRegistry.addShapelessRecipe(output, - new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), - input, input - ); - GameRegistry.addShapelessRecipe(output, - new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.PLANT.ordinal()), - input, input - ); - } - } - - private static Map newMap() { - return new Hashtable(); - } + output = Config.voidCapsule.getCapsuleForLiquid(FluidType.EMPTY); + output.stackSize = 4; + GameRegistry.addRecipe( + output, + "T T", + "GFG", + "T T", + 'G', + Blocks.glass_pane, + 'F', + Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY), + 'T', + Items.gold_nugget); - private static void setupCentrifugeRecipes() { - ItemStack beeswax = ItemInterface.getItemStack("beeswax"); - ItemStack propolis = ItemInterface.getItemStack("propolis"); - propolis.setItemDamage(ForestryHelper.Propolis.PULSATING.ordinal()); - Map output = newMap(); + output = new ItemStack(Config.magnet); + GameRegistry.addRecipe( + output, + " i ", + "cSc", + " d ", + 'i', + Items.iron_ingot, + 'c', + Items.compass, + 'd', + Items.diamond, + 'S', + Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY)); - // 20 is the 'average' time to centrifuge a comb. - output.put(beeswax, 0.90f); - output.put(ItemInterface.getItemStack("honeyDrop"), 0.60f); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.10f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.MUNDANE), output); - - output = newMap(); - output.put(ItemInterface.getItemStack("refractoryWax"), 0.86f); - output.put(ItemInterface.getItemStack("honeyDrop"), 0.087f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.MOLTEN), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.AMNESIC), 0.50f); - output.put(propolis, 0.50f); - output.put(ItemInterface.getItemStack("honeyDrop"), 0.40f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FORGOTTEN), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(ItemInterface.getItemStack("honeyDrop"), 0.60f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.OCCULT), output); - - output = newMap(); - output.put(beeswax, 0.50f); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.22f); - output.put(ItemInterface.getItemStack("honeyDrop"), 1f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.OTHERWORLDLY), output); - - output = newMap(); - output.put(ItemInterface.getItemStack("beeswax"), 0.80f); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.20f); - output.put(new ItemStack(Items.paper), 0.057f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.PAPERY), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.90f); - output.put(ItemInterface.getItemStack("honeydew"), 0.40f); - output.put(Config.drops.getStackForType(DropType.INTELLECT), 0.10f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.INTELLECT), output); - - propolis.setItemDamage(ForestryHelper.Propolis.NORMAL.ordinal()); - output = newMap(); - output.put(ItemInterface.getItemStack("beeswax"), 0.90f); - output.put(propolis, 0.20f); - output.put(ItemInterface.getItemStack("honeydew"), 0.35f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FURTIVE), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.SOUL), 0.95f); - output.put(ItemInterface.getItemStack("honeydew"), 0.26f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.SOUL), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(Config.pollen.getStackForType(PollenType.PHASED), 0.055f); - output.put(new ItemStack(ForestryHelper.honeydew, 1), 0.60f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TEMPORAL), output); - - output = newMap(); - output.put(ItemInterface.getItemStack("beeswax"), 0.80f); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.80f); - output.put(Config.propolis.getStackForType(PropolisType.UNSTABLE), 0.15f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TRANSMUTED), output); + for (int level = 1; level <= 8; level++) { + output = new ItemStack(Config.magnet, 1, level * 2); + GameRegistry.addRecipe(new ShapedOreRecipe( + output, + " d ", + "mSm", + " B ", + 'd', + Items.diamond, + 'm', + "mb.magnet.level" + (level - 1), + 'B', + Blocks.redstone_block, + 'S', + Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY))); + } - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.feather), 0.60f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AIRY), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.blaze_powder), 0.60f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FIREY), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.dye), 0.60f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.WATERY), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.clay_ball), 0.60f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.EARTHY), output); + if (ThaumcraftHelper.isActive()) { + input = Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT); + output = new ItemStack( + ThaumcraftHelper.miscResource, 1, ThaumcraftHelper.MiscResource.KNOWLEDGE_FRAGMENT.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); - if (ThaumcraftHelper.isActive()) { - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.feather), 0.60f); - output.put(Config.propolis.getStackForType(PropolisType.AIR), 0.80f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_AIR), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.blaze_powder), 0.60f); - output.put(Config.propolis.getStackForType(PropolisType.FIRE), 0.80f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_FIRE), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.dye), 0.60f); - output.put(Config.propolis.getStackForType(PropolisType.WATER), 0.80f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_WATER), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.clay_ball), 0.60f); - output.put(Config.propolis.getStackForType(PropolisType.EARTH), 0.80f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_EARTH), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.redstone), 0.60f); - output.put(Config.propolis.getStackForType(PropolisType.ORDER), 0.80f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_ORDER), output); - - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); - output.put(new ItemStack(Items.gunpowder), 0.60f); - output.put(Config.propolis.getStackForType(PropolisType.CHAOS), 0.80f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_CHAOS), output); + if (Config.thaumaturgeBackpackActive) { + // T1 Thaumaturge's backpack + GameRegistry.addRecipe( + new ItemStack(Config.thaumaturgeBackpackT1), + "SWS", + "NCN", + "SWS", + 'S', + Items.string, + 'W', + Blocks.wool, + 'N', + new ItemStack(ThaumcraftHelper.miscResource, 1, ThaumcraftHelper.MiscResource.AMBER.ordinal()), + 'C', + Blocks.chest); + } + } - output = newMap(); - output.put(propolis, 1f); - output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_AIR), 0.90f); - RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.AIR), output); - output = newMap(); - output.put(propolis, 1f); - output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_FIRE), 0.90f); - RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.FIRE), output); - output = newMap(); - output.put(propolis, 1f); - output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_WATER), 0.90f); - RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.WATER), output); - output = newMap(); - output.put(propolis, 1f); - output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_EARTH), 0.90f); - RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.EARTH), output); - output = newMap(); - output.put(propolis, 1f); - output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_ORDER), 0.90f); - RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.ORDER), output); - output = newMap(); - output.put(propolis, 1f); - output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_CHAOS), 0.90f); - RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.CHAOS), output); - } + if (ArsMagicaHelper.isActive()) { + input = ItemInterface.getItemStack("apatite"); + output = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER, 4); + GameRegistry.addShapelessRecipe( + output, + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), + input, + input); + GameRegistry.addShapelessRecipe( + output, + new ItemStack(ArsMagicaHelper.essence, 1, ArsMagicaHelper.EssenceType.PLANT.ordinal()), + input, + input); + } + } - if (ArsMagicaHelper.isActive()) { - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.85f); - output.put(new ItemStack(ArsMagicaHelper.itemResource), 0.10f); - output.put(new ItemStack(ArsMagicaHelper.itemResource), 0.024f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AM_ESSENCE), output); - output = newMap(); - output.put(ItemInterface.getItemStack("beeswax"), 0.50f); - output.put(ItemInterface.getItemStack("refractoryWax"), 0.50f); - output.put(ItemInterface.getItemStack("honeydew"), 0.65f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AM_POTENT), output); - } - - if (ThermalModsHelper.isActive()) { - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.55f); - output.put(Config.drops.getStackForType(DropType.DESTABILIZED), 0.22f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TE_DESTABILIZED), output); - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.55f); - output.put(Config.drops.getStackForType(DropType.CARBON), 0.22f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TE_CARBON), output); - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.55f); - output.put(Config.drops.getStackForType(DropType.LUX), 0.22f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TE_LUX), output); - output = newMap(); - output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.55f); - output.put(Config.drops.getStackForType(DropType.ENDEARING), 0.22f); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TE_ENDEARING), output); - } + private static Map newMap() { + return new Hashtable(); + } - } + private static void setupCentrifugeRecipes() { + ItemStack beeswax = ItemInterface.getItemStack("beeswax"); + ItemStack propolis = ItemInterface.getItemStack("propolis"); + propolis.setItemDamage(ForestryHelper.Propolis.PULSATING.ordinal()); + Map output = newMap(); - private static void setupCarpenterRecipes() { - ItemStack input; - ItemStack output; + // 20 is the 'average' time to centrifuge a comb. + output.put(beeswax, 0.90f); + output.put(ItemInterface.getItemStack("honeyDrop"), 0.60f); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.10f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.MUNDANE), output); - output = ItemInterface.getItemStack("Forestry", "candle", 24); - RecipeManagers.carpenterManager.addRecipe(30, new FluidStack(FluidRegistry.WATER, 600), null, output, - " S ", "WWW", "WWW", - 'W', Config.wax, - 'S', Items.string - ); + output = newMap(); + output.put(ItemInterface.getItemStack("refractoryWax"), 0.86f); + output.put(ItemInterface.getItemStack("honeyDrop"), 0.087f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.MOLTEN), output); - output = ItemInterface.getItemStack("Forestry", "candle", 6); - input = ItemInterface.getItemStack("craftingMaterial"); - input.setItemDamage(ForestryHelper.CraftingMaterial.SILK_WISP.ordinal()); // Set to Silk Wisp - RecipeManagers.carpenterManager.addRecipe(30, new FluidStack(FluidRegistry.WATER, 600), null, output, - "WSW", - 'W', Config.wax, - 'S', input - ); + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.AMNESIC), 0.50f); + output.put(propolis, 0.50f); + output.put(ItemInterface.getItemStack("honeyDrop"), 0.40f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FORGOTTEN), output); - output = Config.miscResources.getStackForType(ResourceType.AROMATIC_LUMP, 2); - RecipeManagers.carpenterManager.addRecipe(30, FluidRegistry.getFluidStack("for.honey", 1000), null, output, - " P ", "JDJ", " P ", - 'P', ItemInterface.getItemStack("pollen"), - 'J', ItemInterface.getItemStack("royalJelly"), - 'D', Config.drops.getStackForType(DropType.ENCHANTED) - ); + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(ItemInterface.getItemStack("honeyDrop"), 0.60f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.OCCULT), output); - RecipeManagers.carpenterManager.addRecipe(30, FluidRegistry.getFluidStack("for.honey", 1000), null, output, - " J ", "PDP", " J ", - 'P', ItemInterface.getItemStack("pollen"), - 'J', ItemInterface.getItemStack("royalJelly"), - 'D', Config.drops.getStackForType(DropType.ENCHANTED) - ); + output = newMap(); + output.put(beeswax, 0.50f); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.22f); + output.put(ItemInterface.getItemStack("honeyDrop"), 1f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.OTHERWORLDLY), output); - if (ThaumcraftHelper.isActive()) - { - // Carpenter recipes - input = ItemInterface.getItemStack("craftingMaterial"); - input.setItemDamage(3); // Set to Silk Mesh - output = new ItemStack(Config.thaumaturgeBackpackT2); - RecipeManagers.carpenterManager.addRecipe(200, new FluidStack(FluidRegistry.WATER, 1000), null, output, - "WXW", "WTW", "WWW", - 'X', Items.diamond, - 'W', input, - 'T', new ItemStack(Config.thaumaturgeBackpackT1) - ); - } - } + output = newMap(); + output.put(ItemInterface.getItemStack("beeswax"), 0.80f); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.20f); + output.put(new ItemStack(Items.paper), 0.057f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.PAPERY), output); - private static void registerLiquidContainer(ItemCapsule baseCapsule) { - ItemStack empty = new ItemStack(baseCapsule, 1, 0); - ItemStack filled; - FluidStack liquid = null; + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.90f); + output.put(ItemInterface.getItemStack("honeydew"), 0.40f); + output.put(Config.drops.getStackForType(DropType.INTELLECT), 0.10f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.INTELLECT), output); - for (FluidType fluidType : FluidType.values()) { - switch (fluidType) { - case EMPTY: - liquid = null; - break; - case WATER: - liquid = new FluidStack(FluidRegistry.WATER, baseCapsule.getType().capacity); - break; - case LAVA: - liquid = new FluidStack(FluidRegistry.LAVA, baseCapsule.getType().capacity); - break; - default: - liquid = FluidRegistry.getFluidStack(fluidType.liquidID, baseCapsule.getType().capacity); - break; - } + propolis.setItemDamage(ForestryHelper.Propolis.NORMAL.ordinal()); + output = newMap(); + output.put(ItemInterface.getItemStack("beeswax"), 0.90f); + output.put(propolis, 0.20f); + output.put(ItemInterface.getItemStack("honeydew"), 0.35f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FURTIVE), output); - if (liquid != null) { - filled = new ItemStack(baseCapsule, 1, fluidType.ordinal()); - FluidContainerRegistry.registerFluidContainer(liquid, filled, empty); + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.SOUL), 0.95f); + output.put(ItemInterface.getItemStack("honeydew"), 0.26f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.SOUL), output); - // Register with Squeezer/Bottler - //RecipeManagers.bottlerManager.addRecipe(5, liquid, empty, filled); Outdated? - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] { filled }, liquid, - Config.wax.getStackForType(WaxType.MAGIC), 20); - fluidType.available = true; - } - } - // Empty will be set to unavailable. Obviously, it always is. - FluidType.EMPTY.available = true; - } + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(Config.pollen.getStackForType(PollenType.PHASED), 0.055f); + output.put(new ItemStack(ForestryHelper.honeydew, 1), 0.60f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TEMPORAL), output); + + output = newMap(); + output.put(ItemInterface.getItemStack("beeswax"), 0.80f); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.80f); + output.put(Config.propolis.getStackForType(PropolisType.UNSTABLE), 0.15f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TRANSMUTED), output); + + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.feather), 0.60f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AIRY), output); + + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.blaze_powder), 0.60f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FIREY), output); + + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.dye), 0.60f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.WATERY), output); + + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.clay_ball), 0.60f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.EARTHY), output); + + if (ThaumcraftHelper.isActive()) { + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.feather), 0.60f); + output.put(Config.propolis.getStackForType(PropolisType.AIR), 0.80f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_AIR), output); + + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.blaze_powder), 0.60f); + output.put(Config.propolis.getStackForType(PropolisType.FIRE), 0.80f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_FIRE), output); + + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.dye), 0.60f); + output.put(Config.propolis.getStackForType(PropolisType.WATER), 0.80f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_WATER), output); + + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.clay_ball), 0.60f); + output.put(Config.propolis.getStackForType(PropolisType.EARTH), 0.80f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_EARTH), output); + + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.redstone), 0.60f); + output.put(Config.propolis.getStackForType(PropolisType.ORDER), 0.80f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_ORDER), output); + + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 1f); + output.put(new ItemStack(Items.gunpowder), 0.60f); + output.put(Config.propolis.getStackForType(PropolisType.CHAOS), 0.80f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TC_CHAOS), output); + + output = newMap(); + output.put(propolis, 1f); + output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_AIR), 0.90f); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.AIR), output); + output = newMap(); + output.put(propolis, 1f); + output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_FIRE), 0.90f); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.FIRE), output); + output = newMap(); + output.put(propolis, 1f); + output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_WATER), 0.90f); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.WATER), output); + output = newMap(); + output.put(propolis, 1f); + output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_EARTH), 0.90f); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.EARTH), output); + output = newMap(); + output.put(propolis, 1f); + output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_ORDER), 0.90f); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.ORDER), output); + output = newMap(); + output.put(propolis, 1f); + output.put(Config.miscResources.getStackForType(ResourceType.TC_DUST_CHAOS), 0.90f); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.CHAOS), output); + } + + if (ArsMagicaHelper.isActive()) { + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.85f); + output.put(new ItemStack(ArsMagicaHelper.itemResource), 0.10f); + output.put(new ItemStack(ArsMagicaHelper.itemResource), 0.024f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AM_ESSENCE), output); + output = newMap(); + output.put(ItemInterface.getItemStack("beeswax"), 0.50f); + output.put(ItemInterface.getItemStack("refractoryWax"), 0.50f); + output.put(ItemInterface.getItemStack("honeydew"), 0.65f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AM_POTENT), output); + } + + if (ThermalModsHelper.isActive()) { + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.55f); + output.put(Config.drops.getStackForType(DropType.DESTABILIZED), 0.22f); + RecipeManagers.centrifugeManager.addRecipe( + 20, Config.combs.getStackForType(CombType.TE_DESTABILIZED), output); + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.55f); + output.put(Config.drops.getStackForType(DropType.CARBON), 0.22f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TE_CARBON), output); + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.55f); + output.put(Config.drops.getStackForType(DropType.LUX), 0.22f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TE_LUX), output); + output = newMap(); + output.put(Config.wax.getStackForType(WaxType.MAGIC), 0.55f); + output.put(Config.drops.getStackForType(DropType.ENDEARING), 0.22f); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TE_ENDEARING), output); + } + } + + private static void setupCarpenterRecipes() { + ItemStack input; + ItemStack output; + + output = ItemInterface.getItemStack("Forestry", "candle", 24); + RecipeManagers.carpenterManager.addRecipe( + 30, + new FluidStack(FluidRegistry.WATER, 600), + null, + output, + " S ", + "WWW", + "WWW", + 'W', + Config.wax, + 'S', + Items.string); + + output = ItemInterface.getItemStack("Forestry", "candle", 6); + input = ItemInterface.getItemStack("craftingMaterial"); + input.setItemDamage(ForestryHelper.CraftingMaterial.SILK_WISP.ordinal()); // Set to Silk Wisp + RecipeManagers.carpenterManager.addRecipe( + 30, new FluidStack(FluidRegistry.WATER, 600), null, output, "WSW", 'W', Config.wax, 'S', input); + + output = Config.miscResources.getStackForType(ResourceType.AROMATIC_LUMP, 2); + RecipeManagers.carpenterManager.addRecipe( + 30, + FluidRegistry.getFluidStack("for.honey", 1000), + null, + output, + " P ", + "JDJ", + " P ", + 'P', + ItemInterface.getItemStack("pollen"), + 'J', + ItemInterface.getItemStack("royalJelly"), + 'D', + Config.drops.getStackForType(DropType.ENCHANTED)); + + RecipeManagers.carpenterManager.addRecipe( + 30, + FluidRegistry.getFluidStack("for.honey", 1000), + null, + output, + " J ", + "PDP", + " J ", + 'P', + ItemInterface.getItemStack("pollen"), + 'J', + ItemInterface.getItemStack("royalJelly"), + 'D', + Config.drops.getStackForType(DropType.ENCHANTED)); + + if (ThaumcraftHelper.isActive()) { + // Carpenter recipes + input = ItemInterface.getItemStack("craftingMaterial"); + input.setItemDamage(3); // Set to Silk Mesh + output = new ItemStack(Config.thaumaturgeBackpackT2); + RecipeManagers.carpenterManager.addRecipe( + 200, + new FluidStack(FluidRegistry.WATER, 1000), + null, + output, + "WXW", + "WTW", + "WWW", + 'X', + Items.diamond, + 'W', + input, + 'T', + new ItemStack(Config.thaumaturgeBackpackT1)); + } + } + + private static void registerLiquidContainer(ItemCapsule baseCapsule) { + ItemStack empty = new ItemStack(baseCapsule, 1, 0); + ItemStack filled; + FluidStack liquid = null; + + for (FluidType fluidType : FluidType.values()) { + switch (fluidType) { + case EMPTY: + liquid = null; + break; + case WATER: + liquid = new FluidStack(FluidRegistry.WATER, baseCapsule.getType().capacity); + break; + case LAVA: + liquid = new FluidStack(FluidRegistry.LAVA, baseCapsule.getType().capacity); + break; + default: + liquid = FluidRegistry.getFluidStack(fluidType.liquidID, baseCapsule.getType().capacity); + break; + } + + if (liquid != null) { + filled = new ItemStack(baseCapsule, 1, fluidType.ordinal()); + FluidContainerRegistry.registerFluidContainer(liquid, filled, empty); + + // Register with Squeezer/Bottler + // RecipeManagers.bottlerManager.addRecipe(5, liquid, empty, filled); Outdated? + RecipeManagers.squeezerManager.addRecipe( + 10, new ItemStack[] {filled}, liquid, Config.wax.getStackForType(WaxType.MAGIC), 20); + fluidType.available = true; + } + } + // Empty will be set to unavailable. Obviously, it always is. + FluidType.EMPTY.available = true; + } } diff --git a/src/main/java/magicbees/main/utils/IMCManager.java b/src/main/java/magicbees/main/utils/IMCManager.java index 691b7b7..2f8ff81 100644 --- a/src/main/java/magicbees/main/utils/IMCManager.java +++ b/src/main/java/magicbees/main/utils/IMCManager.java @@ -8,57 +8,43 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; -public class IMCManager -{ - public static void handle(IMCEvent event) - { - for (IMCMessage message : event.getMessages()) - { - try - { - if (message.key.equals("addCrumblePair")) - { - handleCrumbleBlock(message); - } - else - { - FMLLog.warning("Magic Bees recieved an IMC Message from a mod %s " + - "but does not support messages keyed with %s.", - message.getSender(), message.key); - } - } - catch (Exception e) - { - FMLLog.warning("Magic Bees recieved an invalid IMC Message from a mod %s! Please inform " + - "the author of %s that they may not be correctly implementing message for key '%s'. Error details follow.", - message.getSender(), message.key); - FMLLog.info(e.getMessage()); - } - } - } +public class IMCManager { + public static void handle(IMCEvent event) { + for (IMCMessage message : event.getMessages()) { + try { + if (message.key.equals("addCrumblePair")) { + handleCrumbleBlock(message); + } else { + FMLLog.warning( + "Magic Bees recieved an IMC Message from a mod %s " + + "but does not support messages keyed with %s.", + message.getSender(), message.key); + } + } catch (Exception e) { + FMLLog.warning( + "Magic Bees recieved an invalid IMC Message from a mod %s! Please inform " + + "the author of %s that they may not be correctly implementing message for key '%s'. Error details follow.", + message.getSender(), message.key); + FMLLog.info(e.getMessage()); + } + } + } - private static void handleCrumbleBlock(IMCMessage message) throws Exception - { - NBTTagCompound root = message.getNBTValue(); - NBTBase source = root.getTag("source"); - NBTBase target = root.getTag("target"); + private static void handleCrumbleBlock(IMCMessage message) throws Exception { + NBTTagCompound root = message.getNBTValue(); + NBTBase source = root.getTag("source"); + NBTBase target = root.getTag("target"); - if (source != null && source instanceof NBTTagCompound) - { - ItemStack sourceItem = ItemStack.loadItemStackFromNBT((NBTTagCompound)source); - if (target instanceof NBTTagCompound) - { - ItemStack targetItem = ItemStack.loadItemStackFromNBT((NBTTagCompound)target); - AlleleEffectCrumbling.addPairToMap(sourceItem, targetItem); - } - else - { - throw new Exception("Required tag 'target' was either empty, or not a valid ItemStack."); - } - } - else - { - throw new Exception("Required tag 'source' was either empty, or not a valid ItemStack."); - } - } + if (source != null && source instanceof NBTTagCompound) { + ItemStack sourceItem = ItemStack.loadItemStackFromNBT((NBTTagCompound) source); + if (target instanceof NBTTagCompound) { + ItemStack targetItem = ItemStack.loadItemStackFromNBT((NBTTagCompound) target); + AlleleEffectCrumbling.addPairToMap(sourceItem, targetItem); + } else { + throw new Exception("Required tag 'target' was either empty, or not a valid ItemStack."); + } + } else { + throw new Exception("Required tag 'source' was either empty, or not a valid ItemStack."); + } + } } diff --git a/src/main/java/magicbees/main/utils/ItemInterface.java b/src/main/java/magicbees/main/utils/ItemInterface.java index 6bbf1b3..7fe6ce5 100644 --- a/src/main/java/magicbees/main/utils/ItemInterface.java +++ b/src/main/java/magicbees/main/utils/ItemInterface.java @@ -4,42 +4,34 @@ import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -public class ItemInterface -{ - public static ItemStack getItemStack(String item) - { - return GameRegistry.findItemStack("Forestry", item, 1); - } +public class ItemInterface { + public static ItemStack getItemStack(String item) { + return GameRegistry.findItemStack("Forestry", item, 1); + } - public static ItemStack getItemStack(String modId, String item) - { - return GameRegistry.findItemStack(modId, item, 1); - } + public static ItemStack getItemStack(String modId, String item) { + return GameRegistry.findItemStack(modId, item, 1); + } - public static ItemStack getItemStack(String modId, String item, int stackSize) - { - return GameRegistry.findItemStack(modId, item, stackSize); - } + public static ItemStack getItemStack(String modId, String item, int stackSize) { + return GameRegistry.findItemStack(modId, item, stackSize); + } - public static Item getItem(String item) - { - Item i; - i = GameRegistry.findItem("Forestry", item); - if (i == null) - { - LogHelper.warn("Trying to get Item " + item + " from Forestry which does not exist!"); - } - return i; - } + public static Item getItem(String item) { + Item i; + i = GameRegistry.findItem("Forestry", item); + if (i == null) { + LogHelper.warn("Trying to get Item " + item + " from Forestry which does not exist!"); + } + return i; + } - public static Item getItem(String modId, String item) - { - Item i; - i = GameRegistry.findItem(modId, item); - if (i == null) - { - LogHelper.warn("Trying to get Item " + item + " from " + modId + " which does not exist!"); - } - return i; - } + public static Item getItem(String modId, String item) { + Item i; + i = GameRegistry.findItem(modId, item); + if (i == null) { + LogHelper.warn("Trying to get Item " + item + " from " + modId + " which does not exist!"); + } + return i; + } } diff --git a/src/main/java/magicbees/main/utils/ItemStackUtils.java b/src/main/java/magicbees/main/utils/ItemStackUtils.java index 4cc9560..674d090 100644 --- a/src/main/java/magicbees/main/utils/ItemStackUtils.java +++ b/src/main/java/magicbees/main/utils/ItemStackUtils.java @@ -4,100 +4,101 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; public class ItemStackUtils { - - /** - * Attempts to add all items to the inventory, starting at startSlot and considering slotCount item slots. - * @return Number of items successfully added to the inventory. - */ - public static int tryAddItemStacksToInvenotry(IInventory inventory, ItemStack[] items, int startSlot, int slotCount) { - int itemsAdded = 0; - - for (ItemStack item : items) { - itemsAdded += addItemToInventory(inventory, item, startSlot, slotCount); - } - - return itemsAdded; - } - /** - * Attempts to add all items to the inventory, starting at startSlot and considering slotCount item slots. - * @return true if and only if all items were successfully added to the inventory. - */ - public static boolean tryAddAllItemStacksToInventory(IInventory inventory, ItemStack[] items, int startSlot, int slotCount) { - int itemsToAdd = 0; - int itemsAdded = 0; - - for (ItemStack item : items) { - itemsToAdd += item.stackSize; - itemsAdded += addItemToInventory(inventory, item, startSlot, slotCount); - } - - return itemsToAdd == itemsAdded; - } - - /** - * Attempts to add an item to an inventory, starting at startSlot and considering slotCount item slots. - * @return number of items in the stack successfully added to the inventory. - */ - public static int addItemToInventory(IInventory inventory, ItemStack item, int startSlot, int slotCount) { - int itemsAdded = 0; - - itemsAdded = addToExistingSlot(inventory, item, startSlot, slotCount); - if (itemsAdded < item.stackSize) { - item.stackSize -= itemsAdded; - itemsAdded += addToEmptySlot(inventory, item, startSlot, slotCount); - } - - return itemsAdded; - } + /** + * Attempts to add all items to the inventory, starting at startSlot and considering slotCount item slots. + * @return Number of items successfully added to the inventory. + */ + public static int tryAddItemStacksToInvenotry( + IInventory inventory, ItemStack[] items, int startSlot, int slotCount) { + int itemsAdded = 0; - private static int addToExistingSlot(IInventory inventory, ItemStack item, int startSlot, int slotCount) { - int itemsAdded = 0; - - for (int slotIndex = startSlot; slotIndex < (startSlot + slotCount); ++slotIndex) { - ItemStack slotStack = inventory.getStackInSlot(slotIndex); - - // Skip empty slots. - if (slotStack != null && areItemsEqualNBT(item, slotStack)) { - int spaceAvailable = slotStack.getMaxStackSize() - slotStack.stackSize; - - if (spaceAvailable > item.stackSize) { - slotStack.stackSize += item.stackSize; - inventory.setInventorySlotContents(slotIndex, slotStack); - itemsAdded += item.stackSize; - item.stackSize = 0; - } - else if (spaceAvailable > 0) { - slotStack.stackSize = slotStack.getMaxStackSize(); - inventory.setInventorySlotContents(slotIndex, slotStack); - itemsAdded += spaceAvailable; - item.stackSize -= spaceAvailable; - } - } - - // Don't add beyond what we have. - if (item.stackSize == 0) { - break; - } - } - - return itemsAdded; - } - - private static int addToEmptySlot(IInventory inventory, ItemStack item, int startSlot, int slotCount) { - for (int slotIndex = startSlot; slotIndex < (startSlot + slotCount); ++slotIndex) { - ItemStack slotStack = inventory.getStackInSlot(slotIndex); - - if (slotStack == null) { - inventory.setInventorySlotContents(slotIndex, item); - return item.stackSize; - } - } - - return 0; - } + for (ItemStack item : items) { + itemsAdded += addItemToInventory(inventory, item, startSlot, slotCount); + } - public static boolean areItemsEqualNBT(ItemStack item, ItemStack otherItem) { - return item.isItemEqual(otherItem) && ItemStack.areItemStackTagsEqual(item, otherItem); - } + return itemsAdded; + } + + /** + * Attempts to add all items to the inventory, starting at startSlot and considering slotCount item slots. + * @return true if and only if all items were successfully added to the inventory. + */ + public static boolean tryAddAllItemStacksToInventory( + IInventory inventory, ItemStack[] items, int startSlot, int slotCount) { + int itemsToAdd = 0; + int itemsAdded = 0; + + for (ItemStack item : items) { + itemsToAdd += item.stackSize; + itemsAdded += addItemToInventory(inventory, item, startSlot, slotCount); + } + + return itemsToAdd == itemsAdded; + } + + /** + * Attempts to add an item to an inventory, starting at startSlot and considering slotCount item slots. + * @return number of items in the stack successfully added to the inventory. + */ + public static int addItemToInventory(IInventory inventory, ItemStack item, int startSlot, int slotCount) { + int itemsAdded = 0; + + itemsAdded = addToExistingSlot(inventory, item, startSlot, slotCount); + if (itemsAdded < item.stackSize) { + item.stackSize -= itemsAdded; + itemsAdded += addToEmptySlot(inventory, item, startSlot, slotCount); + } + + return itemsAdded; + } + + private static int addToExistingSlot(IInventory inventory, ItemStack item, int startSlot, int slotCount) { + int itemsAdded = 0; + + for (int slotIndex = startSlot; slotIndex < (startSlot + slotCount); ++slotIndex) { + ItemStack slotStack = inventory.getStackInSlot(slotIndex); + + // Skip empty slots. + if (slotStack != null && areItemsEqualNBT(item, slotStack)) { + int spaceAvailable = slotStack.getMaxStackSize() - slotStack.stackSize; + + if (spaceAvailable > item.stackSize) { + slotStack.stackSize += item.stackSize; + inventory.setInventorySlotContents(slotIndex, slotStack); + itemsAdded += item.stackSize; + item.stackSize = 0; + } else if (spaceAvailable > 0) { + slotStack.stackSize = slotStack.getMaxStackSize(); + inventory.setInventorySlotContents(slotIndex, slotStack); + itemsAdded += spaceAvailable; + item.stackSize -= spaceAvailable; + } + } + + // Don't add beyond what we have. + if (item.stackSize == 0) { + break; + } + } + + return itemsAdded; + } + + private static int addToEmptySlot(IInventory inventory, ItemStack item, int startSlot, int slotCount) { + for (int slotIndex = startSlot; slotIndex < (startSlot + slotCount); ++slotIndex) { + ItemStack slotStack = inventory.getStackInSlot(slotIndex); + + if (slotStack == null) { + inventory.setInventorySlotContents(slotIndex, item); + return item.stackSize; + } + } + + return 0; + } + + public static boolean areItemsEqualNBT(ItemStack item, ItemStack otherItem) { + return item.isItemEqual(otherItem) && ItemStack.areItemStackTagsEqual(item, otherItem); + } } diff --git a/src/main/java/magicbees/main/utils/LocalizationManager.java b/src/main/java/magicbees/main/utils/LocalizationManager.java index cee696c..113ba20 100644 --- a/src/main/java/magicbees/main/utils/LocalizationManager.java +++ b/src/main/java/magicbees/main/utils/LocalizationManager.java @@ -2,29 +2,20 @@ package magicbees.main.utils; import net.minecraft.util.StatCollector; -public class LocalizationManager -{ - public static String getLocalizedString(String key) - { - if(StatCollector.canTranslate(key)) - { - return StatCollector.translateToLocal(key); - } - else - { - return StatCollector.translateToFallback(key); - } - } +public class LocalizationManager { + public static String getLocalizedString(String key) { + if (StatCollector.canTranslate(key)) { + return StatCollector.translateToLocal(key); + } else { + return StatCollector.translateToFallback(key); + } + } - public static String getLocalizedString(String key, Object... objects) - { - if(StatCollector.canTranslate(key)) - { - return String.format(StatCollector.translateToLocal(key), objects); - } - else - { - return String.format(StatCollector.translateToFallback(key), objects); - } - } + public static String getLocalizedString(String key, Object... objects) { + if (StatCollector.canTranslate(key)) { + return String.format(StatCollector.translateToLocal(key), objects); + } else { + return String.format(StatCollector.translateToFallback(key), objects); + } + } } diff --git a/src/main/java/magicbees/main/utils/LogHelper.java b/src/main/java/magicbees/main/utils/LogHelper.java index 3d5f2a3..a9f5365 100644 --- a/src/main/java/magicbees/main/utils/LogHelper.java +++ b/src/main/java/magicbees/main/utils/LogHelper.java @@ -3,50 +3,40 @@ package magicbees.main.utils; import cpw.mods.fml.common.FMLLog; import org.apache.logging.log4j.Level; -public class LogHelper -{ - public static void log(Level logLevel, Object object) - { - FMLLog.log(VersionInfo.ModName, logLevel, String.valueOf(object)); - } +public class LogHelper { + public static void log(Level logLevel, Object object) { + FMLLog.log(VersionInfo.ModName, logLevel, String.valueOf(object)); + } - public static void all(Object object) - { - log(Level.ALL, object); - } + public static void all(Object object) { + log(Level.ALL, object); + } - public static void debug(Object object) - { - log(Level.DEBUG, object); - } + public static void debug(Object object) { + log(Level.DEBUG, object); + } - public static void error(Object object) - { - log(Level.ERROR, object); - } + public static void error(Object object) { + log(Level.ERROR, object); + } - public static void fatal(Object object) - { - log(Level.FATAL, object); - } + public static void fatal(Object object) { + log(Level.FATAL, object); + } - public static void info(Object object) - { - log(Level.INFO, object); - } + public static void info(Object object) { + log(Level.INFO, object); + } - public static void off(Object object) - { - log(Level.OFF, object); - } + public static void off(Object object) { + log(Level.OFF, object); + } - public static void trace(Object object) - { - log(Level.TRACE, object); - } + public static void trace(Object object) { + log(Level.TRACE, object); + } - public static void warn(Object object) - { - log(Level.WARN, object); - } + public static void warn(Object object) { + log(Level.WARN, object); + } } diff --git a/src/main/java/magicbees/main/utils/MoonPhase.java b/src/main/java/magicbees/main/utils/MoonPhase.java index 811e733..9ef38eb 100644 --- a/src/main/java/magicbees/main/utils/MoonPhase.java +++ b/src/main/java/magicbees/main/utils/MoonPhase.java @@ -7,53 +7,52 @@ import net.minecraft.world.World; * Class to abstract the moon phase from the world time a bit. */ public enum MoonPhase { - FULL("full"), - WANING_GIBBOUS("gibbousWaning"), - WANING_HALF("halfWaning"), - WANING_CRESCENT("crescentWaning"), - NEW("new"), - WAXING_CRESCENT("crescentWaxing"), - WAXING_HALF("halfWaxing"), - WAXING_GIBBOUS("gibbousWaxing"); + FULL("full"), + WANING_GIBBOUS("gibbousWaning"), + WANING_HALF("halfWaning"), + WANING_CRESCENT("crescentWaning"), + NEW("new"), + WAXING_CRESCENT("crescentWaxing"), + WAXING_HALF("halfWaxing"), + WAXING_GIBBOUS("gibbousWaxing"); - private String phaseName; + private String phaseName; - private MoonPhase(String name) { - this.phaseName = name; - } + private MoonPhase(String name) { + this.phaseName = name; + } - public boolean isBetween(MoonPhase first, MoonPhase second) { - boolean flag = false; + public boolean isBetween(MoonPhase first, MoonPhase second) { + boolean flag = false; - if (first.ordinal() <= second.ordinal()) { - // Straightforward. - flag = first.ordinal() <= this.ordinal() && this.ordinal() <= second.ordinal(); - } - else { - // Wraps around the boundary. - flag = (first.ordinal() <= this.ordinal() && this.ordinal() <= WAXING_GIBBOUS.ordinal()) || - (FULL.ordinal() <= this.ordinal() && this.ordinal() <= second.ordinal()); - } + if (first.ordinal() <= second.ordinal()) { + // Straightforward. + flag = first.ordinal() <= this.ordinal() && this.ordinal() <= second.ordinal(); + } else { + // Wraps around the boundary. + flag = (first.ordinal() <= this.ordinal() && this.ordinal() <= WAXING_GIBBOUS.ordinal()) + || (FULL.ordinal() <= this.ordinal() && this.ordinal() <= second.ordinal()); + } - return flag; - } + return flag; + } - public String getLocalizedName() { - return LocalizationManager.getLocalizedString("moon." + this.phaseName); - } - - public String getLocalizedNameAlt() { - if (StatCollector.canTranslate("moon.alt." + this.phaseName)) { - return LocalizationManager.getLocalizedString("moon.alt." + this.phaseName); - } - return getLocalizedName(); - } + public String getLocalizedName() { + return LocalizationManager.getLocalizedString("moon." + this.phaseName); + } - public static MoonPhase getMoonPhase(World w) { - return getMoonPhaseFromTime(w.getWorldTime()); - } + public String getLocalizedNameAlt() { + if (StatCollector.canTranslate("moon.alt." + this.phaseName)) { + return LocalizationManager.getLocalizedString("moon.alt." + this.phaseName); + } + return getLocalizedName(); + } - public static MoonPhase getMoonPhaseFromTime(long time) { - return MoonPhase.values()[(int)((time - 6000) / 24000L) % 8]; - } + public static MoonPhase getMoonPhase(World w) { + return getMoonPhaseFromTime(w.getWorldTime()); + } + + public static MoonPhase getMoonPhaseFromTime(long time) { + return MoonPhase.values()[(int) ((time - 6000) / 24000L) % 8]; + } } diff --git a/src/main/java/magicbees/main/utils/TabMagicBees.java b/src/main/java/magicbees/main/utils/TabMagicBees.java index 3e5fca4..38cf924 100644 --- a/src/main/java/magicbees/main/utils/TabMagicBees.java +++ b/src/main/java/magicbees/main/utils/TabMagicBees.java @@ -5,17 +5,16 @@ import magicbees.main.Config; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; -public class TabMagicBees extends CreativeTabs -{ - public static TabMagicBees tabMagicBees = new TabMagicBees(); +public class TabMagicBees extends CreativeTabs { + public static TabMagicBees tabMagicBees = new TabMagicBees(); - public TabMagicBees() - { - super(getNextID(), "magicBees"); - } + public TabMagicBees() { + super(getNextID(), "magicBees"); + } - public Item getTabIconItem() - { - return Config.miscResources.getStackForType(ResourceType.RESEARCH_BEEINFUSION).getItem(); - } -} \ No newline at end of file + public Item getTabIconItem() { + return Config.miscResources + .getStackForType(ResourceType.RESEARCH_BEEINFUSION) + .getItem(); + } +} diff --git a/src/main/java/magicbees/main/utils/TickHandlerVersion.java b/src/main/java/magicbees/main/utils/TickHandlerVersion.java index 0327892..0a2f68f 100644 --- a/src/main/java/magicbees/main/utils/TickHandlerVersion.java +++ b/src/main/java/magicbees/main/utils/TickHandlerVersion.java @@ -1,5 +1,9 @@ package magicbees.main.utils; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; import magicbees.main.Config; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; @@ -8,84 +12,87 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; public class TickHandlerVersion { - - private static int TICK_POLL_INTERVAL = 250; - private static class LazyHolder { - private static final TickHandlerVersion instance = new TickHandlerVersion(); - } + private static int TICK_POLL_INTERVAL = 250; + + private static class LazyHolder { + private static final TickHandlerVersion instance = new TickHandlerVersion(); + } private int ticksToPoll; private VersionInfo versionInfo; - private final ChatStyle newVersion = new ChatStyle().setColor(EnumChatFormatting.GOLD).setBold(true); + private final ChatStyle newVersion = + new ChatStyle().setColor(EnumChatFormatting.GOLD).setBold(true); private final ChatStyle description = new ChatStyle().setColor(EnumChatFormatting.GRAY); private final ChatStyle alert = new ChatStyle().setColor(EnumChatFormatting.RED); - + private TickHandlerVersion() { - ticksToPoll = TICK_POLL_INTERVAL; + ticksToPoll = TICK_POLL_INTERVAL; } - + private void setVersionInfo(VersionInfo vInfo) { - versionInfo = vInfo; + versionInfo = vInfo; } - + @SubscribeEvent public void tickStart(PlayerTickEvent evt) { - if (evt.phase != Phase.START) { - return; - } - if (ticksToPoll > 0) { - ticksToPoll--; - return; - } - ticksToPoll = TICK_POLL_INTERVAL; - - if (versionInfo.versionCheckComplete) { - unsubscribeFromBus(); - - if (updateNotificationsEnabledOrCriticalUpdate()) { - sendNotificationToPlayer(evt.player); - } - } + if (evt.phase != Phase.START) { + return; + } + if (ticksToPoll > 0) { + ticksToPoll--; + return; + } + ticksToPoll = TICK_POLL_INTERVAL; + + if (versionInfo.versionCheckComplete) { + unsubscribeFromBus(); + + if (updateNotificationsEnabledOrCriticalUpdate()) { + sendNotificationToPlayer(evt.player); + } + } } - + private void sendNotificationToPlayer(EntityPlayer player) { - if (versionInfo.isCriticalUpdate()) { - player.addChatMessage(new ChatComponentTranslation("magicbees.versioning.critical", versionInfo.getLatestVersion()).setChatStyle(alert)); - } - else { - player.addChatMessage(new ChatComponentTranslation("magicbees.versioning.newVersion", versionInfo.getLatestVersion()).setChatStyle(newVersion)); - } - ChatStyle thisDescription = description.createShallowCopy(); - thisDescription.setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, VersionInfo.DownloadURL)); - thisDescription.setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(versionInfo.getVersionDescription()))); - player.addChatMessage(new ChatComponentTranslation("magicbees.versioning.clickDownload").setChatStyle(thisDescription)); - } - - private boolean updateNotificationsEnabledOrCriticalUpdate() { - return (!Config.disableUpdateNotification || versionInfo.isCriticalUpdate()) && versionInfo.isNewVersionAvailable(); - } - - private void subscribeToBus() { - FMLCommonHandler.instance().bus().register(this); + if (versionInfo.isCriticalUpdate()) { + player.addChatMessage( + new ChatComponentTranslation("magicbees.versioning.critical", versionInfo.getLatestVersion()) + .setChatStyle(alert)); + } else { + player.addChatMessage( + new ChatComponentTranslation("magicbees.versioning.newVersion", versionInfo.getLatestVersion()) + .setChatStyle(newVersion)); + } + ChatStyle thisDescription = description.createShallowCopy(); + thisDescription.setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, VersionInfo.DownloadURL)); + thisDescription.setChatHoverEvent(new HoverEvent( + HoverEvent.Action.SHOW_TEXT, new ChatComponentText(versionInfo.getVersionDescription()))); + player.addChatMessage( + new ChatComponentTranslation("magicbees.versioning.clickDownload").setChatStyle(thisDescription)); } - + + private boolean updateNotificationsEnabledOrCriticalUpdate() { + return (!Config.disableUpdateNotification || versionInfo.isCriticalUpdate()) + && versionInfo.isNewVersionAvailable(); + } + + private void subscribeToBus() { + FMLCommonHandler.instance().bus().register(this); + } + private void unsubscribeFromBus() { - FMLCommonHandler.instance().bus().unregister(this); + FMLCommonHandler.instance().bus().unregister(this); + } + + public static void go(VersionInfo vInfo) { + LazyHolder.instance.setVersionInfo(vInfo); + LazyHolder.instance.subscribeToBus(); } - public static void go(VersionInfo vInfo) { - LazyHolder.instance.setVersionInfo(vInfo); - LazyHolder.instance.subscribeToBus(); - } - /*@Override public void tickStart(EnumSet type, Object... tickData) { @@ -109,4 +116,4 @@ public class TickHandlerVersion { } } */ -} \ No newline at end of file +} diff --git a/src/main/java/magicbees/main/utils/Tuple.java b/src/main/java/magicbees/main/utils/Tuple.java index 245f54f..72194f7 100644 --- a/src/main/java/magicbees/main/utils/Tuple.java +++ b/src/main/java/magicbees/main/utils/Tuple.java @@ -2,11 +2,11 @@ package magicbees.main.utils; public class Tuple { - public final X left; - public final Y right; - - public Tuple(X x, Y y) { - left = x; - right = y; - } + public final X left; + public final Y right; + + public Tuple(X x, Y y) { + left = x; + right = y; + } } diff --git a/src/main/java/magicbees/main/utils/VersionInfo.java b/src/main/java/magicbees/main/utils/VersionInfo.java index 84088fe..8ff6a8b 100644 --- a/src/main/java/magicbees/main/utils/VersionInfo.java +++ b/src/main/java/magicbees/main/utils/VersionInfo.java @@ -1,5 +1,6 @@ package magicbees.main.utils; +import cpw.mods.fml.common.FMLLog; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; @@ -7,218 +8,187 @@ import java.net.URL; import java.util.ArrayList; import java.util.logging.Logger; -import cpw.mods.fml.common.FMLLog; - /** * Using some of the VersionInfo code from cofh. (Thanks, Lemming!) * * @author MysteriousAges */ -public class VersionInfo -{ - public static final String ModName = "MagicBees"; - public static final String Version = "GRADLETOKEN_VERSION"; - public static final String VersionURL = "https://raw.githubusercontent.com/MagicBees/MagicBees/master/etc/version-1.7.txt"; - public static final String DownloadURL = "http://minecraft.curseforge.com/mc-mods/65764-magic-bees/files"; - public static final String GUI_FACTORY_CLASS = "magicbees.client.gui.GuiFactory"; +public class VersionInfo { + public static final String ModName = "MagicBees"; + public static final String Version = "GRADLETOKEN_VERSION"; + public static final String VersionURL = + "https://raw.githubusercontent.com/MagicBees/MagicBees/master/etc/version-1.7.txt"; + public static final String DownloadURL = "http://minecraft.curseforge.com/mc-mods/65764-magic-bees/files"; + public static final String GUI_FACTORY_CLASS = "magicbees.client.gui.GuiFactory"; - public static final String Logo = "/gfx/magicbees/logo.png"; + public static final String Logo = "/gfx/magicbees/logo.png"; - public static final String Depends = "required-after:Forestry@[4.2.5,);after:Thaumcraft;after:ExtraBees;after:EE3;after:ArsMagica;after:TConstruct;after:Railcraft;after:ThermalFoundation;after:ThermalExpansion;after:RedstoneArsenal;after:AWWayofTime;after:Botania;after:appliedenergistics2;after:gregtech"; + public static final String Depends = + "required-after:Forestry@[4.2.5,);after:Thaumcraft;after:ExtraBees;after:EE3;after:ArsMagica;after:TConstruct;after:Railcraft;after:ThermalFoundation;after:ThermalExpansion;after:RedstoneArsenal;after:AWWayofTime;after:Botania;after:appliedenergistics2;after:gregtech"; - boolean criticalUpdate; - boolean newVersion; - boolean versionCheckComplete; + boolean criticalUpdate; + boolean newVersion; + boolean versionCheckComplete; - String latestModVersion; - String description = ""; + String latestModVersion; + String description = ""; - String modName; - String modVersion; - String releaseURL; + String modName; + String modVersion; + String releaseURL; - public static int[] parseVersion(String rawVersion) - { - ArrayList versionTokens = new ArrayList(); - String[] tokens = rawVersion.trim().split("[\\. ]"); + public static int[] parseVersion(String rawVersion) { + ArrayList versionTokens = new ArrayList(); + String[] tokens = rawVersion.trim().split("[\\. ]"); - for (int i = 0; i < tokens.length; ++i) - { - tokens[i] = tokens[i].trim(); - if (tokens[i].matches("[0-9]+")) - { - versionTokens.add(Integer.valueOf(tokens[i])); - } - else if (tokens[i].matches("[0-9]+[a-z]")) - { - String numberString = tokens[i].substring(0, tokens[i].length() - 1); - versionTokens.add(Integer.valueOf(numberString)); - versionTokens.add(Character.getNumericValue(tokens[i].charAt(tokens[i].length() - 1))); - } - } + for (int i = 0; i < tokens.length; ++i) { + tokens[i] = tokens[i].trim(); + if (tokens[i].matches("[0-9]+")) { + versionTokens.add(Integer.valueOf(tokens[i])); + } else if (tokens[i].matches("[0-9]+[a-z]")) { + String numberString = tokens[i].substring(0, tokens[i].length() - 1); + versionTokens.add(Integer.valueOf(numberString)); + versionTokens.add(Character.getNumericValue(tokens[i].charAt(tokens[i].length() - 1))); + } + } - // Can't use versionTokens.toArray 'cause that returns an Integer[], not int[] - int[] value = new int[versionTokens.size()]; - for (int i = 0; i < value.length; ++i) - { - value[i] = versionTokens.get(i).intValue(); - } - return value; - } + // Can't use versionTokens.toArray 'cause that returns an Integer[], not int[] + int[] value = new int[versionTokens.size()]; + for (int i = 0; i < value.length; ++i) { + value[i] = versionTokens.get(i).intValue(); + } + return value; + } - public static boolean beforeTargetVersion(String version, String target) - { - boolean result = false; - int[] versionTokens = parseVersion(version); - int[] targetTokens = parseVersion(target); + public static boolean beforeTargetVersion(String version, String target) { + boolean result = false; + int[] versionTokens = parseVersion(version); + int[] targetTokens = parseVersion(target); - for (int i = 0; i < versionTokens.length && i < targetTokens.length; ++i) - { - if (versionTokens[i] < targetTokens[i]) - { - result = true; - break; - } - else if (versionTokens[i] > targetTokens[i]) - { - result = false; - break; - } + for (int i = 0; i < versionTokens.length && i < targetTokens.length; ++i) { + if (versionTokens[i] < targetTokens[i]) { + result = true; + break; + } else if (versionTokens[i] > targetTokens[i]) { + result = false; + break; + } - if (i == versionTokens.length - 1 && versionTokens.length < targetTokens.length) - { - // If the versions compared are the same, but target has an extra token, it's probably a "letter" build - // and is ahead of this one. - result = true; - } - } + if (i == versionTokens.length - 1 && versionTokens.length < targetTokens.length) { + // If the versions compared are the same, but target has an extra token, it's probably a "letter" build + // and is ahead of this one. + result = true; + } + } - return result; - } + return result; + } - public static boolean afterTargetVersion(String version, String target) - { - boolean result = false; - int[] versionTokens = parseVersion(version); - int[] targetTokens = parseVersion(target); + public static boolean afterTargetVersion(String version, String target) { + boolean result = false; + int[] versionTokens = parseVersion(version); + int[] targetTokens = parseVersion(target); - for (int i = 0; i < versionTokens.length && i < targetTokens.length; ++i) - { - if (versionTokens[i] > targetTokens[i]) - { - result = true; - break; - } - } + for (int i = 0; i < versionTokens.length && i < targetTokens.length; ++i) { + if (versionTokens[i] > targetTokens[i]) { + result = true; + break; + } + } - return result; - } + return result; + } - public VersionInfo(String name, String version, String url) - { - modName = name; - modVersion = latestModVersion = version; - releaseURL = url; - } + public VersionInfo(String name, String version, String url) { + modName = name; + modVersion = latestModVersion = version; + releaseURL = url; + } - public VersionInfo(String name, String version, String url, Logger logger) - { - modName = name; - modVersion = latestModVersion = version; - releaseURL = url; - } + public VersionInfo(String name, String version, String url, Logger logger) { + modName = name; + modVersion = latestModVersion = version; + releaseURL = url; + } - public void checkForNewVersion() - { - Thread versionCheckThread = new VersionCheckThread(); - versionCheckThread.start(); - } + public void checkForNewVersion() { + Thread versionCheckThread = new VersionCheckThread(); + versionCheckThread.start(); + } - public String getCurrentVersion() - { - return modVersion; - } + public String getCurrentVersion() { + return modVersion; + } - public String getLatestVersion() - { - return latestModVersion; - } + public String getLatestVersion() { + return latestModVersion; + } - public String getVersionDescription() - { - return description; - } + public String getVersionDescription() { + return description; + } - public boolean isCriticalUpdate() - { - return criticalUpdate; - } + public boolean isCriticalUpdate() { + return criticalUpdate; + } - public boolean isNewVersionAvailable() - { - return newVersion; - } + public boolean isNewVersionAvailable() { + return newVersion; + } - public boolean isVersionCheckComplete() - { - return versionCheckComplete; - } + public boolean isVersionCheckComplete() { + return versionCheckComplete; + } - private class VersionCheckThread extends Thread - { - @Override - public void run() - { - try - { - String location = VersionURL; + private class VersionCheckThread extends Thread { + @Override + public void run() { + try { + String location = VersionURL; - HttpURLConnection connection = null; + HttpURLConnection connection = null; - // Used to "dereference" any location headers we may get. - while (location != null && !location.isEmpty()) - { - URL url = new URL(location); - connection = (HttpURLConnection)url.openConnection(); - connection.setRequestProperty("User-Agent", - "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.60 Safari/537.17"); - connection.connect(); - location = connection.getHeaderField("Location"); - } + // Used to "dereference" any location headers we may get. + while (location != null && !location.isEmpty()) { + URL url = new URL(location); + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestProperty( + "User-Agent", + "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.60 Safari/537.17"); + connection.connect(); + location = connection.getHeaderField("Location"); + } - BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - latestModVersion = reader.readLine(); - criticalUpdate = Boolean.parseBoolean(reader.readLine()); - while (reader.ready()) { - description = description + reader.readLine(); - } - reader.close(); + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + latestModVersion = reader.readLine(); + criticalUpdate = Boolean.parseBoolean(reader.readLine()); + while (reader.ready()) { + description = description + reader.readLine(); + } + reader.close(); - if (beforeTargetVersion(modVersion, latestModVersion)) - { - FMLLog.info("An updated version of " + modName + " is available: " + latestModVersion + ". You are currently using " + Version); - newVersion = true; - if (criticalUpdate) - { - LogHelper.info("This update has been marked as CRITICAL and will ignore notification suppression."); - } - } + if (beforeTargetVersion(modVersion, latestModVersion)) { + FMLLog.info("An updated version of " + modName + " is available: " + latestModVersion + + ". You are currently using " + Version); + newVersion = true; + if (criticalUpdate) { + LogHelper.info( + "This update has been marked as CRITICAL and will ignore notification suppression."); + } + } - } - catch (Exception e) - { - LogHelper.warn("Version check Failed: " + e.getMessage()); - } - versionCheckComplete = true; - } - } + } catch (Exception e) { + LogHelper.warn("Version check Failed: " + e.getMessage()); + } + versionCheckComplete = true; + } + } - public static void doVersionCheck() - { - VersionInfo versionInfo = new VersionInfo(ModName, Version, VersionURL); - TickHandlerVersion.go(versionInfo); + public static void doVersionCheck() { + VersionInfo versionInfo = new VersionInfo(ModName, Version, VersionURL); + TickHandlerVersion.go(versionInfo); - VersionCheckThread thread = versionInfo.new VersionCheckThread(); - thread.start(); - } + VersionCheckThread thread = versionInfo.new VersionCheckThread(); + thread.start(); + } } diff --git a/src/main/java/magicbees/main/utils/compat/AppliedEnergisticsHelper.java b/src/main/java/magicbees/main/utils/compat/AppliedEnergisticsHelper.java index 982d4af..a0fb7ed 100644 --- a/src/main/java/magicbees/main/utils/compat/AppliedEnergisticsHelper.java +++ b/src/main/java/magicbees/main/utils/compat/AppliedEnergisticsHelper.java @@ -1,35 +1,35 @@ package magicbees.main.utils.compat; -import magicbees.main.Config; -import net.minecraft.block.Block; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; +import magicbees.main.Config; +import net.minecraft.block.Block; public class AppliedEnergisticsHelper implements IModHelper { - - public static Block skystone; - - public static final String Name = "appliedenergistics2"; - private static boolean isModActive = false; - - public static boolean isActive() { - return isModActive; - } - public void preInit() { - if (Loader.isModLoaded(Name) && Config.ae2Active) { - isModActive = true; - } - } - - public void init() { - if (isActive()) { - skystone = GameRegistry.findBlock(Name, "tile.BlockSkyStone"); - } - } - - public void postInit() { - /*if (isActive()) { - }*/ - } + public static Block skystone; + + public static final String Name = "appliedenergistics2"; + private static boolean isModActive = false; + + public static boolean isActive() { + return isModActive; + } + + public void preInit() { + if (Loader.isModLoaded(Name) && Config.ae2Active) { + isModActive = true; + } + } + + public void init() { + if (isActive()) { + skystone = GameRegistry.findBlock(Name, "tile.BlockSkyStone"); + } + } + + public void postInit() { + /*if (isActive()) { + }*/ + } } diff --git a/src/main/java/magicbees/main/utils/compat/ArsMagicaHelper.java b/src/main/java/magicbees/main/utils/compat/ArsMagicaHelper.java index 25ff193..deaa93f 100644 --- a/src/main/java/magicbees/main/utils/compat/ArsMagicaHelper.java +++ b/src/main/java/magicbees/main/utils/compat/ArsMagicaHelper.java @@ -1,85 +1,84 @@ package magicbees.main.utils.compat; -import net.minecraft.block.Block; -import net.minecraft.item.Item; import cpw.mods.fml.common.Loader; import magicbees.main.Config; import magicbees.main.utils.BlockInterface; import magicbees.main.utils.ItemInterface; +import net.minecraft.block.Block; +import net.minecraft.item.Item; public class ArsMagicaHelper implements IModHelper { - public static Block resourceBlock; - public static Block blackOrchid; - public static Block desertNova; - public static Block aum; - public static Block wakebloom; - public static Block tarmaRoot; + public static Block resourceBlock; + public static Block blackOrchid; + public static Block desertNova; + public static Block aum; + public static Block wakebloom; + public static Block tarmaRoot; - public static Item itemResource; - public static Item essence; - - public enum ResourceType { - VINTEUM_DUST, - ARCANE_COMPOUND, - ARCANE_ASH, - PURIFIED_VINTEUM, - CHIMERITE, - BLUE_TOPAZ, - SUNSTONE, - MOONSTONE, - } + public static Item itemResource; + public static Item essence; - public enum EssenceType { - ARCANE, - EARTH, - AIR, - FIRE, - WATER, - PLANT, - ICE, - LIGHTNING, - LIFE, - ENDER, - PURE, - HIGH, - BASE, - } + public enum ResourceType { + VINTEUM_DUST, + ARCANE_COMPOUND, + ARCANE_ASH, + PURIFIED_VINTEUM, + CHIMERITE, + BLUE_TOPAZ, + SUNSTONE, + MOONSTONE, + } - private static boolean isArsMagicaPresent = false; - public static final String Name = "arsmagica2"; + public enum EssenceType { + ARCANE, + EARTH, + AIR, + FIRE, + WATER, + PLANT, + ICE, + LIGHTNING, + LIFE, + ENDER, + PURE, + HIGH, + BASE, + } - public static boolean isActive() { - return isArsMagicaPresent; - } + private static boolean isArsMagicaPresent = false; + public static final String Name = "arsmagica2"; - public void preInit() { - if (Loader.isModLoaded(Name) && Config.arsMagicaActive) { - isArsMagicaPresent = true; - } - } + public static boolean isActive() { + return isArsMagicaPresent; + } - public void init() { - if (isActive()) { - getBlocks(); - getItems(); - } - } + public void preInit() { + if (Loader.isModLoaded(Name) && Config.arsMagicaActive) { + isArsMagicaPresent = true; + } + } - public void postInit() { - } + public void init() { + if (isActive()) { + getBlocks(); + getItems(); + } + } - private static void getBlocks() { - ArsMagicaHelper.resourceBlock = BlockInterface.getBlock(Name, "AMOres"); - ArsMagicaHelper.blackOrchid = BlockInterface.getBlock(Name, "blueOrchid"); - ArsMagicaHelper.desertNova = BlockInterface.getBlock(Name, "desertNova"); - ArsMagicaHelper.aum = BlockInterface.getBlock(Name, "aum"); - ArsMagicaHelper.wakebloom = BlockInterface.getBlock(Name, "wakebloom"); - ArsMagicaHelper.tarmaRoot = BlockInterface.getBlock(Name, "tarmaRoot"); - } + public void postInit() {} - private static void getItems() { - ArsMagicaHelper.itemResource = ItemInterface.getItem(Name, "itemOre"); - ArsMagicaHelper.essence = ItemInterface.getItem(Name, "essence"); - } + private static void getBlocks() { + ArsMagicaHelper.resourceBlock = BlockInterface.getBlock(Name, "AMOres"); + ArsMagicaHelper.blackOrchid = BlockInterface.getBlock(Name, "blueOrchid"); + ArsMagicaHelper.desertNova = BlockInterface.getBlock(Name, "desertNova"); + ArsMagicaHelper.aum = BlockInterface.getBlock(Name, "aum"); + ArsMagicaHelper.wakebloom = BlockInterface.getBlock(Name, "wakebloom"); + ArsMagicaHelper.tarmaRoot = BlockInterface.getBlock(Name, "tarmaRoot"); + } + + private static void getItems() { + ArsMagicaHelper.itemResource = ItemInterface.getItem(Name, "itemOre"); + ArsMagicaHelper.essence = ItemInterface.getItem(Name, "essence"); + } } diff --git a/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java b/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java index bdc2a83..bfc8bb5 100644 --- a/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java +++ b/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java @@ -1,5 +1,9 @@ package magicbees.main.utils.compat; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import magicbees.bees.BeeManager; import magicbees.item.types.PollenType; import magicbees.main.Config; @@ -17,212 +21,232 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.IIcon; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; -import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.mana.ManaItemHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BotaniaHelper implements IModHelper { - - @SideOnly(Side.CLIENT) - public static IIcon subtileIcons[]; - public static final String LEXICON_ENTRY_MANA_GEAR = "manaGear"; - public static final String LEXICON_ENTRY_ELF_RESOURCES = "elfResources"; - - public enum ManaResource { - MANASTEEL, - MANAPEARL, - MANADIAMOND, - LIVINGWOOD_TWIG, - TERRASTEEL, - LIFE_ESSENCE, - REDSTONE_ROOT, - ELEMENTIUM, - PIXIE_DUST, - DRAGONSTONE, - PRISMARINE_SHARD, - PLACEHOLDER, - RED_STRING, - DREAMWOOD_TWIG, - GAIA_INGOT, - ENDER_AIR_BOTTLE, - MANA_STRING, - MANASTEEL_NUGGET, - TERRASTEEL_NUGGET, - ELEMENTIUM_NUGGET, - ROOT, - PEBBLE, - MANAWEAVE_CLOTH, - MANA_POWDER - ; - } - - public enum PastureSeed { - GRASS, - PODZOL, - MYCELIUM, - ; - } - - public enum Rune { - WATER, - FIRE, - EARTH, - AIR, - SPRING, - SUMMER, - AUTUMN, - WINTER, - MANA, - LUST, - GLUTTONY, - GREED, - SLOTH, - WRATH, - ENVY, - PRIDE, - ; - } + @SideOnly(Side.CLIENT) + public static IIcon subtileIcons[]; - public static Block blockMysticalFlower; - public static Block blockLivingRock; - public static Block blockLivingWood; - public static Block blockDreamWood; - - public static Item itemPetal; - public static Item itemManaResource; - public static Item itemPastureSeed; - public static Item itemRune; - - public static ItemStack[] mysticalFlowerVariants; - - public static IRecipe manasteelGrafterRecipe; - public static IRecipe manasteelScoopRecipe; - public static IRecipe manaBoosterRecipe; - - private static boolean isBotaniaActive = false; - public static final String Name = "Botania"; + public static final String LEXICON_ENTRY_MANA_GEAR = "manaGear"; + public static final String LEXICON_ENTRY_ELF_RESOURCES = "elfResources"; - public static double beegoniaManaMultiplier; - public static double hiveacynthManaMultiplier; - public static double hiveacynthRainResistRate; - public static double hiveacynthPrincessSpawnRate; - public static double hiveacynthPristineRate; - public static double hibeescusTicksMultiplier; - public static double hibeescusManaCostMultiplier; - - public static boolean isActive() { - return isBotaniaActive; - } + public enum ManaResource { + MANASTEEL, + MANAPEARL, + MANADIAMOND, + LIVINGWOOD_TWIG, + TERRASTEEL, + LIFE_ESSENCE, + REDSTONE_ROOT, + ELEMENTIUM, + PIXIE_DUST, + DRAGONSTONE, + PRISMARINE_SHARD, + PLACEHOLDER, + RED_STRING, + DREAMWOOD_TWIG, + GAIA_INGOT, + ENDER_AIR_BOTTLE, + MANA_STRING, + MANASTEEL_NUGGET, + TERRASTEEL_NUGGET, + ELEMENTIUM_NUGGET, + ROOT, + PEBBLE, + MANAWEAVE_CLOTH, + MANA_POWDER; + } - public void preInit() { - if (Loader.isModLoaded(Name) && Config.botaniaActive) { - isBotaniaActive = true; - } - } + public enum PastureSeed { + GRASS, + PODZOL, + MYCELIUM, + ; + } - public void init() { - if (isActive()) { - getBlocks(); - getItems(); - - BotaniaAPIDistanceHelper.registerSubtiles(); - } - } + public enum Rune { + WATER, + FIRE, + EARTH, + AIR, + SPRING, + SUMMER, + AUTUMN, + WINTER, + MANA, + LUST, + GLUTTONY, + GREED, + SLOTH, + WRATH, + ENVY, + PRIDE, + ; + } - public void postInit() { - if (isActive()) { - // Hiveacynth would appreciate it if this list existed. - BeeManager.populateSpeciesListRarity(); - - GameRegistry.addRecipe(new ItemStack(Config.manasteelScoop), new Object[] { - "twt", "tmt", " t ", - 'm', new ItemStack(itemManaResource, 1, ManaResource.MANASTEEL.ordinal()), - 'w', Blocks.wool, - 't', Items.stick - }); - manasteelScoopRecipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1); - - GameRegistry.addRecipe(new ItemStack(Config.manasteelGrafter), new Object[] { - " m", " t ", "t ", - 'm', new ItemStack(itemManaResource, 1, ManaResource.MANASTEEL.ordinal()), - 't', Items.stick - }); - manasteelGrafterRecipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1); - - GameRegistry.addRecipe(new ItemStack(Config.manaAuraProvider), new Object[] { - "lsl", "pmp", "sss", - 's', blockLivingRock, - 'm', new ItemStack(itemManaResource, 1, ManaResource.MANASTEEL.ordinal()), - 'p', Config.pollen.getStackForType(PollenType.UNUSUAL), - 'l', new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()) - }); - manaBoosterRecipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1); - - BotaniaAPIDistanceHelper.setupCraftingAndLexicon(); - } - } + public static Block blockMysticalFlower; + public static Block blockLivingRock; + public static Block blockLivingWood; + public static Block blockDreamWood; - public static void getBlocks() { - blockMysticalFlower = BlockInterface.getBlock(Name, "flower"); - blockLivingRock = BlockInterface.getBlock(Name, "livingrock"); - blockLivingWood = BlockInterface.getBlock(Name, "livingwood"); - blockDreamWood = BlockInterface.getBlock(Name, "dreamwood"); - - // Generate 16-colour flowers. - mysticalFlowerVariants = new ItemStack[16]; - for (int i = 0; i < 16; i++) { - mysticalFlowerVariants[i] = new ItemStack(blockMysticalFlower, 1, i); - } - } + public static Item itemPetal; + public static Item itemManaResource; + public static Item itemPastureSeed; + public static Item itemRune; - public static void getItems() { - itemPetal = ItemInterface.getItem(Name, "petal"); - itemManaResource = ItemInterface.getItem(Name, "manaResource"); - itemPastureSeed = ItemInterface.getItem(Name, "grassSeeds"); - itemRune = ItemInterface.getItem(Name, "rune"); - } - - public static void doBotaniaModuleConfigs(Configuration configuration) { - Property p; + public static ItemStack[] mysticalFlowerVariants; - p = configuration.get(Config.CATEGORY_BOTANIA, "beegoniaManaMultiplier", 1.0); - p.comment = "Multiplier for the Beegonia's mana generation. Default: 1.0 (Affects duration, not throughput)"; - beegoniaManaMultiplier = p.getDouble(); - - p = configuration.get(Config.CATEGORY_BOTANIA, "hiveacynthManaMultiplier", 1.0); - p.comment = "Multiplier for the Hiveacynth's mana consumption. Default: 1.0"; - hiveacynthManaMultiplier = p.getDouble(); - - p = configuration.get(Config.CATEGORY_BOTANIA, "hiveacynthRainResistRate", 0.1); - p.comment = "Rate at which the Hiveacynth applies rain resist to spawned bees. Default: 0.1 Setting to 0 will disable."; - hiveacynthRainResistRate = p.getDouble(); - - p = configuration.get(Config.CATEGORY_BOTANIA, "hiveacynthPrincessSpawnRate", 0.09); - p.comment = "Rate at which the Hiveacynth will spawn a Princess instead of a Drone. Default: 0.09. Setting to 0 will disable."; - hiveacynthPrincessSpawnRate = p.getDouble(); - - p = configuration.get(Config.CATEGORY_BOTANIA, "hiveacynthPristineRate", 0.15); - p.comment = "Rate at which the Hiveacynth will produce a Pristine Princess, when it produces a princess. Default: 0.15. Setting to 0 will disable, setting to 1 will make every Princess produced pristine.."; - hiveacynthPristineRate = p.getDouble(); - - p = configuration.get(Config.CATEGORY_BOTANIA, "hibeescusManaCostMultiplier", 1.0); - p.comment = "Multiplier on Hibeescus mana cost, base 10,000. Default 1.0. Setting to 0 makes you a huge cheater. <3"; - hibeescusManaCostMultiplier = p.getDouble(); - - p = configuration.get(Config.CATEGORY_BOTANIA, "hibeescusTicksMultiplier", 1.0); - p.comment = "Multiplier for Hibeescus operation tick time. Multiplied against 1.5 Minecraft days with some extra randomness. Default: 1.0. Setting to 0 makes you a huge cheater. <3"; - hibeescusTicksMultiplier = p.getDouble(); - } + public static IRecipe manasteelGrafterRecipe; + public static IRecipe manasteelScoopRecipe; + public static IRecipe manaBoosterRecipe; - public static boolean requestMana(ItemStack stack, EntityPlayer player, int manaPerDamage, int charges) { - return ManaItemHandler.requestManaExactForTool(stack, player, manaPerDamage * charges, true); - } - - public static ItemStack getRune(Rune rune, int quantity) { - return new ItemStack(itemRune, quantity, rune.ordinal()); - } + private static boolean isBotaniaActive = false; + public static final String Name = "Botania"; + + public static double beegoniaManaMultiplier; + public static double hiveacynthManaMultiplier; + public static double hiveacynthRainResistRate; + public static double hiveacynthPrincessSpawnRate; + public static double hiveacynthPristineRate; + public static double hibeescusTicksMultiplier; + public static double hibeescusManaCostMultiplier; + + public static boolean isActive() { + return isBotaniaActive; + } + + public void preInit() { + if (Loader.isModLoaded(Name) && Config.botaniaActive) { + isBotaniaActive = true; + } + } + + public void init() { + if (isActive()) { + getBlocks(); + getItems(); + + BotaniaAPIDistanceHelper.registerSubtiles(); + } + } + + public void postInit() { + if (isActive()) { + // Hiveacynth would appreciate it if this list existed. + BeeManager.populateSpeciesListRarity(); + + GameRegistry.addRecipe(new ItemStack(Config.manasteelScoop), new Object[] { + "twt", + "tmt", + " t ", + 'm', + new ItemStack(itemManaResource, 1, ManaResource.MANASTEEL.ordinal()), + 'w', + Blocks.wool, + 't', + Items.stick + }); + manasteelScoopRecipe = (IRecipe) CraftingManager.getInstance() + .getRecipeList() + .get(CraftingManager.getInstance().getRecipeList().size() - 1); + + GameRegistry.addRecipe(new ItemStack(Config.manasteelGrafter), new Object[] { + " m", + " t ", + "t ", + 'm', + new ItemStack(itemManaResource, 1, ManaResource.MANASTEEL.ordinal()), + 't', + Items.stick + }); + manasteelGrafterRecipe = (IRecipe) CraftingManager.getInstance() + .getRecipeList() + .get(CraftingManager.getInstance().getRecipeList().size() - 1); + + GameRegistry.addRecipe(new ItemStack(Config.manaAuraProvider), new Object[] { + "lsl", + "pmp", + "sss", + 's', + blockLivingRock, + 'm', + new ItemStack(itemManaResource, 1, ManaResource.MANASTEEL.ordinal()), + 'p', + Config.pollen.getStackForType(PollenType.UNUSUAL), + 'l', + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()) + }); + manaBoosterRecipe = (IRecipe) CraftingManager.getInstance() + .getRecipeList() + .get(CraftingManager.getInstance().getRecipeList().size() - 1); + + BotaniaAPIDistanceHelper.setupCraftingAndLexicon(); + } + } + + public static void getBlocks() { + blockMysticalFlower = BlockInterface.getBlock(Name, "flower"); + blockLivingRock = BlockInterface.getBlock(Name, "livingrock"); + blockLivingWood = BlockInterface.getBlock(Name, "livingwood"); + blockDreamWood = BlockInterface.getBlock(Name, "dreamwood"); + + // Generate 16-colour flowers. + mysticalFlowerVariants = new ItemStack[16]; + for (int i = 0; i < 16; i++) { + mysticalFlowerVariants[i] = new ItemStack(blockMysticalFlower, 1, i); + } + } + + public static void getItems() { + itemPetal = ItemInterface.getItem(Name, "petal"); + itemManaResource = ItemInterface.getItem(Name, "manaResource"); + itemPastureSeed = ItemInterface.getItem(Name, "grassSeeds"); + itemRune = ItemInterface.getItem(Name, "rune"); + } + + public static void doBotaniaModuleConfigs(Configuration configuration) { + Property p; + + p = configuration.get(Config.CATEGORY_BOTANIA, "beegoniaManaMultiplier", 1.0); + p.comment = "Multiplier for the Beegonia's mana generation. Default: 1.0 (Affects duration, not throughput)"; + beegoniaManaMultiplier = p.getDouble(); + + p = configuration.get(Config.CATEGORY_BOTANIA, "hiveacynthManaMultiplier", 1.0); + p.comment = "Multiplier for the Hiveacynth's mana consumption. Default: 1.0"; + hiveacynthManaMultiplier = p.getDouble(); + + p = configuration.get(Config.CATEGORY_BOTANIA, "hiveacynthRainResistRate", 0.1); + p.comment = + "Rate at which the Hiveacynth applies rain resist to spawned bees. Default: 0.1 Setting to 0 will disable."; + hiveacynthRainResistRate = p.getDouble(); + + p = configuration.get(Config.CATEGORY_BOTANIA, "hiveacynthPrincessSpawnRate", 0.09); + p.comment = + "Rate at which the Hiveacynth will spawn a Princess instead of a Drone. Default: 0.09. Setting to 0 will disable."; + hiveacynthPrincessSpawnRate = p.getDouble(); + + p = configuration.get(Config.CATEGORY_BOTANIA, "hiveacynthPristineRate", 0.15); + p.comment = + "Rate at which the Hiveacynth will produce a Pristine Princess, when it produces a princess. Default: 0.15. Setting to 0 will disable, setting to 1 will make every Princess produced pristine.."; + hiveacynthPristineRate = p.getDouble(); + + p = configuration.get(Config.CATEGORY_BOTANIA, "hibeescusManaCostMultiplier", 1.0); + p.comment = + "Multiplier on Hibeescus mana cost, base 10,000. Default 1.0. Setting to 0 makes you a huge cheater. <3"; + hibeescusManaCostMultiplier = p.getDouble(); + + p = configuration.get(Config.CATEGORY_BOTANIA, "hibeescusTicksMultiplier", 1.0); + p.comment = + "Multiplier for Hibeescus operation tick time. Multiplied against 1.5 Minecraft days with some extra randomness. Default: 1.0. Setting to 0 makes you a huge cheater. <3"; + hibeescusTicksMultiplier = p.getDouble(); + } + + public static boolean requestMana(ItemStack stack, EntityPlayer player, int manaPerDamage, int charges) { + return ManaItemHandler.requestManaExactForTool(stack, player, manaPerDamage * charges, true); + } + + public static ItemStack getRune(Rune rune, int quantity) { + return new ItemStack(itemRune, quantity, rune.ordinal()); + } } diff --git a/src/main/java/magicbees/main/utils/compat/EquivalentExchangeHelper.java b/src/main/java/magicbees/main/utils/compat/EquivalentExchangeHelper.java index e6dbb55..30dc847 100644 --- a/src/main/java/magicbees/main/utils/compat/EquivalentExchangeHelper.java +++ b/src/main/java/magicbees/main/utils/compat/EquivalentExchangeHelper.java @@ -1,40 +1,38 @@ package magicbees.main.utils.compat; -import net.minecraft.item.Item; +import cpw.mods.fml.common.Loader; import magicbees.main.Config; import magicbees.main.utils.ItemInterface; -import cpw.mods.fml.common.Loader; +import net.minecraft.item.Item; public class EquivalentExchangeHelper implements IModHelper { - public static Item minuimShard; - - private static boolean isEquivalentExchangePresent = false; + public static Item minuimShard; - public static boolean isActive() { - return isEquivalentExchangePresent; - } + private static boolean isEquivalentExchangePresent = false; - public void preInit() { - if (Loader.isModLoaded("EE3") && Config.equivalentExchangeActive) { - isEquivalentExchangePresent = true; - } - } + public static boolean isActive() { + return isEquivalentExchangePresent; + } - public void init() { - if (isActive()) { - getBlocks(); - getItems(); - } - } + public void preInit() { + if (Loader.isModLoaded("EE3") && Config.equivalentExchangeActive) { + isEquivalentExchangePresent = true; + } + } - public void postInit() { - } + public void init() { + if (isActive()) { + getBlocks(); + getItems(); + } + } - private static void getBlocks() { - } + public void postInit() {} - private static void getItems() { - minuimShard = ItemInterface.getItem("EE3", "shardMinium"); - } + private static void getBlocks() {} + + private static void getItems() { + minuimShard = ItemInterface.getItem("EE3", "shardMinium"); + } } diff --git a/src/main/java/magicbees/main/utils/compat/ExtraBeesHelper.java b/src/main/java/magicbees/main/utils/compat/ExtraBeesHelper.java index b5ae253..2e45183 100644 --- a/src/main/java/magicbees/main/utils/compat/ExtraBeesHelper.java +++ b/src/main/java/magicbees/main/utils/compat/ExtraBeesHelper.java @@ -1,120 +1,119 @@ package magicbees.main.utils.compat; +import cpw.mods.fml.common.Loader; import magicbees.main.Config; import magicbees.main.utils.BlockInterface; import net.minecraft.block.Block; -import cpw.mods.fml.common.Loader; public class ExtraBeesHelper implements IModHelper { - - public enum CombType { - BARREN, - ROTTEN, - BONE, - OIL, - COAL, - FUEL, - WATER, - MILK, - FRUIT, - SEED, - ALCOHOL, - STONE, - REDSTONE, - RESIN, - IC2, - IRON, - GOLD, - COPPER, - TIN, - SILVER, - BRONZE, - URANIUM, - CLAY, - OLD, - FUNGAL, - CREOSOTE, - LATEX, - ACIDIC, - VENOMOUS, - SLIME, - BLAZE, - COFFEE, - GLACIAL, - MINT, - CITRUS, - PEAT, - SHADOW, - LEAD, - BRASS, - ELECTRUM, - ZINC, - TITANIUM, - TUNGSTEN, - STEEL, - IRIDIUM, - PLATINUM, - LAPIS, - SODALITE, - PYRITE, - BAUXITE, - CINNABAR, - SPHALERITE, - EMERALD, - RUBY, - SAPPHIRE, - OLIVINE, - DIAMOND, - RED, - YELLOW, - BLUE, - GREEN, - BLACK, - WHITE, - BROWN, - ORANGE, - CYAN, - PURPLE, - GRAY, - LIGHTBLUE, - PINK, - LIMEGREEN, - MAGENTA, - LIGHTGRAY, - NICKEL, - INVAR, - GLOWSTONE, - SALTPETER, - PULP, - MULCH, - COMPOST, - SAWDUST, - ; - } - - public static Block hiveBlock; - - public static final String Name = "ExtraBees"; - private static boolean isEBPresent = false; - public static boolean isActive() { - return isEBPresent; - } + public enum CombType { + BARREN, + ROTTEN, + BONE, + OIL, + COAL, + FUEL, + WATER, + MILK, + FRUIT, + SEED, + ALCOHOL, + STONE, + REDSTONE, + RESIN, + IC2, + IRON, + GOLD, + COPPER, + TIN, + SILVER, + BRONZE, + URANIUM, + CLAY, + OLD, + FUNGAL, + CREOSOTE, + LATEX, + ACIDIC, + VENOMOUS, + SLIME, + BLAZE, + COFFEE, + GLACIAL, + MINT, + CITRUS, + PEAT, + SHADOW, + LEAD, + BRASS, + ELECTRUM, + ZINC, + TITANIUM, + TUNGSTEN, + STEEL, + IRIDIUM, + PLATINUM, + LAPIS, + SODALITE, + PYRITE, + BAUXITE, + CINNABAR, + SPHALERITE, + EMERALD, + RUBY, + SAPPHIRE, + OLIVINE, + DIAMOND, + RED, + YELLOW, + BLUE, + GREEN, + BLACK, + WHITE, + BROWN, + ORANGE, + CYAN, + PURPLE, + GRAY, + LIGHTBLUE, + PINK, + LIMEGREEN, + MAGENTA, + LIGHTGRAY, + NICKEL, + INVAR, + GLOWSTONE, + SALTPETER, + PULP, + MULCH, + COMPOST, + SAWDUST, + ; + } - public void preInit() { - if (Loader.isModLoaded("ExtraBees") && Config.extraBeesActive) { - isEBPresent = true; - } - } + public static Block hiveBlock; - public void init() { - getBlocks(); - } + public static final String Name = "ExtraBees"; + private static boolean isEBPresent = false; - public void postInit() { - } - - private static void getBlocks() { - hiveBlock = BlockInterface.getBlock(Name, "hive"); - } + public static boolean isActive() { + return isEBPresent; + } + + public void preInit() { + if (Loader.isModLoaded("ExtraBees") && Config.extraBeesActive) { + isEBPresent = true; + } + } + + public void init() { + getBlocks(); + } + + public void postInit() {} + + private static void getBlocks() { + hiveBlock = BlockInterface.getBlock(Name, "hive"); + } } diff --git a/src/main/java/magicbees/main/utils/compat/ForestryHelper.java b/src/main/java/magicbees/main/utils/compat/ForestryHelper.java index 2f8d54e..c6adc13 100644 --- a/src/main/java/magicbees/main/utils/compat/ForestryHelper.java +++ b/src/main/java/magicbees/main/utils/compat/ForestryHelper.java @@ -1,7 +1,12 @@ package magicbees.main.utils.compat; +import forestry.api.apiculture.IAlleleBeeSpecies; +import forestry.api.apiculture.hives.HiveManager; +import forestry.api.apiculture.hives.IHiveRegistry; +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; +import forestry.api.genetics.IAllele; import java.util.Locale; - import magicbees.bees.BeeManager; import magicbees.bees.HiveDescription; import magicbees.main.Config; @@ -13,171 +18,170 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.hives.HiveManager; -import forestry.api.apiculture.hives.IHiveRegistry; -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; -import forestry.api.genetics.IAllele; public class ForestryHelper implements IModHelper { - - public enum BlockResource { - APATITE, - COPPER, - TIN,; - } - public enum CraftingMaterial { - PULSATING_DUST, // unused - PULSATING_MESH, - SILK_WISP, - WOVEN_SILK, - DISSIPATION_CHARGE, - ICE_SHARD, - SCENTED_PANELING,; - } + public enum BlockResource { + APATITE, + COPPER, + TIN, + ; + } - public enum Comb { - HONEY, - COCOA, - SIMMERING, - STRINGY, - FROZEN, - DRIPPING, - SILKY, - PARCHED, - MYSTERIOUS, - IRRADIATED, - POWDERY, - REDDENED, - DARKENED, - OMEGA, - WHEATEN, - MOSSY,; - } + public enum CraftingMaterial { + PULSATING_DUST, // unused + PULSATING_MESH, + SILK_WISP, + WOVEN_SILK, + DISSIPATION_CHARGE, + ICE_SHARD, + SCENTED_PANELING, + ; + } - public enum Propolis { - NORMAL, - STICKY, // Unused. - PULSATING, - SILKY,; - } + public enum Comb { + HONEY, + COCOA, + SIMMERING, + STRINGY, + FROZEN, + DRIPPING, + SILKY, + PARCHED, + MYSTERIOUS, + IRRADIATED, + POWDERY, + REDDENED, + DARKENED, + OMEGA, + WHEATEN, + MOSSY, + ; + } - public enum Pollen { - NORMAL, - CRYSTALLINE,; - } + public enum Propolis { + NORMAL, + STICKY, // Unused. + PULSATING, + SILKY, + ; + } - public enum CircuitBoard { - BASIC, - ENHANCED, - REFINED, - INTRICATE,; - } + public enum Pollen { + NORMAL, + CRYSTALLINE, + ; + } - public enum Tube { - COPPER, - TIN, - BRONZE, - IRON, - GOLD, - DIAMOND, - OBSIDIAN, - BLAZE, - RUBBER, - EMERALD, - APATITE, - LAPIS,; - } - - public enum ApicultureBlock { - APIARY, - ; - } + public enum CircuitBoard { + BASIC, + ENHANCED, + REFINED, + INTRICATE, + ; + } - public static final String Name = "Forestry"; + public enum Tube { + COPPER, + TIN, + BRONZE, + IRON, + GOLD, + DIAMOND, + OBSIDIAN, + BLAZE, + RUBBER, + EMERALD, + APATITE, + LAPIS, + ; + } + public enum ApicultureBlock { + APIARY, + ; + } - //----- Forestry Blocks ------------------------------------ - public static Block hiveBlock; - public static Block alvearyBlock; - public static Block apicultureBlock; - //----- Forestry Items ------------------------------------- - public static Item beeComb; - public static Item honeydew; - public static Item honeyDrop; - public static Item propolis; - public static Item pollen; - public static Item craftingResource; - public static ItemStack itemHoneycomb; + public static final String Name = "Forestry"; - public void preInit() { - IHiveRegistry hiveRegistry = HiveManager.hiveRegistry; - registerHive(hiveRegistry, HiveDescription.CURIOUS); - registerHive(hiveRegistry, HiveDescription.UNUSUAL); - registerHive(hiveRegistry, HiveDescription.RESONANT); - registerHive(hiveRegistry, HiveDescription.DEEP); - registerHive(hiveRegistry, HiveDescription.INFERNAL); - registerHive(hiveRegistry, HiveDescription.OBLIVION); + // ----- Forestry Blocks ------------------------------------ + public static Block hiveBlock; + public static Block alvearyBlock; + public static Block apicultureBlock; + // ----- Forestry Items ------------------------------------- + public static Item beeComb; + public static Item honeydew; + public static Item honeyDrop; + public static Item propolis; + public static Item pollen; + public static Item craftingResource; + public static ItemStack itemHoneycomb; - if (Config.doSpecialHiveGen) { - registerHive(hiveRegistry, HiveDescription.INFERNAL_OVERWORLD); - registerHive(hiveRegistry, HiveDescription.OBLIVION_OVERWORLD); - } - } + public void preInit() { + IHiveRegistry hiveRegistry = HiveManager.hiveRegistry; + registerHive(hiveRegistry, HiveDescription.CURIOUS); + registerHive(hiveRegistry, HiveDescription.UNUSUAL); + registerHive(hiveRegistry, HiveDescription.RESONANT); + registerHive(hiveRegistry, HiveDescription.DEEP); + registerHive(hiveRegistry, HiveDescription.INFERNAL); + registerHive(hiveRegistry, HiveDescription.OBLIVION); - public void init() { - getBlocks(); - getItems(); - } + if (Config.doSpecialHiveGen) { + registerHive(hiveRegistry, HiveDescription.INFERNAL_OVERWORLD); + registerHive(hiveRegistry, HiveDescription.OBLIVION_OVERWORLD); + } + } - public void postInit() { - } + public void init() { + getBlocks(); + getItems(); + } - private static void registerHive(IHiveRegistry hiveRegistry, HiveDescription hiveDescription) { - String hiveName = VersionInfo.ModName + ":" + hiveDescription.toString().toLowerCase(Locale.ENGLISH); - hiveRegistry.registerHive(hiveName, hiveDescription); - } + public void postInit() {} - private static void getBlocks() { - alvearyBlock = BlockInterface.getBlock("alveary"); - hiveBlock = BlockInterface.getBlock("beehives"); - apicultureBlock = BlockInterface.getBlock("apiculture"); - } + private static void registerHive(IHiveRegistry hiveRegistry, HiveDescription hiveDescription) { + String hiveName = VersionInfo.ModName + ":" + hiveDescription.toString().toLowerCase(Locale.ENGLISH); + hiveRegistry.registerHive(hiveName, hiveDescription); + } - private static void getItems() { - beeComb = ItemInterface.getItem("beeCombs"); - pollen = ItemInterface.getItem("pollen"); - ForestryHelper.craftingResource = ItemInterface.getItem("craftingMaterial"); - honeyDrop = ItemInterface.getItem("honeyDrop"); - propolis = ItemInterface.getItem("propolis"); - honeydew = ItemInterface.getItem("honeydew"); - // Caching a single item stack. Turns out it's used a LOT. - itemHoneycomb = new ItemStack(beeComb, 1, Comb.HONEY.ordinal()); - } + private static void getBlocks() { + alvearyBlock = BlockInterface.getBlock("alveary"); + hiveBlock = BlockInterface.getBlock("beehives"); + apicultureBlock = BlockInterface.getBlock("apiculture"); + } - public static IAllele[] getTemplateForestryForSpecies(String speciesName) { - return BeeManager.beeRoot.getTemplate("forestry.species" + speciesName); - } + private static void getItems() { + beeComb = ItemInterface.getItem("beeCombs"); + pollen = ItemInterface.getItem("pollen"); + ForestryHelper.craftingResource = ItemInterface.getItem("craftingMaterial"); + honeyDrop = ItemInterface.getItem("honeyDrop"); + propolis = ItemInterface.getItem("propolis"); + honeydew = ItemInterface.getItem("honeydew"); + // Caching a single item stack. Turns out it's used a LOT. + itemHoneycomb = new ItemStack(beeComb, 1, Comb.HONEY.ordinal()); + } - public static EnumTemperature getEnumTemperatureFromValue(float rawTemp) { - return EnumTemperature.getFromValue(rawTemp); - } + public static IAllele[] getTemplateForestryForSpecies(String speciesName) { + return BeeManager.beeRoot.getTemplate("forestry.species" + speciesName); + } - public static EnumHumidity getEnumHumidityFromValue(float rawHumidity) { - return EnumHumidity.getFromValue(rawHumidity); - } + public static EnumTemperature getEnumTemperatureFromValue(float rawTemp) { + return EnumTemperature.getFromValue(rawTemp); + } - public static ItemStack replaceSpecies(ItemStack stack, IAlleleBeeSpecies outputSpecies) { - ItemStack copyStack = stack.copy(); - NBTTagCompound compound = (NBTTagCompound) copyStack.getTagCompound(); - NBTTagCompound genomeCompound = compound.getCompoundTag("Genome"); - NBTTagList chromosomeCompoundList = (NBTTagList)genomeCompound.getTag("Chromosomes"); - NBTTagCompound speciesCompound = chromosomeCompoundList.getCompoundTagAt(0); - speciesCompound.setString("UID0", outputSpecies.getUID()); - speciesCompound.setString("UID1", outputSpecies.getUID()); - - return copyStack; - } + public static EnumHumidity getEnumHumidityFromValue(float rawHumidity) { + return EnumHumidity.getFromValue(rawHumidity); + } + + public static ItemStack replaceSpecies(ItemStack stack, IAlleleBeeSpecies outputSpecies) { + ItemStack copyStack = stack.copy(); + NBTTagCompound compound = (NBTTagCompound) copyStack.getTagCompound(); + NBTTagCompound genomeCompound = compound.getCompoundTag("Genome"); + NBTTagList chromosomeCompoundList = (NBTTagList) genomeCompound.getTag("Chromosomes"); + NBTTagCompound speciesCompound = chromosomeCompoundList.getCompoundTagAt(0); + speciesCompound.setString("UID0", outputSpecies.getUID()); + speciesCompound.setString("UID1", outputSpecies.getUID()); + + return copyStack; + } } diff --git a/src/main/java/magicbees/main/utils/compat/IModHelper.java b/src/main/java/magicbees/main/utils/compat/IModHelper.java index 93f0213..f594feb 100644 --- a/src/main/java/magicbees/main/utils/compat/IModHelper.java +++ b/src/main/java/magicbees/main/utils/compat/IModHelper.java @@ -1,10 +1,10 @@ package magicbees.main.utils.compat; public interface IModHelper { - - public void preInit(); - - public void init(); - - public void postInit(); + + public void preInit(); + + public void init(); + + public void postInit(); } diff --git a/src/main/java/magicbees/main/utils/compat/ModHelperManager.java b/src/main/java/magicbees/main/utils/compat/ModHelperManager.java index 6b0c6bd..c40d60b 100644 --- a/src/main/java/magicbees/main/utils/compat/ModHelperManager.java +++ b/src/main/java/magicbees/main/utils/compat/ModHelperManager.java @@ -4,40 +4,40 @@ import java.util.ArrayList; import java.util.List; public class ModHelperManager { - - private static List helpers; - - public static void preInit() { - setupHelpers(); - - for (IModHelper helper : helpers) { - helper.preInit(); - } - } - public static void init() { - for (IModHelper helper : helpers) { - helper.init(); - } - } + private static List helpers; - public static void postInit() { - for (IModHelper helper : helpers) { - helper.postInit(); - } - } - - private static void setupHelpers() { - helpers = new ArrayList(); - - helpers.add(new ForestryHelper()); - helpers.add(new ExtraBeesHelper()); - helpers.add(new ThaumcraftHelper()); - helpers.add(new EquivalentExchangeHelper()); - helpers.add(new ArsMagicaHelper()); - helpers.add(new ThermalModsHelper()); - helpers.add(new RedstoneArsenalHelper()); - helpers.add(new BotaniaHelper()); - helpers.add(new AppliedEnergisticsHelper()); - } + public static void preInit() { + setupHelpers(); + + for (IModHelper helper : helpers) { + helper.preInit(); + } + } + + public static void init() { + for (IModHelper helper : helpers) { + helper.init(); + } + } + + public static void postInit() { + for (IModHelper helper : helpers) { + helper.postInit(); + } + } + + private static void setupHelpers() { + helpers = new ArrayList(); + + helpers.add(new ForestryHelper()); + helpers.add(new ExtraBeesHelper()); + helpers.add(new ThaumcraftHelper()); + helpers.add(new EquivalentExchangeHelper()); + helpers.add(new ArsMagicaHelper()); + helpers.add(new ThermalModsHelper()); + helpers.add(new RedstoneArsenalHelper()); + helpers.add(new BotaniaHelper()); + helpers.add(new AppliedEnergisticsHelper()); + } } diff --git a/src/main/java/magicbees/main/utils/compat/RedstoneArsenalHelper.java b/src/main/java/magicbees/main/utils/compat/RedstoneArsenalHelper.java index 8f4ba60..15ec83c 100644 --- a/src/main/java/magicbees/main/utils/compat/RedstoneArsenalHelper.java +++ b/src/main/java/magicbees/main/utils/compat/RedstoneArsenalHelper.java @@ -1,51 +1,53 @@ package magicbees.main.utils.compat; +import cpw.mods.fml.common.Loader; import magicbees.main.Config; import magicbees.main.utils.ItemInterface; import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.Loader; public class RedstoneArsenalHelper implements IModHelper { - public enum MiscResource { - FLUXED_ELECTRUMBLOCK, ; - } + public enum MiscResource { + FLUXED_ELECTRUMBLOCK, + ; + } - public enum NuggetType { - ELECTRUMFLUX, ; - } - - public static ItemStack fluxBlock; - public static ItemStack fluxNugget; + public enum NuggetType { + ELECTRUMFLUX, + ; + } - public static final String Name = "RedstoneArsenal"; - private static boolean isRedstoneArsenalPresent = false; + public static ItemStack fluxBlock; + public static ItemStack fluxNugget; - public static boolean isActive() { - return isRedstoneArsenalPresent; - } + public static final String Name = "RedstoneArsenal"; + private static boolean isRedstoneArsenalPresent = false; - public void preInit() { - if (Loader.isModLoaded(Name) && Config.redstoneArsenalActive) { - isRedstoneArsenalPresent = true; - } - } + public static boolean isActive() { + return isRedstoneArsenalPresent; + } - public void init() { - if (isActive()) { - getBlocks(); - getItems(); - } - } + public void preInit() { + if (Loader.isModLoaded(Name) && Config.redstoneArsenalActive) { + isRedstoneArsenalPresent = true; + } + } - public void postInit() { - //if (isActive()) { } - } + public void init() { + if (isActive()) { + getBlocks(); + getItems(); + } + } - private static void getBlocks() { - fluxBlock = ItemInterface.getItemStack(Name, "blockElectrumFlux"); - } + public void postInit() { + // if (isActive()) { } + } - private static void getItems() { - fluxNugget = ItemInterface.getItemStack(Name, "nuggetElectrumFlux"); - } + private static void getBlocks() { + fluxBlock = ItemInterface.getItemStack(Name, "blockElectrumFlux"); + } + + private static void getItems() { + fluxNugget = ItemInterface.getItemStack(Name, "nuggetElectrumFlux"); + } } diff --git a/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java b/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java index 742e5c3..a80bf2a 100644 --- a/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java +++ b/src/main/java/magicbees/main/utils/compat/ThaumcraftHelper.java @@ -1,9 +1,8 @@ package magicbees.main.utils.compat; -import java.util.ArrayList; - import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; +import java.util.ArrayList; import magicbees.api.MagicBeesAPI; import magicbees.item.types.PollenType; import magicbees.item.types.PropolisType; @@ -34,720 +33,934 @@ import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; public class ThaumcraftHelper implements IModHelper { - - public enum MiscResource { - ALUMENTUM, - NITOR, - THAUMIUM, - QUICKSILVER, - MAGIC_TALLOW, - BRAIN_DEPRECATED, - AMBER, - ENCHANTED_FABRIC, - VIS_FILTER, - KNOWLEDGE_FRAGMENT, - MIRRORED_GLASS, - TAINTED_GOO, - TAINTED_TENDRIL, - JAR_LABEL, - SALIS, - CHARM, - VOID_INGOT, - VOID_SEED, - COIN, - ; - } - - public enum NuggetType { - IRON, - COPPER, - TIN, - SILVER, - LEAD, - QUICKSILVER, - THAUMIUM, - VOID_METAL, - _8, _9, _10, _11, _12, _13, _14, _15, - NATIVE_IRON, - NATIVE_COPPER, - NATIVE_TIN, - NATIVE_SILVER, - NATIVE_LEAD, - NATIVE_CINNABAR, - _22, _23, _24, _25, _26, _27, _28, _29, _30, - NATIVE_GOLD, - ; - } - - public enum ShardType { - AIR, - FIRE, - WATER, - EARTH, - ORDER, - CHAOS, - BALANCED, - ; - } - - public enum MetalDeviceType { - CRUCIBLE, - ALEMBIC, - VIS_CHARGE_RELAY, - ADVANCED_ALCHEMICAL_CONSTRUCT, - _4, - ITEM_GRATE, - _6, - ARCANE_LAMP, - LAMP_OF_GROWTH, - ALCHEMICAL_CONSTRUCT, - THAUMATORIUM, - _11, - MNEMONIC_MATRIX, - LAMP_OF_FERTILITY, - VIS_RELAY, - ; - } - - public enum WoodenDeviceType { - BELLOWS, - EAR, - PRESSURE_PLATE, - PRESSURE_PLATE_B, - BORE_BASE, - BORE, - PLANKS_GREATWOOD, - PLANKS_SILVERWOOD, - BANNER, - ; - } - - public enum AiryBlockType { - NODE, - NITOR, - _2, - _3, - WARDING_STONE_FENCE, - ENERGIZED_NODE, - ; - } - - public enum Entity { - BRAINY_ZOMBIE("entBrainyZombie", "EntityBrainyZombie"), - GIANT_BRAINY_ZOMBIE("entGiantBrainyZombie", "EntityGiantBrainyZombie"), - WISP("entWisp", "EntityWisp"), - FIREBAT("entFirebat", "EntityFireBat"), - ; - - private static String packageName = "thaumcraft.common.entities.monster."; - - public String entityID; - private String className; - - private Entity(String id, String clazz) { - this.entityID = id; - this.className = clazz; - } - - public String getClassName() { - return packageName + this.className; - } - } - - public enum BlockPlant { - GREATWOOD_SAPLING, - SILVERWOOD_SAPLING, - SHIMMERLEAF, - CINDERPEARL, - PURIFYING_PLANT, - VISHROOM, - ; - } - - public enum TreeType { - GREATWOOD, - SILVERWOOD, - ; - } - - public static Block plant; - public static Block candle; - public static Block crystal; - public static Block marker; - public static Block jar; - public static Block log; - public static Block leaf; - public static Block warded; - public static Block wooden; - public static Block metal; - public static Block airy; - public static Block fluxGas; - public static Block fluxGoo; - - public static Item filledJar; - public static Item miscResource; - public static Item shard; - public static Item golem; - public static Item nuggetMetal; - public static Item nuggetChicken; - public static Item nuggetBeef; - public static Item nuggetPork; - public static Item zombieBrain; - - public static Class nodeClass; - - public static final String Name = "Thaumcraft"; - private static boolean isThaumcraftPresent = false; - - public static boolean isActive() { - return isThaumcraftPresent; - } - - public void preInit() { - if (Loader.isModLoaded(Name) && Config.thaumcraftActive) { - isThaumcraftPresent = true; - aspectTime = new Aspect("tempus", 0xB68CFF, new Aspect[] { - Aspect.VOID, Aspect.ORDER }, new ResourceLocation( - CommonProxy.DOMAIN, CommonProxy.TEXTURE - + "aspects/tempus.png"), 1); - MagicBeesAPI.thaumcraftAspectTempus = aspectTime; - } else { - // Switch off TC-dependant items. - ResourceType.LORE_FRAGMENT.setHidden(); - ResourceType.TC_DUST_AIR.setHidden(); - ResourceType.TC_DUST_CHAOS.setHidden(); - ResourceType.TC_DUST_EARTH.setHidden(); - ResourceType.TC_DUST_FIRE.setHidden(); - ResourceType.TC_DUST_ORDER.setHidden(); - ResourceType.TC_DUST_WATER.setHidden(); - } - } - - public void init() { - if (isActive()) { - getBlocks(); - getItems(); - } - } - - public void postInit() { - if (isActive()) { - setupItemAspects(); - setupCrafting(); - setupResearch(); - } - } - - private static Object aspectTime; - - private static Object frameMagic; - private static Object thaumScoop; - private static Object thaumGrafter; - private static Object singularityA; - private static Object singularityB; - private static Object essenceLife; - private static Object essenceDeath; - private static Object essenceArmor; - private static Object essenceUnstableA; - private static Object essenceUnstableB; - private static Object essenceTime; - private static Object essenceOblivion; - private static Object visAuraProvider; - - private static Object voidScoop; - private static Object voidGrafter; - - private static void getBlocks() { - plant = BlockInterface.getBlock(Name, "blockCustomPlant"); - candle = BlockInterface.getBlock(Name, "blockCandle"); - crystal = BlockInterface.getBlock(Name, "blockCrystal"); - marker = BlockInterface.getBlock(Name, "blockMarker"); - jar = BlockInterface.getBlock(Name, "blockJar"); - log = BlockInterface.getBlock(Name, "blockMagicalLog"); - leaf = BlockInterface.getBlock(Name, "blockMagicalLeaves"); - warded = BlockInterface.getBlock(Name, "blockWarded"); - wooden = BlockInterface.getBlock(Name, "blockWoodenDevice"); - metal = BlockInterface.getBlock(Name, "blockMetalDevice"); - airy = BlockInterface.getBlock(Name, "blockAiry"); - } - - private static void getItems() { - filledJar = ItemInterface.getItem(Name, "BlockJarFilledItem"); - miscResource = ItemInterface.getItem(Name, "ItemResource"); - // Config.tcEssentiaBottle = ItemInterface.getItem(Name, - // "BlockJarFilledItem"); - shard = ItemInterface.getItem(Name, "ItemShard"); - golem = ItemInterface.getItem(Name, "ItemGolemPlacer"); - // Config.tcWispEssence = ItemApi.getItem("itemWispEssence", - // 0).getItem(); - nuggetMetal = ItemInterface.getItem(Name, "ItemNugget"); - shard = ItemInterface.getItem(Name, "ItemShard"); - nuggetChicken = ItemInterface.getItem(Name, - "ItemNuggetChicken"); - nuggetBeef = ItemInterface.getItem(Name, "ItemNuggetBeef"); - nuggetPork = ItemInterface.getItem(Name, "ItemNuggetPork"); - zombieBrain = ItemInterface.getItem(Name, "ItemZombieBrain"); - } - - private static void setupCrafting() { - ItemStack input, output; - - input = Config.miscResources.getStackForType(ResourceType.TC_DUST_AIR); - output = new ItemStack(shard, 1, ShardType.AIR.ordinal()); - GameRegistry.addShapelessRecipe(output, input, input, input, input); - - input = Config.miscResources - .getStackForType(ResourceType.TC_DUST_WATER); - output = new ItemStack(shard, 1, ShardType.WATER.ordinal()); - GameRegistry.addShapelessRecipe(output, input, input, input, input); - - input = Config.miscResources.getStackForType(ResourceType.TC_DUST_FIRE); - output = new ItemStack(shard, 1, ShardType.FIRE.ordinal()); - GameRegistry.addShapelessRecipe(output, input, input, input, input); - - input = Config.miscResources - .getStackForType(ResourceType.TC_DUST_EARTH); - output = new ItemStack(shard, 1, ShardType.EARTH.ordinal()); - GameRegistry.addShapelessRecipe(output, input, input, input, input); - - input = Config.miscResources - .getStackForType(ResourceType.TC_DUST_ORDER); - output = new ItemStack(shard, 1, ShardType.ORDER.ordinal()); - GameRegistry.addShapelessRecipe(output, input, input, input, input); - - input = Config.miscResources - .getStackForType(ResourceType.TC_DUST_CHAOS); - output = new ItemStack(shard, 1, ShardType.CHAOS.ordinal()); - GameRegistry.addShapelessRecipe(output, input, input, input, input); - - thaumScoop = ThaumcraftApi.addArcaneCraftingRecipe("MB_Scoop", new ItemStack(Config.thaumiumScoop), - new AspectList().add(Aspect.ORDER, 2), new Object[] { - "sWs", "sTs", " T ", - 's', Items.stick, - 'W', Blocks.wool, - 'T', new ItemStack(miscResource, 1, MiscResource.THAUMIUM.ordinal()) }); - - thaumGrafter = ThaumcraftApi.addArcaneCraftingRecipe("MB_Grafter", - new ItemStack(Config.thaumiumGrafter), - new AspectList().add(Aspect.ORDER, 5), new Object[] { - " T", " s ", "s ", - 's', Items.stick, - 'T', new ItemStack(miscResource, 1, MiscResource.THAUMIUM.ordinal()) }); - - frameMagic = ThaumcraftApi.addArcaneCraftingRecipe("MB_FrameMagic", new ItemStack(Config.hiveFrameMagic), - new AspectList().add(Aspect.ORDER, 5).add(Aspect.AIR, 2).add(Aspect.EARTH, 2), new Object[] { - "sss", "sCs", "sss", - 's', Items.stick, - 'C', new ItemStack(miscResource, 1, MiscResource.ENCHANTED_FABRIC.ordinal()) }); - - visAuraProvider = ThaumcraftApi.addArcaneCraftingRecipe("MB_VisAuraProvider", new ItemStack(Config.visAuraProvider), - new AspectList().add(Aspect.ORDER, 60).add(Aspect.AIR, 60).add(Aspect.ENTROPY, 60).add(Aspect.WATER, 60), - new Object[] { - "ngn", "gvg", "npn", - 'n', Items.gold_nugget, - 'g', new ItemStack(wooden, 1, WoodenDeviceType.PLANKS_GREATWOOD.ordinal()), - 'v', new ItemStack(metal, 1, MetalDeviceType.VIS_RELAY.ordinal()), - 'p', Config.pollen.getStackForType(PollenType.UNUSUAL)}); - - essenceLife = ThaumcraftApi.addCrucibleRecipe("MB_EssenceLife", Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE), - new ItemStack(Blocks.red_flower), - new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.PLANT, 4)); - - essenceDeath = ThaumcraftApi.addCrucibleRecipe("MB_EssenceDeath", - Config.miscResources - .getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), - new ItemStack(Items.rotten_flesh), - new AspectList().add(Aspect.DEATH, 4).add(Aspect.ENTROPY, 4)); - - essenceArmor = ThaumcraftApi.addCrucibleRecipe("MB_EssenceArmor", Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY), - new ItemStack(Items.leather), - new AspectList().add(Aspect.ARMOR, 4).add(Aspect.MAGIC, 2)); - - output = Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE); - essenceUnstableA = ThaumcraftApi.addCrucibleRecipe("MB_EssenceUnstable", output, - Config.propolis.getStackForType(PropolisType.UNSTABLE), - new AspectList().add(Aspect.ENTROPY, 2).add(Aspect.EXCHANGE, 1)); - - essenceUnstableB = ThaumcraftApi.addCrucibleRecipe("MB_EssenceUnstable",output, - new ItemStack(Blocks.netherrack), - new AspectList().add(Aspect.ENTROPY, 8).add(Aspect.EXCHANGE, 5)); - - essenceTime = ThaumcraftApi.addCrucibleRecipe("MB_EssenceTime", Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), - new ItemStack(Items.clock), - new AspectList().add(Aspect.ORDER, 10).add(Aspect.VOID, 10).add(Aspect.TRAP, 4)); - - input = new ItemStack(Items.ender_pearl); - singularityA = ThaumcraftApi.addInfusionCraftingRecipe("MB_DimensionalSingularity", - Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY,3), - 5, - new AspectList().add(Aspect.ELDRITCH, 10).add(Aspect.EXCHANGE, 20), - new ItemStack(Blocks.gold_block), new ItemStack[] { input, - input }); - - ItemStack in2 = new ItemStack(Items.diamond); - singularityB = ThaumcraftApi.addInfusionCraftingRecipe("MB_DimensionalSingularity", - Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY, 3), - 6, - new AspectList().add(Aspect.ELDRITCH, 10).add(Aspect.EXCHANGE, 20).add(Aspect.VOID, 15), - Config.propolis.getStackForType(PropolisType.UNSTABLE), - new ItemStack[] { input, input, in2 }); - - essenceOblivion = ThaumcraftApi.addShapelessArcaneCraftingRecipe("MB_EssenceOblivion", - Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION), - new AspectList().add(Aspect.ENTROPY, 25).add(Aspect.AIR, 40).add(Aspect.ORDER, 15), - new Object[] { - Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY), - Blocks.dragon_egg, }); - - voidScoop = ThaumcraftApi.addArcaneCraftingRecipe("MB_ScoopVoid", new ItemStack(Config.voidScoop), - new AspectList().add(Aspect.ORDER, 2), new Object[] { - "sWs", "sTs", " T ", - 's', Items.stick, - 'W', Blocks.wool, - 'T', new ItemStack(miscResource, 1, MiscResource.VOID_INGOT.ordinal()) }); - - voidGrafter = ThaumcraftApi.addArcaneCraftingRecipe("MB_GrafterVoid", - new ItemStack(Config.voidGrafter), - new AspectList().add(Aspect.ORDER, 5), new Object[] { - " T", " s ", "s ", - 's', Items.stick, - 'T', new ItemStack(miscResource, 1, MiscResource.VOID_INGOT.ordinal()) }); - } - - private static void setupResearch() { - - ArrayList list; - ItemStack input; - IRecipe recipe; - String category = "MAGICBEES"; - ResearchCategories.registerCategory(category, new ResourceLocation( - CommonProxy.DOMAIN, CommonProxy.ITEM_TEXTURE + "beeInfusion.png"), - new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png")); - - new ResearchItem("MB_Root", category, - new AspectList(), - 0, 0, 0, - Config.miscResources.getStackForType(ResourceType.RESEARCH_BEEINFUSION)) - .setRound() - .setStub() - .setAutoUnlock() - .setPages(getResearchPage("MB_Root.1"), getResearchPage("MB_Root.2")).registerResearchItem(); - - list = new ArrayList(4); - list.add(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)); - list.add(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)); - list.add(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)); - list.add(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)); - recipe = new ShapelessRecipes(new ItemStack(miscResource, 1, - MiscResource.KNOWLEDGE_FRAGMENT.ordinal()), list); - - new ResearchItem("MB_LoreFragment", category, - new AspectList(), - 0, -3, 1, - Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)) - .setPages(getResearchPage("MB_LoreFragment.1"), new ResearchPage(recipe)).setParents("MB_Root") - .setStub().setAutoUnlock().setRound().registerResearchItem(); - - new ResearchItem("MB_Scoop", category, - new AspectList().add(Aspect.TOOL, 1).add(Aspect.MAGIC, 1).add(Aspect.AIR, 1), - -2, -3, 1, - new ItemStack(Config.thaumiumScoop)) - .setPages(getResearchPage("MB_Scoop.1"), new ResearchPage((IArcaneRecipe) thaumScoop)) - .setParentsHidden("THAUMIUM").registerResearchItem(); - - new ResearchItem("MB_Grafter", category, - new AspectList().add(Aspect.TOOL, 1).add(Aspect.TREE, 1).add(Aspect.GREED, 1), - -2, -1, 2, - new ItemStack(Config.thaumiumGrafter)) - .setPages(getResearchPage("MB_Grafter.1"), new ResearchPage((IArcaneRecipe) thaumGrafter)) - .setParents("MB_Scoop").registerResearchItem(); - - //Void tool insert - new ResearchItem("MB_ScoopVoid", category, - new AspectList().add(Aspect.TOOL, 1).add(Aspect.ELDRITCH, 1).add(Aspect.AIR, 1), - -4, -4, 1, - new ItemStack(Config.voidScoop)) - .setPages(getResearchPage("MB_ScoopVoid.1"), new ResearchPage((IArcaneRecipe) voidScoop)) - .setParents("MB_Scoop").setParentsHidden("VOIDMETAL").setSecondary().setConcealed().registerResearchItem(); - - new ResearchItem("MB_GrafterVoid", category, - new AspectList().add(Aspect.TOOL, 1).add(Aspect.TREE, 1).add(Aspect.ELDRITCH, 1), - -4, -2, 2, - new ItemStack(Config.voidGrafter)) - .setPages(getResearchPage("MB_GrafterVoid.1"), new ResearchPage((IArcaneRecipe) voidGrafter)) - .setParents("MB_Grafter").setParentsHidden("VOIDMETAL").setSecondary().setConcealed().registerResearchItem(); - // - - new ResearchItem("MB_FrameMagic", category, - new AspectList().add(Aspect.TOOL, 1).add(Aspect.ARMOR, 1), - -2, 1, 1, - new ItemStack(Config.hiveFrameMagic)) - .setPages(getResearchPage("MB_FrameMagic"), new ResearchPage((IArcaneRecipe) frameMagic)) - .registerResearchItem(); - - input = new ItemStack(Config.hiveFrameMagic); - list = new ArrayList(2); - list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE)); - list.add(input); - recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameGentle), list); - - new ResearchItem("MB_EssenceLife", category, - new AspectList().add(Aspect.LIFE, 1).add(Aspect.MAGIC, 1), - 2, -1, 1, - Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE)) - .setPages(getResearchPage("MB_EssenceLife.1"), - new ResearchPage((CrucibleRecipe) essenceLife), - new ResearchPage(recipe)).setParentsHidden("CRUCIBLE") - .registerResearchItem(); - - list = new ArrayList(2); - list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY)); - list.add(input); - recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameResilient), list); - - new ResearchItem("MB_EssenceArmor", category, - new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MAGIC, 1), - 5, 0, 2, - Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY)) - .setPages(getResearchPage("MB_EssenceArmor.1"), - new ResearchPage((CrucibleRecipe) essenceArmor), - new ResearchPage(recipe)).setParents("MB_EssenceLife") - .registerResearchItem(); - - list = new ArrayList(2); - list.add(Config.miscResources .getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE)); - list.add(input); - recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameMetabolic), list); - - new ResearchItem( "MB_EssenceUnstable", category, - new AspectList().add(Aspect.ENTROPY, 1).add(Aspect.ORDER, 1), - 3, 1, 2, - Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE)) - .setPages(getResearchPage("MB_EssenceUnstable.1"), - new ResearchPage((CrucibleRecipe) essenceUnstableA), - new ResearchPage((CrucibleRecipe) essenceUnstableB), - new ResearchPage(recipe)) - .setParents("MB_EssenceLife") - .setConcealed() - .registerResearchItem(); - - list = new ArrayList(2); - list.add(Config.miscResources .getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE)); - list.add(input); - recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameNecrotic), list); - - new ResearchItem("MB_EssenceDeath", category, - new AspectList().add(Aspect.DEATH, 1).add(Aspect.MAGIC, 1), - 2, 3, 1, - Config.miscResources .getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE)) - .setPages(getResearchPage("MB_EssenceDeath.1"), - new ResearchPage((CrucibleRecipe) essenceDeath), - new ResearchPage(recipe)) - .setParents("MB_EssenceUnstable") - .setConcealed() - .registerResearchItem(); - - list = new ArrayList(2); - list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME)); - list.add(input); - recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameTemporal), list); - - new ResearchItem("MB_EssenceTime", category, - new AspectList().add((Aspect) aspectTime, 1).add(Aspect.MAGIC, 1), - 0, 2, 2, - Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME)) - .setPages(getResearchPage("MB_EssenceTime.1"), - new ResearchPage((CrucibleRecipe) essenceTime), - new ResearchPage(recipe)) - .setParents("MB_EssenceUnstable") - .setConcealed() - .registerResearchItem(); - - new ResearchItem("MB_DimensionalSingularity", category, - new AspectList().add(Aspect.ELDRITCH, 1).add((Aspect) aspectTime, 1).add(Aspect.VOID, 1), - -1, 4, 3, - Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY)) - .setPages(getResearchPage("MB_DimensionalSingularity.1"), - new ResearchPage((InfusionRecipe) singularityA), - new ResearchPage((InfusionRecipe) singularityB)) - .setParents("MB_FrameMagic", "MB_EssenceTime", "MB_EssenceDeath") - .setConcealed() - .setSpecial() - .registerResearchItem(); - - list = new ArrayList(2); - list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION)); - list.add(ItemInterface.getItemStack("frameProven")); - recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameOblivion), list); - - new ResearchItem("MB_EssenceOblivion", category, - new AspectList().add(Aspect.VOID, 1).add(Aspect.HUNGER, 1).add((Aspect) aspectTime, 1), - -3, 3, 3, - Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION)) - .setPages(getResearchPage("MB_EssenceOblivion.1"), - new ResearchPage((IArcaneRecipe) essenceOblivion), - new ResearchPage(recipe)) - .setParents("MB_DimensionalSingularity").setConcealed() - .registerResearchItem(); - - new ResearchItem("MB_VisAuraProvider", category, - new AspectList().add(Aspect.MAGIC, 1).add(Aspect.ENERGY, 1).add(Aspect.AURA, 1), - -5, 5, 3, - new ItemStack(Config.visAuraProvider)) - .setPages(getResearchPage("MB_VisAuraProvider.1"), - new ResearchPage((IArcaneRecipe) visAuraProvider)) - .setParentsHidden("VISPOWER") - .registerResearchItem(); - } - - private static ResearchPage getResearchPage(String ident) { - return new ResearchPage(LocalizationManager.getLocalizedString("tc.research_page." + ident)); - } - - private static void setupItemAspects() { - ItemStack item; - AspectList list; - - ThaumcraftApi.registerObjectTag(new ItemStack(Items.clock), new AspectList(new ItemStack(Items.clock)).add((Aspect) aspectTime, 4)); - ThaumcraftApi.registerObjectTag(new ItemStack(Items.repeater), new AspectList(new ItemStack(Items.repeater)).add((Aspect) aspectTime, 2)); - - list = new AspectList(new ItemStack(Blocks.log)); - for (int i = 1; i <= 8; i++) { - item = ItemInterface.getItemStack("log" + i); - if (item != null) { - ThaumcraftApi.registerObjectTag(item, list); - } - } - - list = new AspectList(new ItemStack(Blocks.planks)); - for (int i = 1; i <= 2; i++) { - item = ItemInterface.getItemStack("planks" + i); - if (item != null) { - ThaumcraftApi.registerObjectTag(item, list); - } - } - - list = new AspectList().add(Aspect.ORDER, 5).add(Aspect.ARMOR, 2).add(Aspect.BEAST, 1); - item = new ItemStack(ForestryHelper.hiveBlock,1,32767); - ThaumcraftApi.registerObjectTag(item, list); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.hive,1,32767), list); - if (ExtraBeesHelper.isActive() ) - ThaumcraftApi.registerObjectTag(new ItemStack(ExtraBeesHelper.hiveBlock,1,32767), list); - - list = new AspectList().add(Aspect.LIGHT, 1); - item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "candle")); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list); - - list = new AspectList().add(Aspect.DARKNESS, 1); - item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "stump")); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list); - - list = new AspectList(new ItemStack(Blocks.glass)).add(Aspect.SENSES, 1); - item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "glass")); - ThaumcraftApi.registerObjectTag(item, list); - - list = new AspectList().add(Aspect.EARTH, 2).add(Aspect.WATER, 2); - item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "soil")); - ThaumcraftApi.registerObjectTag(item, new int[] { 1 }, list); - - list = new AspectList(new ItemStack(Blocks.leaves)); - item = ItemInterface.getItemStack(ForestryHelper.Name, "candle"); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list); - - list = new AspectList(new ItemStack(Blocks.sapling)); - item = ItemInterface.getItemStack(ForestryHelper.Name, "candle"); - ThaumcraftApi.registerObjectTag(item, list); - - list = new AspectList()/* .add(Aspect.SEED, 1) */.add(Aspect.PLANT, 1); - item = ItemInterface.getItemStack(ForestryHelper.Name, "candle"); - ThaumcraftApi.registerObjectTag(item, list); - - list = new AspectList().add(Aspect.CRYSTAL, 1).add(Aspect.EARTH, 2); - item = ItemInterface.getItemStack(ForestryHelper.Name, "candle"); - ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1,ForestryHelper.BlockResource.APATITE.ordinal()), list.copy()); - item = ItemInterface.getItemStack(ForestryHelper.Name, "apatite"); - ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, item.getItemDamage()), list.copy().add(Aspect.CRYSTAL, 2)); - - list = new AspectList().add(Aspect.MOTION, 2).add(Aspect.FLIGHT, 1); - item = ItemInterface.getItemStack("beeDroneGE"); - ThaumcraftApi.registerObjectTag(item, list); - list = list.copy().add(Aspect.GREED, 2).add(Aspect.EXCHANGE, 1); - item = ItemInterface.getItemStack("beePrincessGE"); - ThaumcraftApi.registerObjectTag(item, list); - item = ItemInterface.getItemStack("beeQueenGE"); - ThaumcraftApi.registerObjectTag(item, list); - list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.EXCHANGE, 5); - item = ItemInterface.getItemStack("beeLarvaeGE"); - ThaumcraftApi.registerObjectTag(item, list); - - item = ItemInterface.getItemStack("scoop"); - list = new AspectList(new ItemStack(item.getItem(), 1, 0)).add(Aspect.TOOL, 2); - ThaumcraftApi.registerComplexObjectTag(item, list); - - item = ItemInterface.getItemStack("grafter"); - list = new AspectList(new ItemStack(item.getItem(), 1, item.getItemDamage())).add(Aspect.TOOL, 2); - ThaumcraftApi.registerComplexObjectTag(item, list); - - item = ItemInterface.getItemStack("grafterProven"); - list = list.copy().add(Aspect.TOOL, 2).add(Aspect.EXCHANGE, 3); - ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, item.getItemDamage()), list); - - list = new AspectList().add(Aspect.TRAP, 2); - ThaumcraftApi.registerObjectTag("beeComb", list); - - list = new AspectList().add(Aspect.SLIME, 1); - item = ItemInterface.getItemStack("propolis"); - ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.NORMAL.ordinal()), list); - ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.SILKY.ordinal()), list.copy().add(Aspect.SLIME, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.PULSATING.ordinal()), list.copy().add(Aspect.ELDRITCH, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.propolis, 1, PropolisType.UNSTABLE.ordinal()), list.copy().add(Aspect.ENTROPY, 1).add(Aspect.EXCHANGE, 1)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.propolis, 1, PropolisType.AIR.ordinal()), list.copy().add(Aspect.AIR, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.propolis, 1, PropolisType.WATER.ordinal()), list.copy().add(Aspect.WATER, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.propolis, 1, PropolisType.FIRE.ordinal()), list.copy().add(Aspect.FIRE, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.propolis, 1, PropolisType.EARTH.ordinal()), list.copy().add(Aspect.EARTH, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.propolis, 1, PropolisType.ORDER.ordinal()), list.copy().add(Aspect.ORDER, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.propolis, 1, PropolisType.CHAOS.ordinal()), list.copy().add(Aspect.ENTROPY, 2)); - - list = new AspectList().add(Aspect.PLANT, 2); - item = ItemInterface.getItemStack("pollen"); - ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Pollen.NORMAL.ordinal()), list); - ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), list.copy()); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.pollen, 1, PollenType.UNUSUAL.ordinal()), list.copy().add(Aspect.MAGIC, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.pollen, 1, PollenType.PHASED.ordinal()), list.copy().add((Aspect) aspectTime, 2)); - - list = new AspectList().add(Aspect.ORDER, 1); - item = ItemInterface.getItemStack("beeswax"); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list.copy().add(Aspect.ORDER, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.wax, 1, WaxType.MAGIC.ordinal()), list.copy().add(Aspect.MAGIC, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.wax, 1, WaxType.SOUL.ordinal()), list.copy().add(Aspect.SOUL, 2)); - ThaumcraftApi.registerObjectTag(new ItemStack(Config.wax, 1, WaxType.AMNESIC.ordinal()), list.copy().add(Aspect.MIND, 2)); - - list = new AspectList().add(Aspect.EXCHANGE, 2).add(Aspect.LIFE, 2); - item = ItemInterface.getItemStack("honeyDrop"); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list); - - list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.ENERGY, 2); - item = ItemInterface.getItemStack("honeydew"); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list); - - list = new AspectList().add(Aspect.GREED, 1).add(Aspect.LIFE, 4); - item = ItemInterface.getItemStack("royalJelly"); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list); - - list = new AspectList().add(Aspect.FIRE, 1).add(Aspect.TRAP, 2); - item = ItemInterface.getItemStack("phosphor"); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, list); - - item = Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, new AspectList().add(Aspect.LIFE, 6)); - - item = Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, new AspectList().add(Aspect.DEATH, 6)); - - item = Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, new AspectList().add(Aspect.ARMOR, 6)); - - item = Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME); - ThaumcraftApi.registerObjectTag(item, new int[] { item.getItemDamage() }, new AspectList().add(Aspect.VOID, 6).add((Aspect) aspectTime, 8)); - } + + public enum MiscResource { + ALUMENTUM, + NITOR, + THAUMIUM, + QUICKSILVER, + MAGIC_TALLOW, + BRAIN_DEPRECATED, + AMBER, + ENCHANTED_FABRIC, + VIS_FILTER, + KNOWLEDGE_FRAGMENT, + MIRRORED_GLASS, + TAINTED_GOO, + TAINTED_TENDRIL, + JAR_LABEL, + SALIS, + CHARM, + VOID_INGOT, + VOID_SEED, + COIN, + ; + } + + public enum NuggetType { + IRON, + COPPER, + TIN, + SILVER, + LEAD, + QUICKSILVER, + THAUMIUM, + VOID_METAL, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + NATIVE_IRON, + NATIVE_COPPER, + NATIVE_TIN, + NATIVE_SILVER, + NATIVE_LEAD, + NATIVE_CINNABAR, + _22, + _23, + _24, + _25, + _26, + _27, + _28, + _29, + _30, + NATIVE_GOLD, + ; + } + + public enum ShardType { + AIR, + FIRE, + WATER, + EARTH, + ORDER, + CHAOS, + BALANCED, + ; + } + + public enum MetalDeviceType { + CRUCIBLE, + ALEMBIC, + VIS_CHARGE_RELAY, + ADVANCED_ALCHEMICAL_CONSTRUCT, + _4, + ITEM_GRATE, + _6, + ARCANE_LAMP, + LAMP_OF_GROWTH, + ALCHEMICAL_CONSTRUCT, + THAUMATORIUM, + _11, + MNEMONIC_MATRIX, + LAMP_OF_FERTILITY, + VIS_RELAY, + ; + } + + public enum WoodenDeviceType { + BELLOWS, + EAR, + PRESSURE_PLATE, + PRESSURE_PLATE_B, + BORE_BASE, + BORE, + PLANKS_GREATWOOD, + PLANKS_SILVERWOOD, + BANNER, + ; + } + + public enum AiryBlockType { + NODE, + NITOR, + _2, + _3, + WARDING_STONE_FENCE, + ENERGIZED_NODE, + ; + } + + public enum Entity { + BRAINY_ZOMBIE("entBrainyZombie", "EntityBrainyZombie"), + GIANT_BRAINY_ZOMBIE("entGiantBrainyZombie", "EntityGiantBrainyZombie"), + WISP("entWisp", "EntityWisp"), + FIREBAT("entFirebat", "EntityFireBat"), + ; + + private static String packageName = "thaumcraft.common.entities.monster."; + + public String entityID; + private String className; + + private Entity(String id, String clazz) { + this.entityID = id; + this.className = clazz; + } + + public String getClassName() { + return packageName + this.className; + } + } + + public enum BlockPlant { + GREATWOOD_SAPLING, + SILVERWOOD_SAPLING, + SHIMMERLEAF, + CINDERPEARL, + PURIFYING_PLANT, + VISHROOM, + ; + } + + public enum TreeType { + GREATWOOD, + SILVERWOOD, + ; + } + + public static Block plant; + public static Block candle; + public static Block crystal; + public static Block marker; + public static Block jar; + public static Block log; + public static Block leaf; + public static Block warded; + public static Block wooden; + public static Block metal; + public static Block airy; + public static Block fluxGas; + public static Block fluxGoo; + + public static Item filledJar; + public static Item miscResource; + public static Item shard; + public static Item golem; + public static Item nuggetMetal; + public static Item nuggetChicken; + public static Item nuggetBeef; + public static Item nuggetPork; + public static Item zombieBrain; + + public static Class nodeClass; + + public static final String Name = "Thaumcraft"; + private static boolean isThaumcraftPresent = false; + + public static boolean isActive() { + return isThaumcraftPresent; + } + + public void preInit() { + if (Loader.isModLoaded(Name) && Config.thaumcraftActive) { + isThaumcraftPresent = true; + aspectTime = new Aspect( + "tempus", + 0xB68CFF, + new Aspect[] {Aspect.VOID, Aspect.ORDER}, + new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.TEXTURE + "aspects/tempus.png"), + 1); + MagicBeesAPI.thaumcraftAspectTempus = aspectTime; + } else { + // Switch off TC-dependant items. + ResourceType.LORE_FRAGMENT.setHidden(); + ResourceType.TC_DUST_AIR.setHidden(); + ResourceType.TC_DUST_CHAOS.setHidden(); + ResourceType.TC_DUST_EARTH.setHidden(); + ResourceType.TC_DUST_FIRE.setHidden(); + ResourceType.TC_DUST_ORDER.setHidden(); + ResourceType.TC_DUST_WATER.setHidden(); + } + } + + public void init() { + if (isActive()) { + getBlocks(); + getItems(); + } + } + + public void postInit() { + if (isActive()) { + setupItemAspects(); + setupCrafting(); + setupResearch(); + } + } + + private static Object aspectTime; + + private static Object frameMagic; + private static Object thaumScoop; + private static Object thaumGrafter; + private static Object singularityA; + private static Object singularityB; + private static Object essenceLife; + private static Object essenceDeath; + private static Object essenceArmor; + private static Object essenceUnstableA; + private static Object essenceUnstableB; + private static Object essenceTime; + private static Object essenceOblivion; + private static Object visAuraProvider; + + private static Object voidScoop; + private static Object voidGrafter; + + private static void getBlocks() { + plant = BlockInterface.getBlock(Name, "blockCustomPlant"); + candle = BlockInterface.getBlock(Name, "blockCandle"); + crystal = BlockInterface.getBlock(Name, "blockCrystal"); + marker = BlockInterface.getBlock(Name, "blockMarker"); + jar = BlockInterface.getBlock(Name, "blockJar"); + log = BlockInterface.getBlock(Name, "blockMagicalLog"); + leaf = BlockInterface.getBlock(Name, "blockMagicalLeaves"); + warded = BlockInterface.getBlock(Name, "blockWarded"); + wooden = BlockInterface.getBlock(Name, "blockWoodenDevice"); + metal = BlockInterface.getBlock(Name, "blockMetalDevice"); + airy = BlockInterface.getBlock(Name, "blockAiry"); + } + + private static void getItems() { + filledJar = ItemInterface.getItem(Name, "BlockJarFilledItem"); + miscResource = ItemInterface.getItem(Name, "ItemResource"); + // Config.tcEssentiaBottle = ItemInterface.getItem(Name, + // "BlockJarFilledItem"); + shard = ItemInterface.getItem(Name, "ItemShard"); + golem = ItemInterface.getItem(Name, "ItemGolemPlacer"); + // Config.tcWispEssence = ItemApi.getItem("itemWispEssence", + // 0).getItem(); + nuggetMetal = ItemInterface.getItem(Name, "ItemNugget"); + shard = ItemInterface.getItem(Name, "ItemShard"); + nuggetChicken = ItemInterface.getItem(Name, "ItemNuggetChicken"); + nuggetBeef = ItemInterface.getItem(Name, "ItemNuggetBeef"); + nuggetPork = ItemInterface.getItem(Name, "ItemNuggetPork"); + zombieBrain = ItemInterface.getItem(Name, "ItemZombieBrain"); + } + + private static void setupCrafting() { + ItemStack input, output; + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_AIR); + output = new ItemStack(shard, 1, ShardType.AIR.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_WATER); + output = new ItemStack(shard, 1, ShardType.WATER.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_FIRE); + output = new ItemStack(shard, 1, ShardType.FIRE.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_EARTH); + output = new ItemStack(shard, 1, ShardType.EARTH.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_ORDER); + output = new ItemStack(shard, 1, ShardType.ORDER.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_CHAOS); + output = new ItemStack(shard, 1, ShardType.CHAOS.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + thaumScoop = ThaumcraftApi.addArcaneCraftingRecipe( + "MB_Scoop", new ItemStack(Config.thaumiumScoop), new AspectList().add(Aspect.ORDER, 2), new Object[] { + "sWs", + "sTs", + " T ", + 's', + Items.stick, + 'W', + Blocks.wool, + 'T', + new ItemStack(miscResource, 1, MiscResource.THAUMIUM.ordinal()) + }); + + thaumGrafter = ThaumcraftApi.addArcaneCraftingRecipe( + "MB_Grafter", + new ItemStack(Config.thaumiumGrafter), + new AspectList().add(Aspect.ORDER, 5), + new Object[] { + " T", + " s ", + "s ", + 's', + Items.stick, + 'T', + new ItemStack(miscResource, 1, MiscResource.THAUMIUM.ordinal()) + }); + + frameMagic = ThaumcraftApi.addArcaneCraftingRecipe( + "MB_FrameMagic", + new ItemStack(Config.hiveFrameMagic), + new AspectList().add(Aspect.ORDER, 5).add(Aspect.AIR, 2).add(Aspect.EARTH, 2), + new Object[] { + "sss", + "sCs", + "sss", + 's', + Items.stick, + 'C', + new ItemStack(miscResource, 1, MiscResource.ENCHANTED_FABRIC.ordinal()) + }); + + visAuraProvider = ThaumcraftApi.addArcaneCraftingRecipe( + "MB_VisAuraProvider", + new ItemStack(Config.visAuraProvider), + new AspectList() + .add(Aspect.ORDER, 60) + .add(Aspect.AIR, 60) + .add(Aspect.ENTROPY, 60) + .add(Aspect.WATER, 60), + new Object[] { + "ngn", + "gvg", + "npn", + 'n', + Items.gold_nugget, + 'g', + new ItemStack(wooden, 1, WoodenDeviceType.PLANKS_GREATWOOD.ordinal()), + 'v', + new ItemStack(metal, 1, MetalDeviceType.VIS_RELAY.ordinal()), + 'p', + Config.pollen.getStackForType(PollenType.UNUSUAL) + }); + + essenceLife = ThaumcraftApi.addCrucibleRecipe( + "MB_EssenceLife", + Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE), + new ItemStack(Blocks.red_flower), + new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.PLANT, 4)); + + essenceDeath = ThaumcraftApi.addCrucibleRecipe( + "MB_EssenceDeath", + Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE), + new ItemStack(Items.rotten_flesh), + new AspectList().add(Aspect.DEATH, 4).add(Aspect.ENTROPY, 4)); + + essenceArmor = ThaumcraftApi.addCrucibleRecipe( + "MB_EssenceArmor", + Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY), + new ItemStack(Items.leather), + new AspectList().add(Aspect.ARMOR, 4).add(Aspect.MAGIC, 2)); + + output = Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE); + essenceUnstableA = ThaumcraftApi.addCrucibleRecipe( + "MB_EssenceUnstable", + output, + Config.propolis.getStackForType(PropolisType.UNSTABLE), + new AspectList().add(Aspect.ENTROPY, 2).add(Aspect.EXCHANGE, 1)); + + essenceUnstableB = ThaumcraftApi.addCrucibleRecipe( + "MB_EssenceUnstable", + output, + new ItemStack(Blocks.netherrack), + new AspectList().add(Aspect.ENTROPY, 8).add(Aspect.EXCHANGE, 5)); + + essenceTime = ThaumcraftApi.addCrucibleRecipe( + "MB_EssenceTime", + Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME), + new ItemStack(Items.clock), + new AspectList().add(Aspect.ORDER, 10).add(Aspect.VOID, 10).add(Aspect.TRAP, 4)); + + input = new ItemStack(Items.ender_pearl); + singularityA = ThaumcraftApi.addInfusionCraftingRecipe( + "MB_DimensionalSingularity", + Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY, 3), + 5, + new AspectList().add(Aspect.ELDRITCH, 10).add(Aspect.EXCHANGE, 20), + new ItemStack(Blocks.gold_block), + new ItemStack[] {input, input}); + + ItemStack in2 = new ItemStack(Items.diamond); + singularityB = ThaumcraftApi.addInfusionCraftingRecipe( + "MB_DimensionalSingularity", + Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY, 3), + 6, + new AspectList() + .add(Aspect.ELDRITCH, 10) + .add(Aspect.EXCHANGE, 20) + .add(Aspect.VOID, 15), + Config.propolis.getStackForType(PropolisType.UNSTABLE), + new ItemStack[] {input, input, in2}); + + essenceOblivion = ThaumcraftApi.addShapelessArcaneCraftingRecipe( + "MB_EssenceOblivion", + Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION), + new AspectList().add(Aspect.ENTROPY, 25).add(Aspect.AIR, 40).add(Aspect.ORDER, 15), + new Object[] { + Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY), Blocks.dragon_egg, + }); + + voidScoop = ThaumcraftApi.addArcaneCraftingRecipe( + "MB_ScoopVoid", new ItemStack(Config.voidScoop), new AspectList().add(Aspect.ORDER, 2), new Object[] { + "sWs", + "sTs", + " T ", + 's', + Items.stick, + 'W', + Blocks.wool, + 'T', + new ItemStack(miscResource, 1, MiscResource.VOID_INGOT.ordinal()) + }); + + voidGrafter = ThaumcraftApi.addArcaneCraftingRecipe( + "MB_GrafterVoid", + new ItemStack(Config.voidGrafter), + new AspectList().add(Aspect.ORDER, 5), + new Object[] { + " T", + " s ", + "s ", + 's', + Items.stick, + 'T', + new ItemStack(miscResource, 1, MiscResource.VOID_INGOT.ordinal()) + }); + } + + private static void setupResearch() { + + ArrayList list; + ItemStack input; + IRecipe recipe; + String category = "MAGICBEES"; + ResearchCategories.registerCategory( + category, + new ResourceLocation(CommonProxy.DOMAIN, CommonProxy.ITEM_TEXTURE + "beeInfusion.png"), + new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png")); + + new ResearchItem( + "MB_Root", + category, + new AspectList(), + 0, + 0, + 0, + Config.miscResources.getStackForType(ResourceType.RESEARCH_BEEINFUSION)) + .setRound() + .setStub() + .setAutoUnlock() + .setPages(getResearchPage("MB_Root.1"), getResearchPage("MB_Root.2")) + .registerResearchItem(); + + list = new ArrayList(4); + list.add(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)); + list.add(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)); + list.add(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)); + list.add(Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)); + recipe = new ShapelessRecipes(new ItemStack(miscResource, 1, MiscResource.KNOWLEDGE_FRAGMENT.ordinal()), list); + + new ResearchItem( + "MB_LoreFragment", + category, + new AspectList(), + 0, + -3, + 1, + Config.miscResources.getStackForType(ResourceType.LORE_FRAGMENT)) + .setPages(getResearchPage("MB_LoreFragment.1"), new ResearchPage(recipe)) + .setParents("MB_Root") + .setStub() + .setAutoUnlock() + .setRound() + .registerResearchItem(); + + new ResearchItem( + "MB_Scoop", + category, + new AspectList() + .add(Aspect.TOOL, 1) + .add(Aspect.MAGIC, 1) + .add(Aspect.AIR, 1), + -2, + -3, + 1, + new ItemStack(Config.thaumiumScoop)) + .setPages(getResearchPage("MB_Scoop.1"), new ResearchPage((IArcaneRecipe) thaumScoop)) + .setParentsHidden("THAUMIUM") + .registerResearchItem(); + + new ResearchItem( + "MB_Grafter", + category, + new AspectList().add(Aspect.TOOL, 1).add(Aspect.TREE, 1).add(Aspect.GREED, 1), + -2, + -1, + 2, + new ItemStack(Config.thaumiumGrafter)) + .setPages(getResearchPage("MB_Grafter.1"), new ResearchPage((IArcaneRecipe) thaumGrafter)) + .setParents("MB_Scoop") + .registerResearchItem(); + + // Void tool insert + new ResearchItem( + "MB_ScoopVoid", + category, + new AspectList() + .add(Aspect.TOOL, 1) + .add(Aspect.ELDRITCH, 1) + .add(Aspect.AIR, 1), + -4, + -4, + 1, + new ItemStack(Config.voidScoop)) + .setPages(getResearchPage("MB_ScoopVoid.1"), new ResearchPage((IArcaneRecipe) voidScoop)) + .setParents("MB_Scoop") + .setParentsHidden("VOIDMETAL") + .setSecondary() + .setConcealed() + .registerResearchItem(); + + new ResearchItem( + "MB_GrafterVoid", + category, + new AspectList().add(Aspect.TOOL, 1).add(Aspect.TREE, 1).add(Aspect.ELDRITCH, 1), + -4, + -2, + 2, + new ItemStack(Config.voidGrafter)) + .setPages(getResearchPage("MB_GrafterVoid.1"), new ResearchPage((IArcaneRecipe) voidGrafter)) + .setParents("MB_Grafter") + .setParentsHidden("VOIDMETAL") + .setSecondary() + .setConcealed() + .registerResearchItem(); + // + + new ResearchItem( + "MB_FrameMagic", + category, + new AspectList().add(Aspect.TOOL, 1).add(Aspect.ARMOR, 1), + -2, + 1, + 1, + new ItemStack(Config.hiveFrameMagic)) + .setPages(getResearchPage("MB_FrameMagic"), new ResearchPage((IArcaneRecipe) frameMagic)) + .registerResearchItem(); + + input = new ItemStack(Config.hiveFrameMagic); + list = new ArrayList(2); + list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE)); + list.add(input); + recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameGentle), list); + + new ResearchItem( + "MB_EssenceLife", + category, + new AspectList().add(Aspect.LIFE, 1).add(Aspect.MAGIC, 1), + 2, + -1, + 1, + Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE)) + .setPages( + getResearchPage("MB_EssenceLife.1"), + new ResearchPage((CrucibleRecipe) essenceLife), + new ResearchPage(recipe)) + .setParentsHidden("CRUCIBLE") + .registerResearchItem(); + + list = new ArrayList(2); + list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY)); + list.add(input); + recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameResilient), list); + + new ResearchItem( + "MB_EssenceArmor", + category, + new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MAGIC, 1), + 5, + 0, + 2, + Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY)) + .setPages( + getResearchPage("MB_EssenceArmor.1"), + new ResearchPage((CrucibleRecipe) essenceArmor), + new ResearchPage(recipe)) + .setParents("MB_EssenceLife") + .registerResearchItem(); + + list = new ArrayList(2); + list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE)); + list.add(input); + recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameMetabolic), list); + + new ResearchItem( + "MB_EssenceUnstable", + category, + new AspectList().add(Aspect.ENTROPY, 1).add(Aspect.ORDER, 1), + 3, + 1, + 2, + Config.miscResources.getStackForType(ResourceType.ESSENCE_FICKLE_PERMANENCE)) + .setPages( + getResearchPage("MB_EssenceUnstable.1"), + new ResearchPage((CrucibleRecipe) essenceUnstableA), + new ResearchPage((CrucibleRecipe) essenceUnstableB), + new ResearchPage(recipe)) + .setParents("MB_EssenceLife") + .setConcealed() + .registerResearchItem(); + + list = new ArrayList(2); + list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE)); + list.add(input); + recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameNecrotic), list); + + new ResearchItem( + "MB_EssenceDeath", + category, + new AspectList().add(Aspect.DEATH, 1).add(Aspect.MAGIC, 1), + 2, + 3, + 1, + Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE)) + .setPages( + getResearchPage("MB_EssenceDeath.1"), + new ResearchPage((CrucibleRecipe) essenceDeath), + new ResearchPage(recipe)) + .setParents("MB_EssenceUnstable") + .setConcealed() + .registerResearchItem(); + + list = new ArrayList(2); + list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME)); + list.add(input); + recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameTemporal), list); + + new ResearchItem( + "MB_EssenceTime", + category, + new AspectList().add((Aspect) aspectTime, 1).add(Aspect.MAGIC, 1), + 0, + 2, + 2, + Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME)) + .setPages( + getResearchPage("MB_EssenceTime.1"), + new ResearchPage((CrucibleRecipe) essenceTime), + new ResearchPage(recipe)) + .setParents("MB_EssenceUnstable") + .setConcealed() + .registerResearchItem(); + + new ResearchItem( + "MB_DimensionalSingularity", + category, + new AspectList() + .add(Aspect.ELDRITCH, 1) + .add((Aspect) aspectTime, 1) + .add(Aspect.VOID, 1), + -1, + 4, + 3, + Config.miscResources.getStackForType(ResourceType.DIMENSIONAL_SINGULARITY)) + .setPages( + getResearchPage("MB_DimensionalSingularity.1"), + new ResearchPage((InfusionRecipe) singularityA), + new ResearchPage((InfusionRecipe) singularityB)) + .setParents("MB_FrameMagic", "MB_EssenceTime", "MB_EssenceDeath") + .setConcealed() + .setSpecial() + .registerResearchItem(); + + list = new ArrayList(2); + list.add(Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION)); + list.add(ItemInterface.getItemStack("frameProven")); + recipe = new ShapelessRecipes(new ItemStack(Config.hiveFrameOblivion), list); + + new ResearchItem( + "MB_EssenceOblivion", + category, + new AspectList() + .add(Aspect.VOID, 1) + .add(Aspect.HUNGER, 1) + .add((Aspect) aspectTime, 1), + -3, + 3, + 3, + Config.miscResources.getStackForType(ResourceType.ESSENCE_SCORNFUL_OBLIVION)) + .setPages( + getResearchPage("MB_EssenceOblivion.1"), + new ResearchPage((IArcaneRecipe) essenceOblivion), + new ResearchPage(recipe)) + .setParents("MB_DimensionalSingularity") + .setConcealed() + .registerResearchItem(); + + new ResearchItem( + "MB_VisAuraProvider", + category, + new AspectList() + .add(Aspect.MAGIC, 1) + .add(Aspect.ENERGY, 1) + .add(Aspect.AURA, 1), + -5, + 5, + 3, + new ItemStack(Config.visAuraProvider)) + .setPages(getResearchPage("MB_VisAuraProvider.1"), new ResearchPage((IArcaneRecipe) visAuraProvider)) + .setParentsHidden("VISPOWER") + .registerResearchItem(); + } + + private static ResearchPage getResearchPage(String ident) { + return new ResearchPage(LocalizationManager.getLocalizedString("tc.research_page." + ident)); + } + + private static void setupItemAspects() { + ItemStack item; + AspectList list; + + ThaumcraftApi.registerObjectTag( + new ItemStack(Items.clock), new AspectList(new ItemStack(Items.clock)).add((Aspect) aspectTime, 4)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Items.repeater), + new AspectList(new ItemStack(Items.repeater)).add((Aspect) aspectTime, 2)); + + list = new AspectList(new ItemStack(Blocks.log)); + for (int i = 1; i <= 8; i++) { + item = ItemInterface.getItemStack("log" + i); + if (item != null) { + ThaumcraftApi.registerObjectTag(item, list); + } + } + + list = new AspectList(new ItemStack(Blocks.planks)); + for (int i = 1; i <= 2; i++) { + item = ItemInterface.getItemStack("planks" + i); + if (item != null) { + ThaumcraftApi.registerObjectTag(item, list); + } + } + + list = new AspectList().add(Aspect.ORDER, 5).add(Aspect.ARMOR, 2).add(Aspect.BEAST, 1); + item = new ItemStack(ForestryHelper.hiveBlock, 1, 32767); + ThaumcraftApi.registerObjectTag(item, list); + ThaumcraftApi.registerObjectTag(new ItemStack(Config.hive, 1, 32767), list); + if (ExtraBeesHelper.isActive()) + ThaumcraftApi.registerObjectTag(new ItemStack(ExtraBeesHelper.hiveBlock, 1, 32767), list); + + list = new AspectList().add(Aspect.LIGHT, 1); + item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "candle")); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list); + + list = new AspectList().add(Aspect.DARKNESS, 1); + item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "stump")); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list); + + list = new AspectList(new ItemStack(Blocks.glass)).add(Aspect.SENSES, 1); + item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "glass")); + ThaumcraftApi.registerObjectTag(item, list); + + list = new AspectList().add(Aspect.EARTH, 2).add(Aspect.WATER, 2); + item = new ItemStack(BlockInterface.getBlock(ForestryHelper.Name, "soil")); + ThaumcraftApi.registerObjectTag(item, new int[] {1}, list); + + list = new AspectList(new ItemStack(Blocks.leaves)); + item = ItemInterface.getItemStack(ForestryHelper.Name, "candle"); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list); + + list = new AspectList(new ItemStack(Blocks.sapling)); + item = ItemInterface.getItemStack(ForestryHelper.Name, "candle"); + ThaumcraftApi.registerObjectTag(item, list); + + list = new AspectList() /* .add(Aspect.SEED, 1) */.add(Aspect.PLANT, 1); + item = ItemInterface.getItemStack(ForestryHelper.Name, "candle"); + ThaumcraftApi.registerObjectTag(item, list); + + list = new AspectList().add(Aspect.CRYSTAL, 1).add(Aspect.EARTH, 2); + item = ItemInterface.getItemStack(ForestryHelper.Name, "candle"); + ThaumcraftApi.registerObjectTag( + new ItemStack(item.getItem(), 1, ForestryHelper.BlockResource.APATITE.ordinal()), list.copy()); + item = ItemInterface.getItemStack(ForestryHelper.Name, "apatite"); + ThaumcraftApi.registerObjectTag( + new ItemStack(item.getItem(), 1, item.getItemDamage()), + list.copy().add(Aspect.CRYSTAL, 2)); + + list = new AspectList().add(Aspect.MOTION, 2).add(Aspect.FLIGHT, 1); + item = ItemInterface.getItemStack("beeDroneGE"); + ThaumcraftApi.registerObjectTag(item, list); + list = list.copy().add(Aspect.GREED, 2).add(Aspect.EXCHANGE, 1); + item = ItemInterface.getItemStack("beePrincessGE"); + ThaumcraftApi.registerObjectTag(item, list); + item = ItemInterface.getItemStack("beeQueenGE"); + ThaumcraftApi.registerObjectTag(item, list); + list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.EXCHANGE, 5); + item = ItemInterface.getItemStack("beeLarvaeGE"); + ThaumcraftApi.registerObjectTag(item, list); + + item = ItemInterface.getItemStack("scoop"); + list = new AspectList(new ItemStack(item.getItem(), 1, 0)).add(Aspect.TOOL, 2); + ThaumcraftApi.registerComplexObjectTag(item, list); + + item = ItemInterface.getItemStack("grafter"); + list = new AspectList(new ItemStack(item.getItem(), 1, item.getItemDamage())).add(Aspect.TOOL, 2); + ThaumcraftApi.registerComplexObjectTag(item, list); + + item = ItemInterface.getItemStack("grafterProven"); + list = list.copy().add(Aspect.TOOL, 2).add(Aspect.EXCHANGE, 3); + ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, item.getItemDamage()), list); + + list = new AspectList().add(Aspect.TRAP, 2); + ThaumcraftApi.registerObjectTag("beeComb", list); + + list = new AspectList().add(Aspect.SLIME, 1); + item = ItemInterface.getItemStack("propolis"); + ThaumcraftApi.registerObjectTag( + new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.NORMAL.ordinal()), list); + ThaumcraftApi.registerObjectTag( + new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.SILKY.ordinal()), + list.copy().add(Aspect.SLIME, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(item.getItem(), 1, ForestryHelper.Propolis.PULSATING.ordinal()), + list.copy().add(Aspect.ELDRITCH, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.propolis, 1, PropolisType.UNSTABLE.ordinal()), + list.copy().add(Aspect.ENTROPY, 1).add(Aspect.EXCHANGE, 1)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.propolis, 1, PropolisType.AIR.ordinal()), + list.copy().add(Aspect.AIR, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.propolis, 1, PropolisType.WATER.ordinal()), + list.copy().add(Aspect.WATER, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.propolis, 1, PropolisType.FIRE.ordinal()), + list.copy().add(Aspect.FIRE, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.propolis, 1, PropolisType.EARTH.ordinal()), + list.copy().add(Aspect.EARTH, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.propolis, 1, PropolisType.ORDER.ordinal()), + list.copy().add(Aspect.ORDER, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.propolis, 1, PropolisType.CHAOS.ordinal()), + list.copy().add(Aspect.ENTROPY, 2)); + + list = new AspectList().add(Aspect.PLANT, 2); + item = ItemInterface.getItemStack("pollen"); + ThaumcraftApi.registerObjectTag(new ItemStack(item.getItem(), 1, ForestryHelper.Pollen.NORMAL.ordinal()), list); + ThaumcraftApi.registerObjectTag( + new ItemStack(item.getItem(), 1, ForestryHelper.Pollen.CRYSTALLINE.ordinal()), list.copy()); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.pollen, 1, PollenType.UNUSUAL.ordinal()), + list.copy().add(Aspect.MAGIC, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.pollen, 1, PollenType.PHASED.ordinal()), + list.copy().add((Aspect) aspectTime, 2)); + + list = new AspectList().add(Aspect.ORDER, 1); + item = ItemInterface.getItemStack("beeswax"); + ThaumcraftApi.registerObjectTag( + item, new int[] {item.getItemDamage()}, list.copy().add(Aspect.ORDER, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.wax, 1, WaxType.MAGIC.ordinal()), + list.copy().add(Aspect.MAGIC, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.wax, 1, WaxType.SOUL.ordinal()), + list.copy().add(Aspect.SOUL, 2)); + ThaumcraftApi.registerObjectTag( + new ItemStack(Config.wax, 1, WaxType.AMNESIC.ordinal()), + list.copy().add(Aspect.MIND, 2)); + + list = new AspectList().add(Aspect.EXCHANGE, 2).add(Aspect.LIFE, 2); + item = ItemInterface.getItemStack("honeyDrop"); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list); + + list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.ENERGY, 2); + item = ItemInterface.getItemStack("honeydew"); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list); + + list = new AspectList().add(Aspect.GREED, 1).add(Aspect.LIFE, 4); + item = ItemInterface.getItemStack("royalJelly"); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list); + + list = new AspectList().add(Aspect.FIRE, 1).add(Aspect.TRAP, 2); + item = ItemInterface.getItemStack("phosphor"); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, list); + + item = Config.miscResources.getStackForType(ResourceType.ESSENCE_FALSE_LIFE); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, new AspectList().add(Aspect.LIFE, 6)); + + item = Config.miscResources.getStackForType(ResourceType.ESSENCE_SHALLOW_GRAVE); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, new AspectList().add(Aspect.DEATH, 6)); + + item = Config.miscResources.getStackForType(ResourceType.ESSENCE_EVERLASTING_DURABILITY); + ThaumcraftApi.registerObjectTag(item, new int[] {item.getItemDamage()}, new AspectList().add(Aspect.ARMOR, 6)); + + item = Config.miscResources.getStackForType(ResourceType.ESSENCE_LOST_TIME); + ThaumcraftApi.registerObjectTag( + item, + new int[] {item.getItemDamage()}, + new AspectList().add(Aspect.VOID, 6).add((Aspect) aspectTime, 8)); + } } diff --git a/src/main/java/magicbees/main/utils/compat/ThermalModsHelper.java b/src/main/java/magicbees/main/utils/compat/ThermalModsHelper.java index b2af474..d26f34f 100644 --- a/src/main/java/magicbees/main/utils/compat/ThermalModsHelper.java +++ b/src/main/java/magicbees/main/utils/compat/ThermalModsHelper.java @@ -11,175 +11,175 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; public class ThermalModsHelper implements IModHelper { - - public enum MiscResource { - EnderiumBlock, - ElectrumBlock, - BronzeBlock, - FluidCoal, - FluidRedstone, - FluidGlowstone, - FluidEnder,; - } - public enum NuggetType { - ENDERIUM, - ELECTRUM, - BRONZE, - INVAR, - NICKEL, - PLATINUM,; - } + public enum MiscResource { + EnderiumBlock, + ElectrumBlock, + BronzeBlock, + FluidCoal, + FluidRedstone, + FluidGlowstone, + FluidEnder, + ; + } - public enum Entity { - BLIZZ("Blizz", "ThermalFoundation:mobBlizzBreathe0"), - BLITZ("Blitz", "ThermalFoundation:mobBlitzBreathe1"), - BASALZ("Basalz", "ThermalFoundation:mobBasalzBreathe0"), - ; + public enum NuggetType { + ENDERIUM, + ELECTRUM, + BRONZE, + INVAR, + NICKEL, + PLATINUM, + ; + } - public final String entityID; - public final String soundName; + public enum Entity { + BLIZZ("Blizz", "ThermalFoundation:mobBlizzBreathe0"), + BLITZ("Blitz", "ThermalFoundation:mobBlitzBreathe1"), + BASALZ("Basalz", "ThermalFoundation:mobBasalzBreathe0"), + ; - private Entity(String id, String sound) - { - this.entityID = id; - soundName = sound; - } - } + public final String entityID; + public final String soundName; - //---ThermalExpansion Items --- - public static ItemStack enderiumBlock; - public static ItemStack electrumBlock; - public static ItemStack invarBlock; - public static ItemStack nickelBlock; - public static ItemStack platinumBlock; - public static ItemStack bronzeBlock; - public static ItemStack signalumBlock; - public static ItemStack lumiumBlock; - - public static ItemStack enderiumNugget; - public static ItemStack invarNugget; - public static ItemStack electrumNugget; - public static ItemStack nickelNugget; - public static ItemStack platinumNugget; - public static ItemStack signalumNugget; - public static ItemStack lumiumNugget; - - public static ItemStack dustCryotheum; - public static ItemStack dustBlizz; - public static ItemStack dustPyrotheum; - public static ItemStack dustBlitz; - public static ItemStack dustAerotheum; - public static ItemStack dustBasalz; - public static ItemStack dustPetrotheum; - public static ItemStack dustSulfur; - public static ItemStack dustPlatinum; - - public static FluidStack fluidGlowstone; - public static FluidStack fluidCoal; - public static FluidStack fluidRedstone; - public static FluidStack fluidEnder; - - public static final String Name = "ThermalFoundation"; - private static boolean isThermalFoundationPresent = false; + private Entity(String id, String sound) { + this.entityID = id; + soundName = sound; + } + } - public static boolean isActive() { - return isThermalFoundationPresent; - } + // ---ThermalExpansion Items --- + public static ItemStack enderiumBlock; + public static ItemStack electrumBlock; + public static ItemStack invarBlock; + public static ItemStack nickelBlock; + public static ItemStack platinumBlock; + public static ItemStack bronzeBlock; + public static ItemStack signalumBlock; + public static ItemStack lumiumBlock; - public void preInit() { - if (Loader.isModLoaded(Name) && Config.thermalFoundationActive) { - isThermalFoundationPresent = true; - } - } + public static ItemStack enderiumNugget; + public static ItemStack invarNugget; + public static ItemStack electrumNugget; + public static ItemStack nickelNugget; + public static ItemStack platinumNugget; + public static ItemStack signalumNugget; + public static ItemStack lumiumNugget; - public void init() { - if (isActive()) { - getBlocks(); - getItems(); - getFluids(); - setupCrafting(); - } - } + public static ItemStack dustCryotheum; + public static ItemStack dustBlizz; + public static ItemStack dustPyrotheum; + public static ItemStack dustBlitz; + public static ItemStack dustAerotheum; + public static ItemStack dustBasalz; + public static ItemStack dustPetrotheum; + public static ItemStack dustSulfur; + public static ItemStack dustPlatinum; - public void postInit() { - // if (isActive()) { } - } + public static FluidStack fluidGlowstone; + public static FluidStack fluidCoal; + public static FluidStack fluidRedstone; + public static FluidStack fluidEnder; - private static void getFluids() { - fluidGlowstone = FluidRegistry.getFluidStack("glowstone", 50); - fluidCoal = FluidRegistry.getFluidStack("coal", 50); - fluidRedstone = FluidRegistry.getFluidStack("redstone", 50); - fluidEnder = FluidRegistry.getFluidStack("ender", 50); - } + public static final String Name = "ThermalFoundation"; + private static boolean isThermalFoundationPresent = false; - private static void getBlocks() { - enderiumBlock = GameRegistry.findItemStack(Name, "blockEnderium", 1); - electrumBlock = GameRegistry.findItemStack(Name, "blockElectrum", 1); - invarBlock = GameRegistry.findItemStack(Name, "blockInvar", 1); - nickelBlock = GameRegistry.findItemStack(Name, "blockNickel", 1); - platinumBlock = GameRegistry.findItemStack(Name, "blockPlatinum", 1); - bronzeBlock = GameRegistry.findItemStack(Name, "blockBronze", 1); - signalumBlock = GameRegistry.findItemStack(Name, "blockSignalum", 1); - lumiumBlock = GameRegistry.findItemStack(Name, "blockLumium", 1); - } + public static boolean isActive() { + return isThermalFoundationPresent; + } - private static void getItems() { - enderiumNugget = GameRegistry.findItemStack(Name, "nuggetEnderium", 1); - invarNugget = GameRegistry.findItemStack(Name, "nuggetInvar", 1); - electrumNugget = GameRegistry.findItemStack(Name, "nuggetElectrum", 1); - nickelNugget = GameRegistry.findItemStack(Name, "nuggetNickel", 1); - platinumNugget = GameRegistry.findItemStack(Name, "nuggetPlatinum", 1); - signalumNugget = GameRegistry.findItemStack(Name, "nuggetSignalum", 1); - lumiumNugget = GameRegistry.findItemStack(Name, "nuggetLumium", 1); - - dustCryotheum = GameRegistry.findItemStack(Name, "dustCryotheum", 1); - dustBlizz = GameRegistry.findItemStack(Name, "dustBlizz", 1); - dustPyrotheum = GameRegistry.findItemStack(Name, "dustPyrotheum", 1); - dustBlitz = GameRegistry.findItemStack(Name, "dustBlitz", 1); - dustAerotheum = GameRegistry.findItemStack(Name, "dustAerotheum", 1); - dustBasalz = GameRegistry.findItemStack(Name, "dustBasalz", 1); - dustPetrotheum = GameRegistry.findItemStack(Name, "dustPetrotheum", 1); - dustSulfur = GameRegistry.findItemStack(Name, "dustSulfur", 1); - dustPlatinum = GameRegistry.findItemStack(Name, "dustPlatinum", 1); - } + public void preInit() { + if (Loader.isModLoaded(Name) && Config.thermalFoundationActive) { + isThermalFoundationPresent = true; + } + } - private static void setupCrafting() { - NBTTagCompound toSend = new NBTTagCompound(); - toSend.setInteger("energy", 4000); - toSend.setTag("input", new NBTTagCompound()); - toSend.setTag("output", new NBTTagCompound()); - ItemStack carbonDrop = Config.drops.getStackForType(DropType.CARBON); - carbonDrop.writeToNBT(toSend.getCompoundTag("input")); - fluidCoal.writeToNBT(toSend.getCompoundTag("output")); - FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend); + public void init() { + if (isActive()) { + getBlocks(); + getItems(); + getFluids(); + setupCrafting(); + } + } + public void postInit() { + // if (isActive()) { } + } - toSend = new NBTTagCompound(); - toSend.setInteger("energy", 4000); - toSend.setTag("input", new NBTTagCompound()); - toSend.setTag("output", new NBTTagCompound()); - ItemStack destabilizedDrop = Config.drops.getStackForType(DropType.DESTABILIZED); - destabilizedDrop.writeToNBT(toSend.getCompoundTag("input")); - fluidRedstone.writeToNBT(toSend.getCompoundTag("output")); - FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend); + private static void getFluids() { + fluidGlowstone = FluidRegistry.getFluidStack("glowstone", 50); + fluidCoal = FluidRegistry.getFluidStack("coal", 50); + fluidRedstone = FluidRegistry.getFluidStack("redstone", 50); + fluidEnder = FluidRegistry.getFluidStack("ender", 50); + } - toSend = new NBTTagCompound(); - toSend.setInteger("energy", 4000); - toSend.setTag("input", new NBTTagCompound()); - toSend.setTag("output", new NBTTagCompound()); - ItemStack endearingDrop = Config.drops.getStackForType(DropType.ENDEARING); - endearingDrop.writeToNBT(toSend.getCompoundTag("input")); - fluidEnder.writeToNBT(toSend.getCompoundTag("output")); - FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend); + private static void getBlocks() { + enderiumBlock = GameRegistry.findItemStack(Name, "blockEnderium", 1); + electrumBlock = GameRegistry.findItemStack(Name, "blockElectrum", 1); + invarBlock = GameRegistry.findItemStack(Name, "blockInvar", 1); + nickelBlock = GameRegistry.findItemStack(Name, "blockNickel", 1); + platinumBlock = GameRegistry.findItemStack(Name, "blockPlatinum", 1); + bronzeBlock = GameRegistry.findItemStack(Name, "blockBronze", 1); + signalumBlock = GameRegistry.findItemStack(Name, "blockSignalum", 1); + lumiumBlock = GameRegistry.findItemStack(Name, "blockLumium", 1); + } - toSend = new NBTTagCompound(); - toSend.setInteger("energy", 4000); - toSend.setTag("input", new NBTTagCompound()); - toSend.setTag("output", new NBTTagCompound()); - ItemStack luxDrop = Config.drops.getStackForType(DropType.LUX); - luxDrop.writeToNBT(toSend.getCompoundTag("input")); - fluidGlowstone.writeToNBT(toSend.getCompoundTag("output")); - FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend); - } -} \ No newline at end of file + private static void getItems() { + enderiumNugget = GameRegistry.findItemStack(Name, "nuggetEnderium", 1); + invarNugget = GameRegistry.findItemStack(Name, "nuggetInvar", 1); + electrumNugget = GameRegistry.findItemStack(Name, "nuggetElectrum", 1); + nickelNugget = GameRegistry.findItemStack(Name, "nuggetNickel", 1); + platinumNugget = GameRegistry.findItemStack(Name, "nuggetPlatinum", 1); + signalumNugget = GameRegistry.findItemStack(Name, "nuggetSignalum", 1); + lumiumNugget = GameRegistry.findItemStack(Name, "nuggetLumium", 1); + + dustCryotheum = GameRegistry.findItemStack(Name, "dustCryotheum", 1); + dustBlizz = GameRegistry.findItemStack(Name, "dustBlizz", 1); + dustPyrotheum = GameRegistry.findItemStack(Name, "dustPyrotheum", 1); + dustBlitz = GameRegistry.findItemStack(Name, "dustBlitz", 1); + dustAerotheum = GameRegistry.findItemStack(Name, "dustAerotheum", 1); + dustBasalz = GameRegistry.findItemStack(Name, "dustBasalz", 1); + dustPetrotheum = GameRegistry.findItemStack(Name, "dustPetrotheum", 1); + dustSulfur = GameRegistry.findItemStack(Name, "dustSulfur", 1); + dustPlatinum = GameRegistry.findItemStack(Name, "dustPlatinum", 1); + } + + private static void setupCrafting() { + NBTTagCompound toSend = new NBTTagCompound(); + toSend.setInteger("energy", 4000); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("output", new NBTTagCompound()); + ItemStack carbonDrop = Config.drops.getStackForType(DropType.CARBON); + carbonDrop.writeToNBT(toSend.getCompoundTag("input")); + fluidCoal.writeToNBT(toSend.getCompoundTag("output")); + FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend); + + toSend = new NBTTagCompound(); + toSend.setInteger("energy", 4000); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("output", new NBTTagCompound()); + ItemStack destabilizedDrop = Config.drops.getStackForType(DropType.DESTABILIZED); + destabilizedDrop.writeToNBT(toSend.getCompoundTag("input")); + fluidRedstone.writeToNBT(toSend.getCompoundTag("output")); + FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend); + + toSend = new NBTTagCompound(); + toSend.setInteger("energy", 4000); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("output", new NBTTagCompound()); + ItemStack endearingDrop = Config.drops.getStackForType(DropType.ENDEARING); + endearingDrop.writeToNBT(toSend.getCompoundTag("input")); + fluidEnder.writeToNBT(toSend.getCompoundTag("output")); + FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend); + + toSend = new NBTTagCompound(); + toSend.setInteger("energy", 4000); + toSend.setTag("input", new NBTTagCompound()); + toSend.setTag("output", new NBTTagCompound()); + ItemStack luxDrop = Config.drops.getStackForType(DropType.LUX); + luxDrop.writeToNBT(toSend.getCompoundTag("input")); + fluidGlowstone.writeToNBT(toSend.getCompoundTag("output")); + FMLInterModComms.sendMessage("ThermalExpansion", "CrucibleRecipe", toSend); + } +} diff --git a/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java b/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java index 44f32e0..517c113 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java +++ b/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java @@ -1,5 +1,6 @@ package magicbees.main.utils.compat.botania; +import forestry.api.apiculture.EnumBeeType; import magicbees.bees.BeeSpecies; import magicbees.main.Config; import magicbees.main.utils.compat.BotaniaHelper; @@ -11,131 +12,143 @@ import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.recipe.RecipeElvenTrade; import vazkii.botania.api.recipe.RecipeManaInfusion; import vazkii.botania.api.recipe.RecipePetals; -import forestry.api.apiculture.EnumBeeType; /** * Subordinate helper to the Botania Helper that has references to Botania API stuff that will cause * NoClassDefFoundErrors if included in the Botania Helper proper. */ public class BotaniaAPIDistanceHelper { - - public static LexiconEntry entryManasteelForestryTools; - public static LexiconEntry entryBeeTrade; - public static LexiconEntry entryBeegonia; - public static LexiconEntry entryHiveacynth; - public static LexiconEntry entryHibeescus; - public static LexiconEntry entryManaApiaryBooster; - - public static RecipeManaInfusion infusionBeeBotanical; - public static RecipeManaInfusion infusionBeeVazbee; - - public static RecipeElvenTrade tradeBeeAelfheim; - - public static void registerSubtiles() { - BotaniaAPI.registerSubTile(SubTileBeegonia.NAME, SubTileBeegonia.class); - BotaniaAPI.registerSubTileSignature(SubTileBeegonia.class, new BotaniaSignature(SubTileBeegonia.NAME)); - BotaniaAPI.addSubTileToCreativeMenu(SubTileBeegonia.NAME); - - BotaniaAPI.registerSubTile(SubTileHiveacynth.NAME, SubTileHiveacynth.class); - BotaniaAPI.registerSubTileSignature(SubTileHiveacynth.class, new BotaniaSignature(SubTileHiveacynth.NAME)); - BotaniaAPI.addSubTileToCreativeMenu(SubTileHiveacynth.NAME); - - BotaniaAPI.registerSubTile(SubTileHibeescus.NAME, SubTileHibeescus.class); - BotaniaAPI.registerSubTileSignature(SubTileHibeescus.class, new BotaniaSignature(SubTileHibeescus.NAME)); - BotaniaAPI.addSubTileToCreativeMenu(SubTileHibeescus.NAME); - } - public static void setupCraftingAndLexicon() { - infusionBeeBotanical = new SpeciesRecipeManaInfusion(BeeSpecies.BOT_BOTANIC, BeeSpecies.BOT_ROOTED, 55000, EnumBeeType.DRONE); - BotaniaAPI.manaInfusionRecipes.add(infusionBeeBotanical); - - infusionBeeVazbee = new SpeciesRecipeManaInfusion(BeeSpecies.BOT_VAZBEE, BeeSpecies.BOT_FLORAL, 167392, EnumBeeType.PRINCESS); - infusionBeeVazbee.setAlchemy(true); - BotaniaAPI.manaInfusionRecipes.add(infusionBeeVazbee); - - tradeBeeAelfheim = new SpeciesRecipeElvenTrade(BeeSpecies.BOT_DREAMING, BeeSpecies.BOT_ALFHEIM); - BotaniaAPI.elvenTradeRecipes.add(tradeBeeAelfheim); - - entryManasteelForestryTools = new BotaniaLexiconEntry("magicbees.botania.lexicon.manasteelTools.title", BotaniaAPI.categoryTools); - entryManasteelForestryTools.setIcon(new ItemStack(Config.manasteelScoop)); - entryManasteelForestryTools.addPage(BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.manasteelTools.0")); - entryManasteelForestryTools.addPage(BotaniaAPI.internalHandler.craftingRecipePage("magicbees.botania.lexicon.manasteelScoop", BotaniaHelper.manasteelScoopRecipe)); - entryManasteelForestryTools.addPage(BotaniaAPI.internalHandler.craftingRecipePage("magicbees.botania.lexicon.manasteelGrafter", BotaniaHelper.manasteelGrafterRecipe)); + public static LexiconEntry entryManasteelForestryTools; + public static LexiconEntry entryBeeTrade; + public static LexiconEntry entryBeegonia; + public static LexiconEntry entryHiveacynth; + public static LexiconEntry entryHibeescus; + public static LexiconEntry entryManaApiaryBooster; - entryBeeTrade = new BotaniaLexiconEntry("magicbees.botania.lexicon.beeAlfheim.title", BotaniaAPI.categoryAlfhomancy); - entryBeeTrade.setIcon(BeeSpecies.BOT_ALFHEIM.getBeeItem(EnumBeeType.PRINCESS)); - entryBeeTrade.setKnowledgeType(BotaniaAPI.elvenKnowledge); - entryBeeTrade.addPage(BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beeAlfheim.0")); - entryBeeTrade.addPage(BotaniaAPI.internalHandler.elvenTradesPage("magicbees.botania.lexicon.beeAlfheim.trade", tradeBeeAelfheim)); - - RecipePetals beegoniaRecipe = BotaniaAPI.registerPetalRecipe(BotaniaAPI.internalHandler.getSubTileAsStack(SubTileBeegonia.NAME), - new ItemStack(BotaniaHelper.itemPetal), - new ItemStack(BotaniaHelper.itemPetal, 1, 4), - new ItemStack(BotaniaHelper.itemPetal, 1, 4), - new ItemStack(BotaniaHelper.itemPetal, 1, 15), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()) - ); - entryBeegonia = new BotaniaLexiconEntry("tile.botania:flower." + SubTileBeegonia.NAME + ".name", BotaniaAPI.categoryGenerationFlowers); - entryBeegonia.setLexiconPages( - BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beegonia.0"), - BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beegonia.1"), - BotaniaAPI.internalHandler.petalRecipePage("magicbees.botania.lexicon.beegonia.crafting", beegoniaRecipe), - BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beegonia.2") - ); - - RecipePetals hiveacynthRecipe = BotaniaAPI.registerPetalRecipe(BotaniaAPI.internalHandler.getSubTileAsStack(SubTileHiveacynth.NAME), - new ItemStack(BotaniaHelper.itemPetal, 1, 3), - new ItemStack(BotaniaHelper.itemPetal, 1, 9), - new ItemStack(BotaniaHelper.itemPetal, 1, 9), - new ItemStack(BotaniaHelper.itemPetal, 1, 11), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.REDSTONE_ROOT.ordinal()) - ); - entryHiveacynth = new BotaniaLexiconEntry("tile.botania:flower." + SubTileHiveacynth.NAME + ".name", BotaniaAPI.categoryFunctionalFlowers); - entryHiveacynth.setLexiconPages(BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hiveacynth.0"), - BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hiveacynth.1"), - BotaniaAPI.internalHandler.petalRecipePage("magicbees.botania.lexicon.hiveacynth.crafting", hiveacynthRecipe) - ); - - RecipePetals hibeescusRecipe = BotaniaAPI.registerPetalRecipe(BotaniaAPI.internalHandler.getSubTileAsStack(SubTileHibeescus.NAME), - new ItemStack(BotaniaHelper.itemPetal, 1, 1), - new ItemStack(BotaniaHelper.itemPetal, 1, 2), - new ItemStack(BotaniaHelper.itemPetal, 1, 2), - new ItemStack(BotaniaHelper.itemPetal, 1, 2), - new ItemStack(BotaniaHelper.itemPetal, 1, 14), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), - BotaniaHelper.getRune(Rune.AIR, 1), - BotaniaHelper.getRune(Rune.SUMMER, 1), - BotaniaHelper.getRune(Rune.ENVY, 1), - BotaniaHelper.getRune(Rune.GREED, 1), - BotaniaHelper.getRune(Rune.PRIDE, 1), - new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.REDSTONE_ROOT.ordinal()) - ); - entryHibeescus = new BotaniaLexiconEntry("tile.botania:flower." + SubTileHibeescus.NAME + ".name", BotaniaAPI.categoryFunctionalFlowers); - entryHibeescus.setLexiconPages(BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hibeescus.0"), - BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hibeescus.1"), - BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hibeescus.2"), - BotaniaAPI.internalHandler.petalRecipePage("magicbees.botania.lexicon.hibeescus.crafting", hibeescusRecipe) - ); - - entryManaApiaryBooster = new BotaniaLexiconEntry("tile.manaAuraProvider.name", BotaniaAPI.categoryDevices); - entryManaApiaryBooster.setLexiconPages( - BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.manaBooster.0"), - BotaniaAPI.internalHandler.craftingRecipePage("magicbees.botania.lexicon.manaBooster.crafting", BotaniaHelper.manaBoosterRecipe) - ); - } - - public static LexiconEntry getLexiconEntryForName(String name) { - for (LexiconEntry entry : BotaniaAPI.getAllEntries()) { - if (entry.unlocalizedName.equals(name)) { - return entry; - } - } - return null; - } + public static RecipeManaInfusion infusionBeeBotanical; + public static RecipeManaInfusion infusionBeeVazbee; + + public static RecipeElvenTrade tradeBeeAelfheim; + + public static void registerSubtiles() { + BotaniaAPI.registerSubTile(SubTileBeegonia.NAME, SubTileBeegonia.class); + BotaniaAPI.registerSubTileSignature(SubTileBeegonia.class, new BotaniaSignature(SubTileBeegonia.NAME)); + BotaniaAPI.addSubTileToCreativeMenu(SubTileBeegonia.NAME); + + BotaniaAPI.registerSubTile(SubTileHiveacynth.NAME, SubTileHiveacynth.class); + BotaniaAPI.registerSubTileSignature(SubTileHiveacynth.class, new BotaniaSignature(SubTileHiveacynth.NAME)); + BotaniaAPI.addSubTileToCreativeMenu(SubTileHiveacynth.NAME); + + BotaniaAPI.registerSubTile(SubTileHibeescus.NAME, SubTileHibeescus.class); + BotaniaAPI.registerSubTileSignature(SubTileHibeescus.class, new BotaniaSignature(SubTileHibeescus.NAME)); + BotaniaAPI.addSubTileToCreativeMenu(SubTileHibeescus.NAME); + } + + public static void setupCraftingAndLexicon() { + infusionBeeBotanical = + new SpeciesRecipeManaInfusion(BeeSpecies.BOT_BOTANIC, BeeSpecies.BOT_ROOTED, 55000, EnumBeeType.DRONE); + BotaniaAPI.manaInfusionRecipes.add(infusionBeeBotanical); + + infusionBeeVazbee = new SpeciesRecipeManaInfusion( + BeeSpecies.BOT_VAZBEE, BeeSpecies.BOT_FLORAL, 167392, EnumBeeType.PRINCESS); + infusionBeeVazbee.setAlchemy(true); + BotaniaAPI.manaInfusionRecipes.add(infusionBeeVazbee); + + tradeBeeAelfheim = new SpeciesRecipeElvenTrade(BeeSpecies.BOT_DREAMING, BeeSpecies.BOT_ALFHEIM); + BotaniaAPI.elvenTradeRecipes.add(tradeBeeAelfheim); + + entryManasteelForestryTools = + new BotaniaLexiconEntry("magicbees.botania.lexicon.manasteelTools.title", BotaniaAPI.categoryTools); + entryManasteelForestryTools.setIcon(new ItemStack(Config.manasteelScoop)); + entryManasteelForestryTools.addPage( + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.manasteelTools.0")); + entryManasteelForestryTools.addPage(BotaniaAPI.internalHandler.craftingRecipePage( + "magicbees.botania.lexicon.manasteelScoop", BotaniaHelper.manasteelScoopRecipe)); + entryManasteelForestryTools.addPage(BotaniaAPI.internalHandler.craftingRecipePage( + "magicbees.botania.lexicon.manasteelGrafter", BotaniaHelper.manasteelGrafterRecipe)); + + entryBeeTrade = + new BotaniaLexiconEntry("magicbees.botania.lexicon.beeAlfheim.title", BotaniaAPI.categoryAlfhomancy); + entryBeeTrade.setIcon(BeeSpecies.BOT_ALFHEIM.getBeeItem(EnumBeeType.PRINCESS)); + entryBeeTrade.setKnowledgeType(BotaniaAPI.elvenKnowledge); + entryBeeTrade.addPage(BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beeAlfheim.0")); + entryBeeTrade.addPage(BotaniaAPI.internalHandler.elvenTradesPage( + "magicbees.botania.lexicon.beeAlfheim.trade", tradeBeeAelfheim)); + + RecipePetals beegoniaRecipe = BotaniaAPI.registerPetalRecipe( + BotaniaAPI.internalHandler.getSubTileAsStack(SubTileBeegonia.NAME), + new ItemStack(BotaniaHelper.itemPetal), + new ItemStack(BotaniaHelper.itemPetal, 1, 4), + new ItemStack(BotaniaHelper.itemPetal, 1, 4), + new ItemStack(BotaniaHelper.itemPetal, 1, 15), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal())); + entryBeegonia = new BotaniaLexiconEntry( + "tile.botania:flower." + SubTileBeegonia.NAME + ".name", BotaniaAPI.categoryGenerationFlowers); + entryBeegonia.setLexiconPages( + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beegonia.0"), + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beegonia.1"), + BotaniaAPI.internalHandler.petalRecipePage( + "magicbees.botania.lexicon.beegonia.crafting", beegoniaRecipe), + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beegonia.2")); + + RecipePetals hiveacynthRecipe = BotaniaAPI.registerPetalRecipe( + BotaniaAPI.internalHandler.getSubTileAsStack(SubTileHiveacynth.NAME), + new ItemStack(BotaniaHelper.itemPetal, 1, 3), + new ItemStack(BotaniaHelper.itemPetal, 1, 9), + new ItemStack(BotaniaHelper.itemPetal, 1, 9), + new ItemStack(BotaniaHelper.itemPetal, 1, 11), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.REDSTONE_ROOT.ordinal())); + entryHiveacynth = new BotaniaLexiconEntry( + "tile.botania:flower." + SubTileHiveacynth.NAME + ".name", BotaniaAPI.categoryFunctionalFlowers); + entryHiveacynth.setLexiconPages( + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hiveacynth.0"), + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hiveacynth.1"), + BotaniaAPI.internalHandler.petalRecipePage( + "magicbees.botania.lexicon.hiveacynth.crafting", hiveacynthRecipe)); + + RecipePetals hibeescusRecipe = BotaniaAPI.registerPetalRecipe( + BotaniaAPI.internalHandler.getSubTileAsStack(SubTileHibeescus.NAME), + new ItemStack(BotaniaHelper.itemPetal, 1, 1), + new ItemStack(BotaniaHelper.itemPetal, 1, 2), + new ItemStack(BotaniaHelper.itemPetal, 1, 2), + new ItemStack(BotaniaHelper.itemPetal, 1, 2), + new ItemStack(BotaniaHelper.itemPetal, 1, 14), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.MANA_POWDER.ordinal()), + BotaniaHelper.getRune(Rune.AIR, 1), + BotaniaHelper.getRune(Rune.SUMMER, 1), + BotaniaHelper.getRune(Rune.ENVY, 1), + BotaniaHelper.getRune(Rune.GREED, 1), + BotaniaHelper.getRune(Rune.PRIDE, 1), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.REDSTONE_ROOT.ordinal())); + entryHibeescus = new BotaniaLexiconEntry( + "tile.botania:flower." + SubTileHibeescus.NAME + ".name", BotaniaAPI.categoryFunctionalFlowers); + entryHibeescus.setLexiconPages( + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hibeescus.0"), + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hibeescus.1"), + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hibeescus.2"), + BotaniaAPI.internalHandler.petalRecipePage( + "magicbees.botania.lexicon.hibeescus.crafting", hibeescusRecipe)); + + entryManaApiaryBooster = new BotaniaLexiconEntry("tile.manaAuraProvider.name", BotaniaAPI.categoryDevices); + entryManaApiaryBooster.setLexiconPages( + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.manaBooster.0"), + BotaniaAPI.internalHandler.craftingRecipePage( + "magicbees.botania.lexicon.manaBooster.crafting", BotaniaHelper.manaBoosterRecipe)); + } + + public static LexiconEntry getLexiconEntryForName(String name) { + for (LexiconEntry entry : BotaniaAPI.getAllEntries()) { + if (entry.unlocalizedName.equals(name)) { + return entry; + } + } + return null; + } } diff --git a/src/main/java/magicbees/main/utils/compat/botania/BotaniaLexiconEntry.java b/src/main/java/magicbees/main/utils/compat/botania/BotaniaLexiconEntry.java index 90a6cb1..fb626e4 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/BotaniaLexiconEntry.java +++ b/src/main/java/magicbees/main/utils/compat/botania/BotaniaLexiconEntry.java @@ -8,19 +8,18 @@ import vazkii.botania.api.lexicon.LexiconEntry; public class BotaniaLexiconEntry extends LexiconEntry implements IAddonEntry { - public BotaniaLexiconEntry(String unlocalizedName, LexiconCategory category) { - super(unlocalizedName, category); - BotaniaAPI.addEntry(this, category); - } + public BotaniaLexiconEntry(String unlocalizedName, LexiconCategory category) { + super(unlocalizedName, category); + BotaniaAPI.addEntry(this, category); + } - @Override - public String getSubtitle() { - return LocalizationManager.getLocalizedString("magicbees.botania.lexicon.subtitle"); - } - - @Override - public String getUnlocalizedName() { - return unlocalizedName; - } + @Override + public String getSubtitle() { + return LocalizationManager.getLocalizedString("magicbees.botania.lexicon.subtitle"); + } + @Override + public String getUnlocalizedName() { + return unlocalizedName; + } } diff --git a/src/main/java/magicbees/main/utils/compat/botania/BotaniaSignature.java b/src/main/java/magicbees/main/utils/compat/botania/BotaniaSignature.java index 10debf6..8b1b4c4 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/BotaniaSignature.java +++ b/src/main/java/magicbees/main/utils/compat/botania/BotaniaSignature.java @@ -7,31 +7,30 @@ import vazkii.botania.api.subtile.signature.SubTileSignature; public class BotaniaSignature extends SubTileSignature { - private String name; - IIcon icon; - - public BotaniaSignature(String subtileName) { - this.name = subtileName; - } - - @Override - public IIcon getIconForStack(ItemStack stack) { - return icon; - } + private String name; + IIcon icon; - @Override - public void registerIcons(IIconRegister register) { - icon = register.registerIcon("magicbees:" + name); - } + public BotaniaSignature(String subtileName) { + this.name = subtileName; + } - @Override - public String getUnlocalizedNameForStack(ItemStack stack) { - return "tile.botania:flower." + name; - } + @Override + public IIcon getIconForStack(ItemStack stack) { + return icon; + } - @Override - public String getUnlocalizedLoreTextForStack(ItemStack stack) { - return "tile.botania:flower." + name + ".lore"; - } + @Override + public void registerIcons(IIconRegister register) { + icon = register.registerIcon("magicbees:" + name); + } + @Override + public String getUnlocalizedNameForStack(ItemStack stack) { + return "tile.botania:flower." + name; + } + + @Override + public String getUnlocalizedLoreTextForStack(ItemStack stack) { + return "tile.botania:flower." + name + ".lore"; + } } diff --git a/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeElvenTrade.java b/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeElvenTrade.java index 674df08..f978178 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeElvenTrade.java +++ b/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeElvenTrade.java @@ -1,53 +1,52 @@ package magicbees.main.utils.compat.botania; -import java.util.LinkedList; -import java.util.List; - -import magicbees.bees.BeeManager; -import net.minecraft.item.ItemStack; - -import magicbees.bees.BeeSpecies; -import vazkii.botania.api.recipe.RecipeElvenTrade; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IBee; +import java.util.LinkedList; +import java.util.List; +import magicbees.bees.BeeManager; +import magicbees.bees.BeeSpecies; +import net.minecraft.item.ItemStack; +import vazkii.botania.api.recipe.RecipeElvenTrade; public class SpeciesRecipeElvenTrade extends RecipeElvenTrade { - private IAlleleBeeSpecies inputSpecies; - - public SpeciesRecipeElvenTrade(BeeSpecies inSpecies, BeeSpecies outSpecies) { - super(BeeManager.getDefaultItemStackForSpecies(outSpecies.getSpecies(), EnumBeeType.DRONE), - BeeManager.getDefaultItemStackForSpecies(inSpecies.getSpecies(), EnumBeeType.DRONE)); - inputSpecies = inSpecies.getSpecies(); - } + private IAlleleBeeSpecies inputSpecies; - @Override - public boolean matches(List stacks, boolean removeMatched) { - List matchedStacks = new LinkedList(); - boolean found = false; - - for (ItemStack inStack : stacks) { - if (inStack == null) { - continue; - } - - if (BeeManager.beeRoot.isMember(inStack, EnumBeeType.DRONE.ordinal())) { - IBee bee = BeeManager.beeRoot.getMember(inStack); - if (bee.getGenome().getPrimary().equals(inputSpecies)) { - matchedStacks.add(inStack); - found = true; - break; - } - } - } + public SpeciesRecipeElvenTrade(BeeSpecies inSpecies, BeeSpecies outSpecies) { + super( + BeeManager.getDefaultItemStackForSpecies(outSpecies.getSpecies(), EnumBeeType.DRONE), + BeeManager.getDefaultItemStackForSpecies(inSpecies.getSpecies(), EnumBeeType.DRONE)); + inputSpecies = inSpecies.getSpecies(); + } - if (removeMatched) { - for (ItemStack stack : matchedStacks) { - stacks.remove(stack); - } - } - - return found; - } + @Override + public boolean matches(List stacks, boolean removeMatched) { + List matchedStacks = new LinkedList(); + boolean found = false; + + for (ItemStack inStack : stacks) { + if (inStack == null) { + continue; + } + + if (BeeManager.beeRoot.isMember(inStack, EnumBeeType.DRONE.ordinal())) { + IBee bee = BeeManager.beeRoot.getMember(inStack); + if (bee.getGenome().getPrimary().equals(inputSpecies)) { + matchedStacks.add(inStack); + found = true; + break; + } + } + } + + if (removeMatched) { + for (ItemStack stack : matchedStacks) { + stacks.remove(stack); + } + } + + return found; + } } diff --git a/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeManaInfusion.java b/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeManaInfusion.java index 23cebf0..fed886c 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeManaInfusion.java +++ b/src/main/java/magicbees/main/utils/compat/botania/SpeciesRecipeManaInfusion.java @@ -1,51 +1,53 @@ package magicbees.main.utils.compat.botania; +import forestry.api.apiculture.EnumBeeType; +import forestry.api.apiculture.IAlleleBeeSpecies; +import forestry.api.apiculture.IBee; import magicbees.bees.BeeManager; import magicbees.bees.BeeSpecies; import magicbees.main.utils.compat.ForestryHelper; import net.minecraft.item.ItemStack; import vazkii.botania.api.recipe.RecipeManaInfusion; -import forestry.api.apiculture.EnumBeeType; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBee; public class SpeciesRecipeManaInfusion extends RecipeManaInfusion { - private IAlleleBeeSpecies outputSpecies; - private IAlleleBeeSpecies inputSpecies; - private EnumBeeType beeType; - - private ItemStack outputCache; + private IAlleleBeeSpecies outputSpecies; + private IAlleleBeeSpecies inputSpecies; + private EnumBeeType beeType; - public SpeciesRecipeManaInfusion(BeeSpecies outSpecies, BeeSpecies inSpecies, int mana, EnumBeeType type) { - super(BeeManager.getDefaultItemStackForSpecies(outSpecies.getSpecies(), type), BeeManager.getDefaultItemStackForSpecies(inSpecies.getSpecies(), type), mana); - outputSpecies = outSpecies.getSpecies(); - inputSpecies = inSpecies.getSpecies(); - beeType = type; - outputCache = super.getOutput(); - } - - @Override - public boolean matches(ItemStack stack) { - if (!BeeManager.beeRoot.isMember(stack, beeType.ordinal())) { - return false; - } - - IBee bee = BeeManager.beeRoot.getMember(stack); - if (bee.getGenome().getPrimary().equals(inputSpecies)) { - outputCache = ForestryHelper.replaceSpecies(stack, outputSpecies); - outputCache.stackSize = 1; - return true; - } + private ItemStack outputCache; - return false; - } - - @Override - public ItemStack getOutput() { - ItemStack currentOutput = outputCache; - outputCache = super.getOutput(); - return currentOutput; - } + public SpeciesRecipeManaInfusion(BeeSpecies outSpecies, BeeSpecies inSpecies, int mana, EnumBeeType type) { + super( + BeeManager.getDefaultItemStackForSpecies(outSpecies.getSpecies(), type), + BeeManager.getDefaultItemStackForSpecies(inSpecies.getSpecies(), type), + mana); + outputSpecies = outSpecies.getSpecies(); + inputSpecies = inSpecies.getSpecies(); + beeType = type; + outputCache = super.getOutput(); + } + @Override + public boolean matches(ItemStack stack) { + if (!BeeManager.beeRoot.isMember(stack, beeType.ordinal())) { + return false; + } + + IBee bee = BeeManager.beeRoot.getMember(stack); + if (bee.getGenome().getPrimary().equals(inputSpecies)) { + outputCache = ForestryHelper.replaceSpecies(stack, outputSpecies); + outputCache.stackSize = 1; + return true; + } + + return false; + } + + @Override + public ItemStack getOutput() { + ItemStack currentOutput = outputCache; + outputCache = super.getOutput(); + return currentOutput; + } } diff --git a/src/main/java/magicbees/main/utils/compat/botania/SubTileBeegonia.java b/src/main/java/magicbees/main/utils/compat/botania/SubTileBeegonia.java index 61a6631..4ca72fe 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/SubTileBeegonia.java +++ b/src/main/java/magicbees/main/utils/compat/botania/SubTileBeegonia.java @@ -1,7 +1,10 @@ package magicbees.main.utils.compat.botania; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.apiculture.IAlleleBeeSpecies; +import forestry.api.apiculture.IBee; import java.util.List; - import magicbees.bees.BeeManager; import magicbees.main.utils.compat.BotaniaHelper; import net.minecraft.entity.item.EntityItem; @@ -11,127 +14,138 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.subtile.SubTileGenerating; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBee; public class SubTileBeegonia extends SubTileGenerating { - - public static final String NAME = "beegonia"; - - private static final int DRONE_BURN_TIME_BASE = 100; - private static final int ITEM_STACK_AGE_THRESHOLD = 60; - private static final int RANGE = 3; - - private int burnTimeLeft = 0; - - private void searchForDroneStack() { - if (!supertile.getWorldObj().isRemote && mana < getMaxMana()) { - boolean needsSync = false; - - @SuppressWarnings("unchecked") - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, - AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, - supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); - for (EntityItem item : items) { - if (item.age >= ITEM_STACK_AGE_THRESHOLD && !item.isDead) { - ItemStack stack = item.getEntityItem(); - if (BeeManager.beeRoot.isDrone(stack)) { - IBee bee = BeeManager.beeRoot.getMember(stack); - - if (stack.stackSize > 0) { - stack.stackSize--; - burnTimeLeft = (int)(DRONE_BURN_TIME_BASE * getSpeciesScaledComplexity(bee.getGenome().getPrimary()) * BotaniaHelper.beegoniaManaMultiplier); - needsSync = true; - - supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:endoflame", 0.2F, 1F); - } - - if (stack.stackSize <= 0) { - item.setDead(); - } - } - } - } - - if (needsSync) { - sync(); - } - } - } - - private int getSpeciesScaledComplexity(IAlleleBeeSpecies species) { - if (species == null) { - return 0; - } - else { - try { - int halfComplexity = species.getComplexity() / 2; - return (halfComplexity >= 1) ? halfComplexity : 1; - } - catch (NoSuchMethodError error) { - return 1; - } - } - } - - @Override - public void onUpdate() { - super.onUpdate(); - - if (linkedCollector != null) { - if (burnTimeLeft > 0) { - burnTimeLeft--; - } - else { - searchForDroneStack(); - } - } - } - @Override - public void readFromPacketNBT(NBTTagCompound cmp) { - super.readFromPacketNBT(cmp); - - burnTimeLeft = cmp.getInteger("burnTimeLeft"); - } + public static final String NAME = "beegonia"; - @Override - public void writeToPacketNBT(NBTTagCompound cmp) { - super.writeToPacketNBT(cmp); - - cmp.setInteger("burnTimeLeft", burnTimeLeft); - } + private static final int DRONE_BURN_TIME_BASE = 100; + private static final int ITEM_STACK_AGE_THRESHOLD = 60; + private static final int RANGE = 3; - @Override - public int getMaxMana() { - return 600; - } + private int burnTimeLeft = 0; - @Override - public int getValueForPassiveGeneration() { - return 1; - } + private void searchForDroneStack() { + if (!supertile.getWorldObj().isRemote && mana < getMaxMana()) { + boolean needsSync = false; - @Override - public boolean canGeneratePassively() { - return burnTimeLeft > 0; - } + @SuppressWarnings("unchecked") + List items = supertile + .getWorldObj() + .getEntitiesWithinAABB( + EntityItem.class, + AxisAlignedBB.getBoundingBox( + supertile.xCoord - RANGE, + supertile.yCoord - RANGE, + supertile.zCoord - RANGE, + supertile.xCoord + RANGE + 1, + supertile.yCoord + RANGE + 1, + supertile.zCoord + RANGE + 1)); + for (EntityItem item : items) { + if (item.age >= ITEM_STACK_AGE_THRESHOLD && !item.isDead) { + ItemStack stack = item.getEntityItem(); + if (BeeManager.beeRoot.isDrone(stack)) { + IBee bee = BeeManager.beeRoot.getMember(stack); - @Override - public int getDelayBetweenPassiveGeneration() { - return 1; - } - - @Override - public int getColor() { - return 0xFFFF96; - } + if (stack.stackSize > 0) { + stack.stackSize--; + burnTimeLeft = (int) (DRONE_BURN_TIME_BASE + * getSpeciesScaledComplexity(bee.getGenome().getPrimary()) + * BotaniaHelper.beegoniaManaMultiplier); + needsSync = true; - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon() { - return BotaniaAPI.getSignatureForName(NAME).getIconForStack(null); - } + supertile + .getWorldObj() + .playSoundEffect( + supertile.xCoord, + supertile.yCoord, + supertile.zCoord, + "botania:endoflame", + 0.2F, + 1F); + } + + if (stack.stackSize <= 0) { + item.setDead(); + } + } + } + } + + if (needsSync) { + sync(); + } + } + } + + private int getSpeciesScaledComplexity(IAlleleBeeSpecies species) { + if (species == null) { + return 0; + } else { + try { + int halfComplexity = species.getComplexity() / 2; + return (halfComplexity >= 1) ? halfComplexity : 1; + } catch (NoSuchMethodError error) { + return 1; + } + } + } + + @Override + public void onUpdate() { + super.onUpdate(); + + if (linkedCollector != null) { + if (burnTimeLeft > 0) { + burnTimeLeft--; + } else { + searchForDroneStack(); + } + } + } + + @Override + public void readFromPacketNBT(NBTTagCompound cmp) { + super.readFromPacketNBT(cmp); + + burnTimeLeft = cmp.getInteger("burnTimeLeft"); + } + + @Override + public void writeToPacketNBT(NBTTagCompound cmp) { + super.writeToPacketNBT(cmp); + + cmp.setInteger("burnTimeLeft", burnTimeLeft); + } + + @Override + public int getMaxMana() { + return 600; + } + + @Override + public int getValueForPassiveGeneration() { + return 1; + } + + @Override + public boolean canGeneratePassively() { + return burnTimeLeft > 0; + } + + @Override + public int getDelayBetweenPassiveGeneration() { + return 1; + } + + @Override + public int getColor() { + return 0xFFFF96; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon() { + return BotaniaAPI.getSignatureForName(NAME).getIconForStack(null); + } } diff --git a/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java b/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java index 50d8726..a57fab0 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java +++ b/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java @@ -1,191 +1,196 @@ package magicbees.main.utils.compat.botania; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.apiculture.EnumBeeType; +import forestry.api.apiculture.IBee; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; import magicbees.bees.BeeManager; import magicbees.main.utils.compat.BotaniaHelper; import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; -import net.minecraft.world.World; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.subtile.SubTileFunctional; -import forestry.api.apiculture.EnumBeeType; -import forestry.api.apiculture.IBee; public class SubTileHibeescus extends SubTileFunctional { - - public static final String NAME = "hibeescus"; - private final int MANA_PER_OPERATION = 10000; - // Ticks per second * seconds per minute * real-time minutes - private final int OPERATION_TICKS_TIME = 20 * 60 * 15; - private final double RANGE = 0.75; - - private ItemStack beeSlot; - private long operationTicksRemaining; - private float manaCostRollover; - @Override - public int getColor() { - return 0xF94F4F; - } + public static final String NAME = "hibeescus"; + private final int MANA_PER_OPERATION = 10000; + // Ticks per second * seconds per minute * real-time minutes + private final int OPERATION_TICKS_TIME = 20 * 60 * 15; + private final double RANGE = 0.75; - @Override - public void onUpdate() { - super.onUpdate(); - if (supertile.getWorldObj().isRemote) { - return; - } - - if (beeSlot != null) { - progressOperation(); - } - else if (beeSlot == null && isTimeToPickUpItem() && redstoneSignal == 0) { - findBeeItemToHold(); - } - } + private ItemStack beeSlot; + private long operationTicksRemaining; + private float manaCostRollover; - protected boolean isTimeToPickUpItem() { - return (this.supertile.getWorldObj().getTotalWorldTime() ^ supertile.xCoord ^ supertile.zCoord) % 11 == 0; - } - - private void progressOperation() { - if (0 < operationTicksRemaining && 0 < this.mana) { - operationTicksRemaining--; - manaCostRollover += getManaPerOpTick(); - if (1f <= manaCostRollover) { - int amount = (int)manaCostRollover; - mana -= amount; - manaCostRollover -= amount; - } - } - else if (operationTicksRemaining <= 0) { - IBee bee = BeeManager.beeRoot.getMember(beeSlot); - bee.setIsNatural(true); - EnumBeeType beeType = EnumBeeType.QUEEN; - if (bee.getMate() == null) { - beeType = EnumBeeType.PRINCESS; - } - ItemStack outputStack = BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal()); - EntityItem entity = dropItemStackInRange(outputStack); - - supertile.getWorldObj().spawnEntityInWorld(entity); - beeSlot = null; - } - } + @Override + public int getColor() { + return 0xF94F4F; + } - protected EntityItem dropItemStackInRange(ItemStack outputStack) { - Random r = supertile.getWorldObj().rand; - EntityItem entity = new EntityItem(supertile.getWorldObj(), - supertile.xCoord - RANGE + r.nextInt((int)(RANGE * 2 + 1)), supertile.yCoord + 1, supertile.zCoord - RANGE + r.nextInt((int)(RANGE * 2 + 1)), - outputStack); - entity.motionX = 0; - entity.motionY = 0; - entity.motionZ = 0; - return entity; - } - - private void findBeeItemToHold() { - @SuppressWarnings("unchecked") - List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, getSearchBoundingBox()); - - for (EntityItem itemEntity : items) { - ItemStack item = itemEntity.getEntityItem(); - if (!itemEntity.isDead && isItemPrincessOrQueen(item)) { - beeSlot = itemEntity.getEntityItem().copy(); - beeSlot.stackSize = 1; - operationTicksRemaining = (long)(OPERATION_TICKS_TIME * BotaniaHelper.hibeescusTicksMultiplier) + supertile.getWorldObj().rand.nextInt(200); - manaCostRollover = 0f; - - // Princesses and Queens don't stack, but YOU NEVER KNOW. - item.stackSize -= 1; - if (item.stackSize <= 0) { - itemEntity.setDead(); - } - - // Leave for loop - break; - } - } - } + @Override + public void onUpdate() { + super.onUpdate(); + if (supertile.getWorldObj().isRemote) { + return; + } - private boolean isItemPrincessOrQueen(ItemStack stack) { - boolean isBee = BeeManager.beeRoot.isMember(stack, EnumBeeType.PRINCESS.ordinal()) - || BeeManager.beeRoot.isMember(stack, EnumBeeType.QUEEN.ordinal()); - if (isBee) { - IBee bee = BeeManager.beeRoot.getMember(stack); - // Only process Ignoble bees. - if (!bee.isNatural()) { - return true; - } - } - return false; - } - - private AxisAlignedBB getSearchBoundingBox() { - return AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, - supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1); - } + if (beeSlot != null) { + progressOperation(); + } else if (beeSlot == null && isTimeToPickUpItem() && redstoneSignal == 0) { + findBeeItemToHold(); + } + } - @Override - public void readFromPacketNBT(NBTTagCompound cmp) { - super.readFromPacketNBT(cmp); - if (cmp.hasKey("slot")) { - NBTTagCompound itemTag = (NBTTagCompound)cmp.getTag("slot"); - beeSlot = ItemStack.loadItemStackFromNBT(itemTag); - } - operationTicksRemaining = cmp.getLong("operationTicks"); - manaCostRollover = cmp.getFloat("manaRollover"); - } + protected boolean isTimeToPickUpItem() { + return (this.supertile.getWorldObj().getTotalWorldTime() ^ supertile.xCoord ^ supertile.zCoord) % 11 == 0; + } - @Override - public void writeToPacketNBT(NBTTagCompound cmp) { - super.writeToPacketNBT(cmp); - if (beeSlot != null) { - NBTTagCompound itemTag = new NBTTagCompound(); - beeSlot.writeToNBT(itemTag); - cmp.setTag("slot", itemTag); - } - cmp.setLong("operationTicks", operationTicksRemaining); - cmp.setFloat("manaRollover", manaCostRollover); - } + private void progressOperation() { + if (0 < operationTicksRemaining && 0 < this.mana) { + operationTicksRemaining--; + manaCostRollover += getManaPerOpTick(); + if (1f <= manaCostRollover) { + int amount = (int) manaCostRollover; + mana -= amount; + manaCostRollover -= amount; + } + } else if (operationTicksRemaining <= 0) { + IBee bee = BeeManager.beeRoot.getMember(beeSlot); + bee.setIsNatural(true); + EnumBeeType beeType = EnumBeeType.QUEEN; + if (bee.getMate() == null) { + beeType = EnumBeeType.PRINCESS; + } + ItemStack outputStack = BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal()); + EntityItem entity = dropItemStackInRange(outputStack); - @Override - public ArrayList getDrops(ArrayList list) { - if (beeSlot != null) { - list.add(beeSlot); - } - return super.getDrops(list); - } + supertile.getWorldObj().spawnEntityInWorld(entity); + beeSlot = null; + } + } - @Override - public int getMaxMana() { - return getFinalOperationManaCost() / 20; - } + protected EntityItem dropItemStackInRange(ItemStack outputStack) { + Random r = supertile.getWorldObj().rand; + EntityItem entity = new EntityItem( + supertile.getWorldObj(), + supertile.xCoord - RANGE + r.nextInt((int) (RANGE * 2 + 1)), + supertile.yCoord + 1, + supertile.zCoord - RANGE + r.nextInt((int) (RANGE * 2 + 1)), + outputStack); + entity.motionX = 0; + entity.motionY = 0; + entity.motionZ = 0; + return entity; + } - protected int getFinalOperationManaCost() { - return (int)(MANA_PER_OPERATION * BotaniaHelper.hibeescusManaCostMultiplier); - } - - protected float getManaPerOpTick() { - return getFinalOperationManaCost() / OPERATION_TICKS_TIME; - } + private void findBeeItemToHold() { + @SuppressWarnings("unchecked") + List items = + supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, getSearchBoundingBox()); - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon() { - return BotaniaAPI.getSignatureForName(NAME).getIconForStack(null); - } + for (EntityItem itemEntity : items) { + ItemStack item = itemEntity.getEntityItem(); + if (!itemEntity.isDead && isItemPrincessOrQueen(item)) { + beeSlot = itemEntity.getEntityItem().copy(); + beeSlot.stackSize = 1; + operationTicksRemaining = (long) (OPERATION_TICKS_TIME * BotaniaHelper.hibeescusTicksMultiplier) + + supertile.getWorldObj().rand.nextInt(200); + manaCostRollover = 0f; - @Override - public boolean acceptsRedstone() { - return true; - } + // Princesses and Queens don't stack, but YOU NEVER KNOW. + item.stackSize -= 1; + if (item.stackSize <= 0) { + itemEntity.setDead(); + } + + // Leave for loop + break; + } + } + } + + private boolean isItemPrincessOrQueen(ItemStack stack) { + boolean isBee = BeeManager.beeRoot.isMember(stack, EnumBeeType.PRINCESS.ordinal()) + || BeeManager.beeRoot.isMember(stack, EnumBeeType.QUEEN.ordinal()); + if (isBee) { + IBee bee = BeeManager.beeRoot.getMember(stack); + // Only process Ignoble bees. + if (!bee.isNatural()) { + return true; + } + } + return false; + } + + private AxisAlignedBB getSearchBoundingBox() { + return AxisAlignedBB.getBoundingBox( + supertile.xCoord - RANGE, + supertile.yCoord, + supertile.zCoord - RANGE, + supertile.xCoord + RANGE + 1, + supertile.yCoord + 1, + supertile.zCoord + RANGE + 1); + } + + @Override + public void readFromPacketNBT(NBTTagCompound cmp) { + super.readFromPacketNBT(cmp); + if (cmp.hasKey("slot")) { + NBTTagCompound itemTag = (NBTTagCompound) cmp.getTag("slot"); + beeSlot = ItemStack.loadItemStackFromNBT(itemTag); + } + operationTicksRemaining = cmp.getLong("operationTicks"); + manaCostRollover = cmp.getFloat("manaRollover"); + } + + @Override + public void writeToPacketNBT(NBTTagCompound cmp) { + super.writeToPacketNBT(cmp); + if (beeSlot != null) { + NBTTagCompound itemTag = new NBTTagCompound(); + beeSlot.writeToNBT(itemTag); + cmp.setTag("slot", itemTag); + } + cmp.setLong("operationTicks", operationTicksRemaining); + cmp.setFloat("manaRollover", manaCostRollover); + } + + @Override + public ArrayList getDrops(ArrayList list) { + if (beeSlot != null) { + list.add(beeSlot); + } + return super.getDrops(list); + } + + @Override + public int getMaxMana() { + return getFinalOperationManaCost() / 20; + } + + protected int getFinalOperationManaCost() { + return (int) (MANA_PER_OPERATION * BotaniaHelper.hibeescusManaCostMultiplier); + } + + protected float getManaPerOpTick() { + return getFinalOperationManaCost() / OPERATION_TICKS_TIME; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon() { + return BotaniaAPI.getSignatureForName(NAME).getIconForStack(null); + } + + @Override + public boolean acceptsRedstone() { + return true; + } } diff --git a/src/main/java/magicbees/main/utils/compat/botania/SubTileHiveacynth.java b/src/main/java/magicbees/main/utils/compat/botania/SubTileHiveacynth.java index d478358..38d2ce7 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/SubTileHiveacynth.java +++ b/src/main/java/magicbees/main/utils/compat/botania/SubTileHiveacynth.java @@ -1,7 +1,10 @@ package magicbees.main.utils.compat.botania; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.apiculture.EnumBeeType; +import forestry.api.apiculture.IBee; import java.util.Random; - import magicbees.bees.BeeManager; import magicbees.main.utils.compat.BotaniaHelper; import net.minecraft.entity.item.EntityItem; @@ -9,77 +12,77 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.subtile.SubTileFunctional; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.apiculture.EnumBeeType; -import forestry.api.apiculture.IBee; public class SubTileHiveacynth extends SubTileFunctional { - - public static final String NAME = "hiveacynth"; - private static final int RANGE = 3; - private static final int COST = 15000; - @Override - public void onUpdate() { - super.onUpdate(); - if (supertile.getWorldObj().isRemote) { - return; - } - - if (readyToProduceProduct()) { - mana -= getFinalCost(); - Random r = supertile.getWorldObj().rand; - EnumBeeType beeType = EnumBeeType.DRONE; - - IBee bee = BeeManager.getBeeFromSpecies(BeeManager.getRandomWorldgenSpecies(r), r.nextDouble() < BotaniaHelper.hiveacynthRainResistRate); - - if (r.nextDouble() < BotaniaHelper.hiveacynthPrincessSpawnRate) { - beeType = EnumBeeType.PRINCESS; - - if (BotaniaHelper.hiveacynthPristineRate < r.nextDouble()) { - bee.setIsNatural(false); - } - } + public static final String NAME = "hiveacynth"; + private static final int RANGE = 3; + private static final int COST = 15000; - ItemStack stack = BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal()); - - EntityItem entity = new EntityItem(supertile.getWorldObj(), - supertile.xCoord - RANGE + r.nextInt(RANGE * 2 + 1), supertile.yCoord + 1, supertile.zCoord - RANGE + r.nextInt(RANGE * 2 + 1), stack); - entity.motionX = 0; - entity.motionY = 0; - entity.motionZ = 0; - supertile.getWorldObj().spawnEntityInWorld(entity); - } - } + @Override + public void onUpdate() { + super.onUpdate(); + if (supertile.getWorldObj().isRemote) { + return; + } - private boolean readyToProduceProduct() { - return redstoneSignal == 0 && ticksExisted % 200 == 0 && mana >= getFinalCost(); - } - - private int getFinalCost() { - return (int)(COST * BotaniaHelper.hiveacynthManaMultiplier); - } + if (readyToProduceProduct()) { + mana -= getFinalCost(); + Random r = supertile.getWorldObj().rand; + EnumBeeType beeType = EnumBeeType.DRONE; - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon() { - return BotaniaAPI.getSignatureForName(NAME).getIconForStack(null); - } - - @Override - public boolean acceptsRedstone() { - return true; - } + IBee bee = BeeManager.getBeeFromSpecies( + BeeManager.getRandomWorldgenSpecies(r), r.nextDouble() < BotaniaHelper.hiveacynthRainResistRate); - @Override - public int getColor() { - return 0x0071C6; - } + if (r.nextDouble() < BotaniaHelper.hiveacynthPrincessSpawnRate) { + beeType = EnumBeeType.PRINCESS; - @Override - public int getMaxMana() { - return getFinalCost(); - } + if (BotaniaHelper.hiveacynthPristineRate < r.nextDouble()) { + bee.setIsNatural(false); + } + } + ItemStack stack = BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal()); + + EntityItem entity = new EntityItem( + supertile.getWorldObj(), + supertile.xCoord - RANGE + r.nextInt(RANGE * 2 + 1), + supertile.yCoord + 1, + supertile.zCoord - RANGE + r.nextInt(RANGE * 2 + 1), + stack); + entity.motionX = 0; + entity.motionY = 0; + entity.motionZ = 0; + supertile.getWorldObj().spawnEntityInWorld(entity); + } + } + + private boolean readyToProduceProduct() { + return redstoneSignal == 0 && ticksExisted % 200 == 0 && mana >= getFinalCost(); + } + + private int getFinalCost() { + return (int) (COST * BotaniaHelper.hiveacynthManaMultiplier); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon() { + return BotaniaAPI.getSignatureForName(NAME).getIconForStack(null); + } + + @Override + public boolean acceptsRedstone() { + return true; + } + + @Override + public int getColor() { + return 0x0071C6; + } + + @Override + public int getMaxMana() { + return getFinalCost(); + } } diff --git a/src/main/java/magicbees/main/utils/compat/thaumcraft/NodeHelper.java b/src/main/java/magicbees/main/utils/compat/thaumcraft/NodeHelper.java index c4d40df..22f515a 100644 --- a/src/main/java/magicbees/main/utils/compat/thaumcraft/NodeHelper.java +++ b/src/main/java/magicbees/main/utils/compat/thaumcraft/NodeHelper.java @@ -6,7 +6,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; - import magicbees.main.Config; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Vec3; @@ -21,43 +20,44 @@ import thaumcraft.api.nodes.NodeType; public class NodeHelper { - private static Map conversionChances; + private static Map conversionChances; - static { - conversionChances = new HashMap(); - conversionChances.put(NodeType.NORMAL, 0.075f); - conversionChances.put(NodeType.TAINTED, 0.057f); - conversionChances.put(NodeType.PURE, 0.035f); - conversionChances.put(NodeType.HUNGRY, 0.0094f); - } + static { + conversionChances = new HashMap(); + conversionChances.put(NodeType.NORMAL, 0.075f); + conversionChances.put(NodeType.TAINTED, 0.057f); + conversionChances.put(NodeType.PURE, 0.035f); + conversionChances.put(NodeType.HUNGRY, 0.0094f); + } - @SuppressWarnings("unchecked") - public static INode findNode(Chunk chunk, int x, int y, int z, int range) { - if (chunk == null) - return null; + @SuppressWarnings("unchecked") + public static INode findNode(Chunk chunk, int x, int y, int z, int range) { + if (chunk == null) return null; - Vec3 apiaryPos = Vec3.createVectorHelper(x, y, z); - List tileEntities = new ArrayList(((Map)chunk.chunkTileEntityMap).values()); - Collections.shuffle(tileEntities); - for (TileEntity entity : tileEntities) { - if (entity instanceof INode) { - Vec3 tePos = Vec3.createVectorHelper(entity.xCoord, entity.yCoord, entity.zCoord); - Vec3 result = apiaryPos.subtract(tePos); - if (result.lengthVector() <= range) { - return (INode)entity; - } - } - } + Vec3 apiaryPos = Vec3.createVectorHelper(x, y, z); + List tileEntities = + new ArrayList(((Map) chunk.chunkTileEntityMap).values()); + Collections.shuffle(tileEntities); + for (TileEntity entity : tileEntities) { + if (entity instanceof INode) { + Vec3 tePos = Vec3.createVectorHelper(entity.xCoord, entity.yCoord, entity.zCoord); + Vec3 result = apiaryPos.subtract(tePos); + if (result.lengthVector() <= range) { + return (INode) entity; + } + } + } - return null; - } + return null; + } - @SuppressWarnings("unchecked") - public static List findNodesInChunkWithinRange(Chunk chunk, int x, int y, int z, int range) { - List nodes = new ArrayList(); - if (chunk != null) { + @SuppressWarnings("unchecked") + public static List findNodesInChunkWithinRange(Chunk chunk, int x, int y, int z, int range) { + List nodes = new ArrayList(); + if (chunk != null) { Vec3 apiaryPos = Vec3.createVectorHelper(x, y, z); - List tileEntities = new ArrayList(((Map) chunk.chunkTileEntityMap).values()); + List tileEntities = + new ArrayList(((Map) chunk.chunkTileEntityMap).values()); for (TileEntity entity : tileEntities) { if (entity instanceof INode) { Vec3 tePos = Vec3.createVectorHelper(entity.xCoord, entity.yCoord, entity.zCoord); @@ -69,181 +69,178 @@ public class NodeHelper { } } - return nodes; - } + return nodes; + } - public static boolean rechargeNodeInRange(List chunks, World world, int xCoord, int yCoord, int zCoord, int range) { - Collections.shuffle(chunks); - for (Chunk chunk : chunks) { - INode nearestNode = findNode(chunk, xCoord, yCoord, zCoord, range); - boolean nodeChanged = false; - if (nearestNode != null) { - AspectList baseAspects = nearestNode.getAspectsBase().copy(); - AspectList currentAspects = nearestNode.getAspects().copy(); - for (Aspect aspect : nearestNode.getAspects().getAspects()) { - int diff = baseAspects.getAmount(aspect) - currentAspects.getAmount(aspect); - if (1 < diff) { - nearestNode.addToContainer(aspect, world.rand.nextInt(diff - 1) + 1); - nodeChanged = true; - } - else if (diff == 1) { - nearestNode.addToContainer(aspect, 1); - nodeChanged = true; - } - } - if (nodeChanged) { - updateNode(nearestNode, world); - } - return true; - } - } - return false; - } - - public static boolean growNodeInRange(List chunks, World world, int xCoord, int yCoord, int zCoord, int range) { - Collections.shuffle(chunks); - int attemptedNodes = 0; - for (Chunk chunk : chunks) { - for (INode node : findNodesInChunkWithinRange(chunk, xCoord, yCoord, zCoord, range)) { - if (node != null) { - ++attemptedNodes; - AspectList aspectsBase = node.getAspectsBase(); - int randBase = Math.max(aspectsBase.visSize(), 1); - if (world.rand.nextInt(randBase) < 120) { - Aspect aspectToAdd; - int rollAttempts = 0; - do { - aspectToAdd = getWeightedRandomAspect(world.rand); - ++rollAttempts; - } - while (aspectsBase.getAmount(aspectToAdd) > (Config.thaumcraftNodeMaxSize -1) && rollAttempts < 20); - - if (20 <= rollAttempts) { - return false; - } - - short amount = (short)(1 + world.rand.nextInt(2)); - aspectsBase.add(aspectToAdd, amount); - node.getAspects().add(aspectToAdd, amount); - updateNode(node, world); - return true; - } - } - } - } - return attemptedNodes < 10; - } - - public static Aspect getWeightedRandomAspect(Random rand) { - Aspect aspectToAdd; - if (0.685f <= rand.nextFloat()) { - List aspects = new ArrayList(Aspect.aspects.values()); - aspectToAdd = aspects.get(rand.nextInt(aspects.size())); - } - else { - switch (rand.nextInt(6)) { - default: - case 0: - aspectToAdd = Aspect.EARTH; - break; - case 1: - aspectToAdd = Aspect.WATER; - break; - case 2: - aspectToAdd = Aspect.FIRE; - break; - case 3: - aspectToAdd = Aspect.AIR; - break; - case 4: - aspectToAdd = Aspect.ORDER; - break; - case 5: - aspectToAdd = Aspect.ENTROPY; - break; - } - } - return aspectToAdd; - } - - public static boolean repairNodeInRange(List chunks, World world, int xCoord, int yCoord, int zCoord, int range) { - Collections.shuffle(chunks); - for (Chunk chunk : chunks) { - INode node = findNode(chunk, xCoord, yCoord, zCoord, range); - if (node != null) { - boolean nodeChanged = false; - if (node.getNodeType() == NodeType.UNSTABLE) { - node.setNodeType(NodeType.NORMAL); - nodeChanged = true; - } - else { - NodeModifier modifier = node.getNodeModifier(); - if (modifier == NodeModifier.FADING) { - node.setNodeModifier(NodeModifier.PALE); - nodeChanged = true; - } - else if (modifier == NodeModifier.PALE) { - if (world.rand.nextFloat() < 0.65f) { - node.setNodeModifier(null); - nodeChanged = true; - } - } - else if (modifier == null) { - if (world.rand.nextFloat() < 0.15f) { - node.setNodeModifier(NodeModifier.BRIGHT); - nodeChanged = true; - } - } - } - - if (nodeChanged) { - updateNode(node, world); - return true; - } - } - } - return true; - } - - public static void updateNode(INode nearestNode, World world) { - if (nearestNode instanceof TileEntity) { - TileEntity tile = (TileEntity)nearestNode; - tile.markDirty(); - world.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); + public static boolean rechargeNodeInRange( + List chunks, World world, int xCoord, int yCoord, int zCoord, int range) { + Collections.shuffle(chunks); + for (Chunk chunk : chunks) { + INode nearestNode = findNode(chunk, xCoord, yCoord, zCoord, range); + boolean nodeChanged = false; + if (nearestNode != null) { + AspectList baseAspects = nearestNode.getAspectsBase().copy(); + AspectList currentAspects = nearestNode.getAspects().copy(); + for (Aspect aspect : nearestNode.getAspects().getAspects()) { + int diff = baseAspects.getAmount(aspect) - currentAspects.getAmount(aspect); + if (1 < diff) { + nearestNode.addToContainer(aspect, world.rand.nextInt(diff - 1) + 1); + nodeChanged = true; + } else if (diff == 1) { + nearestNode.addToContainer(aspect, 1); + nodeChanged = true; + } + } + if (nodeChanged) { + updateNode(nearestNode, world); + } + return true; + } } - } + return false; + } - public static boolean convertNodeInRangeToType(List chunks, World world, int xCoord, int yCoord, int zCoord, int range, NodeType targetType) { - Collections.shuffle(chunks); - int attemptedNodes = 0; - boolean nodeChanged = false; - for (Chunk chunk : chunks) { - for (INode node : findNodesInChunkWithinRange(chunk, xCoord, yCoord, zCoord, range)) { - ++attemptedNodes; - NodeType nodeType = node.getNodeType(); - if (nodeType != targetType && nodeType != NodeType.NORMAL) { - convertNodeToType(node, world, NodeType.NORMAL); - } - else if (nodeType == NodeType.NORMAL) { - convertNodeToType(node, world, targetType); - } + public static boolean growNodeInRange( + List chunks, World world, int xCoord, int yCoord, int zCoord, int range) { + Collections.shuffle(chunks); + int attemptedNodes = 0; + for (Chunk chunk : chunks) { + for (INode node : findNodesInChunkWithinRange(chunk, xCoord, yCoord, zCoord, range)) { + if (node != null) { + ++attemptedNodes; + AspectList aspectsBase = node.getAspectsBase(); + int randBase = Math.max(aspectsBase.visSize(), 1); + if (world.rand.nextInt(randBase) < 120) { + Aspect aspectToAdd; + int rollAttempts = 0; + do { + aspectToAdd = getWeightedRandomAspect(world.rand); + ++rollAttempts; + } while (aspectsBase.getAmount(aspectToAdd) > (Config.thaumcraftNodeMaxSize - 1) + && rollAttempts < 20); - if (nodeChanged) { - updateNode(node, world); - return true; - } - } - } - return attemptedNodes < 10; - } + if (20 <= rollAttempts) { + return false; + } - public static boolean convertNodeToType(INode node, World world, NodeType type) { - if (world.rand.nextFloat() < conversionChances.get(type)) { - node.setNodeType(type); - return true; - } - else { - return false; - } - } + short amount = (short) (1 + world.rand.nextInt(2)); + aspectsBase.add(aspectToAdd, amount); + node.getAspects().add(aspectToAdd, amount); + updateNode(node, world); + return true; + } + } + } + } + return attemptedNodes < 10; + } + + public static Aspect getWeightedRandomAspect(Random rand) { + Aspect aspectToAdd; + if (0.685f <= rand.nextFloat()) { + List aspects = new ArrayList(Aspect.aspects.values()); + aspectToAdd = aspects.get(rand.nextInt(aspects.size())); + } else { + switch (rand.nextInt(6)) { + default: + case 0: + aspectToAdd = Aspect.EARTH; + break; + case 1: + aspectToAdd = Aspect.WATER; + break; + case 2: + aspectToAdd = Aspect.FIRE; + break; + case 3: + aspectToAdd = Aspect.AIR; + break; + case 4: + aspectToAdd = Aspect.ORDER; + break; + case 5: + aspectToAdd = Aspect.ENTROPY; + break; + } + } + return aspectToAdd; + } + + public static boolean repairNodeInRange( + List chunks, World world, int xCoord, int yCoord, int zCoord, int range) { + Collections.shuffle(chunks); + for (Chunk chunk : chunks) { + INode node = findNode(chunk, xCoord, yCoord, zCoord, range); + if (node != null) { + boolean nodeChanged = false; + if (node.getNodeType() == NodeType.UNSTABLE) { + node.setNodeType(NodeType.NORMAL); + nodeChanged = true; + } else { + NodeModifier modifier = node.getNodeModifier(); + if (modifier == NodeModifier.FADING) { + node.setNodeModifier(NodeModifier.PALE); + nodeChanged = true; + } else if (modifier == NodeModifier.PALE) { + if (world.rand.nextFloat() < 0.65f) { + node.setNodeModifier(null); + nodeChanged = true; + } + } else if (modifier == null) { + if (world.rand.nextFloat() < 0.15f) { + node.setNodeModifier(NodeModifier.BRIGHT); + nodeChanged = true; + } + } + } + + if (nodeChanged) { + updateNode(node, world); + return true; + } + } + } + return true; + } + + public static void updateNode(INode nearestNode, World world) { + if (nearestNode instanceof TileEntity) { + TileEntity tile = (TileEntity) nearestNode; + tile.markDirty(); + world.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord); + } + } + + public static boolean convertNodeInRangeToType( + List chunks, World world, int xCoord, int yCoord, int zCoord, int range, NodeType targetType) { + Collections.shuffle(chunks); + int attemptedNodes = 0; + boolean nodeChanged = false; + for (Chunk chunk : chunks) { + for (INode node : findNodesInChunkWithinRange(chunk, xCoord, yCoord, zCoord, range)) { + ++attemptedNodes; + NodeType nodeType = node.getNodeType(); + if (nodeType != targetType && nodeType != NodeType.NORMAL) { + convertNodeToType(node, world, NodeType.NORMAL); + } else if (nodeType == NodeType.NORMAL) { + convertNodeToType(node, world, targetType); + } + + if (nodeChanged) { + updateNode(node, world); + return true; + } + } + } + return attemptedNodes < 10; + } + + public static boolean convertNodeToType(INode node, World world, NodeType type) { + if (world.rand.nextFloat() < conversionChances.get(type)) { + node.setNodeType(type); + return true; + } else { + return false; + } + } } diff --git a/src/main/java/magicbees/main/utils/error/InvalidEventTypeIndexException.java b/src/main/java/magicbees/main/utils/error/InvalidEventTypeIndexException.java index 4ae735b..db60bae 100644 --- a/src/main/java/magicbees/main/utils/error/InvalidEventTypeIndexException.java +++ b/src/main/java/magicbees/main/utils/error/InvalidEventTypeIndexException.java @@ -1,13 +1,13 @@ package magicbees.main.utils.error; public class InvalidEventTypeIndexException extends RuntimeException { - private static final long serialVersionUID = 8920019214439088440L; + private static final long serialVersionUID = 8920019214439088440L; - public InvalidEventTypeIndexException(String message) { - this(message, null); - } - - public InvalidEventTypeIndexException(String message, Throwable cause) { - super(message, cause); - } + public InvalidEventTypeIndexException(String message) { + this(message, null); + } + + public InvalidEventTypeIndexException(String message, Throwable cause) { + super(message, cause); + } } diff --git a/src/main/java/magicbees/main/utils/net/EventAuraChargeUpdate.java b/src/main/java/magicbees/main/utils/net/EventAuraChargeUpdate.java index 379d184..b80b53f 100644 --- a/src/main/java/magicbees/main/utils/net/EventAuraChargeUpdate.java +++ b/src/main/java/magicbees/main/utils/net/EventAuraChargeUpdate.java @@ -1,69 +1,66 @@ package magicbees.main.utils.net; +import cpw.mods.fml.client.FMLClientHandler; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; - -import cpw.mods.fml.client.FMLClientHandler; - import magicbees.main.utils.ChunkCoords; import magicbees.main.utils.LogHelper; import magicbees.main.utils.net.NetworkEventHandler.EventType; import magicbees.tileentity.AuraCharges; import magicbees.tileentity.ITileEntityAuraCharged; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.tileentity.TileEntity; public class EventAuraChargeUpdate extends EventCoords { - private int flags; + private int flags; - public EventAuraChargeUpdate(ChunkCoords position, AuraCharges auraCharges) { - super(EventType.AURA_CHARGE_UPDATE, position); - flags = auraCharges.writeToFlags(); - } + public EventAuraChargeUpdate(ChunkCoords position, AuraCharges auraCharges) { + super(EventType.AURA_CHARGE_UPDATE, position); + flags = auraCharges.writeToFlags(); + } - public EventAuraChargeUpdate(DataInputStream byteStream) { - super(EventType.FLAGS_UPDATE, byteStream); + public EventAuraChargeUpdate(DataInputStream byteStream) { + super(EventType.FLAGS_UPDATE, byteStream); - this.readDataFromInputStream(byteStream); - } + this.readDataFromInputStream(byteStream); + } - @Override - protected void writeDataToOutputStream(DataOutputStream byteStream) { - super.writeDataToOutputStream(byteStream); + @Override + protected void writeDataToOutputStream(DataOutputStream byteStream) { + super.writeDataToOutputStream(byteStream); - try { - byteStream.writeInt(flags); - } - catch (IOException e) { - LogHelper.error("Could not write EventAuraChargeUpdate data to stream."); - e.printStackTrace(); - } - } + try { + byteStream.writeInt(flags); + } catch (IOException e) { + LogHelper.error("Could not write EventAuraChargeUpdate data to stream."); + e.printStackTrace(); + } + } - @Override - protected void readDataFromInputStream(DataInputStream byteStream) { - super.readDataFromInputStream(byteStream); + @Override + protected void readDataFromInputStream(DataInputStream byteStream) { + super.readDataFromInputStream(byteStream); - try { - this.flags = byteStream.readInt(); - } - catch (IOException e) { - LogHelper.error("Could not read EventAuraChargeUpdate data from stream."); - e.printStackTrace(); - } - } + try { + this.flags = byteStream.readInt(); + } catch (IOException e) { + LogHelper.error("Could not read EventAuraChargeUpdate data from stream."); + e.printStackTrace(); + } + } - @Override - public void process(EntityPlayerMP player) { - TileEntity tile = FMLClientHandler.instance().getClient().theWorld.getTileEntity(getCoords().x, getCoords().y, getCoords().z); - - if (tile != null && tile instanceof ITileEntityAuraCharged) { - AuraCharges auraCharges = ((ITileEntityAuraCharged) tile).getAuraCharges(); - auraCharges.readFromFlags(flags); - } - } + @Override + public void process(EntityPlayerMP player) { + TileEntity tile = FMLClientHandler.instance() + .getClient() + .theWorld + .getTileEntity(getCoords().x, getCoords().y, getCoords().z); + if (tile != null && tile instanceof ITileEntityAuraCharged) { + AuraCharges auraCharges = ((ITileEntityAuraCharged) tile).getAuraCharges(); + auraCharges.readFromFlags(flags); + } + } } diff --git a/src/main/java/magicbees/main/utils/net/EventBase.java b/src/main/java/magicbees/main/utils/net/EventBase.java index 7a53061..591a8aa 100644 --- a/src/main/java/magicbees/main/utils/net/EventBase.java +++ b/src/main/java/magicbees/main/utils/net/EventBase.java @@ -1,118 +1,111 @@ package magicbees.main.utils.net; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import cpw.mods.fml.common.registry.GameData; import io.netty.buffer.Unpooled; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; - import magicbees.main.utils.LogHelper; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import cpw.mods.fml.common.registry.GameData; public class EventBase { - private NetworkEventHandler.EventType eventType; - - public EventBase() { - this.eventType = NetworkEventHandler.EventType.UNKNOWN; - } - - public EventBase(NetworkEventHandler.EventType type) { - this.eventType = type; - } - - public FMLProxyPacket getPacket() { - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(bytes); - - try { - data.writeInt(eventType.ordinal()); - writeDataToOutputStream(data); - } - catch (IOException e) { - LogHelper.error("Could not write EventBase data."); - e.printStackTrace(); - } - - return new FMLProxyPacket(Unpooled.wrappedBuffer(bytes.toByteArray()), NetworkEventHandler.CHANNEL_NAME); - } - - public void process(EntityPlayerMP player) { - - } - - protected void writeDataToOutputStream(DataOutputStream data) { - return; - } - - protected void readDataFromInputStream(DataInputStream data) { - return; - } - - protected ItemStack readItemStackFromData(DataInputStream data) throws IOException { - ItemStack itemstack = null; + private NetworkEventHandler.EventType eventType; - String itemName = data.readUTF(); + public EventBase() { + this.eventType = NetworkEventHandler.EventType.UNKNOWN; + } - if (!itemName.isEmpty()) { - Item item = GameData.getItemRegistry().getRaw(itemName); - byte stackSize = data.readByte(); - short meta = data.readShort(); - itemstack = new ItemStack(item, stackSize, meta); + public EventBase(NetworkEventHandler.EventType type) { + this.eventType = type; + } - if (item.isDamageable() || item.getShareTag()) { - itemstack.stackTagCompound = this.readNBTTagCompound(data); - } - } + public FMLProxyPacket getPacket() { + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + DataOutputStream data = new DataOutputStream(bytes); - return itemstack; - } + try { + data.writeInt(eventType.ordinal()); + writeDataToOutputStream(data); + } catch (IOException e) { + LogHelper.error("Could not write EventBase data."); + e.printStackTrace(); + } - protected void writeItemStackToData(ItemStack itemstack, DataOutputStream data) throws IOException { - if (itemstack == null) { - data.writeUTF(""); - } else { - data.writeUTF(GameData.getItemRegistry().getNameForObject(itemstack.getItem())); - data.writeByte(itemstack.stackSize); - data.writeShort(itemstack.getItemDamage()); + return new FMLProxyPacket(Unpooled.wrappedBuffer(bytes.toByteArray()), NetworkEventHandler.CHANNEL_NAME); + } - if (itemstack.getItem().isDamageable() || itemstack.getItem().getShareTag()) { - this.writeNBTTagCompound(itemstack.stackTagCompound, data); - } - } - } + public void process(EntityPlayerMP player) {} - protected NBTTagCompound readNBTTagCompound(DataInputStream data) throws IOException { + protected void writeDataToOutputStream(DataOutputStream data) { + return; + } - short length = data.readShort(); + protected void readDataFromInputStream(DataInputStream data) { + return; + } - if (length < 0) { - return null; - } else { - byte[] compressed = new byte[length]; - data.readFully(compressed); - return CompressedStreamTools.readCompressed(new ByteArrayInputStream(compressed)); - } + protected ItemStack readItemStackFromData(DataInputStream data) throws IOException { + ItemStack itemstack = null; - } + String itemName = data.readUTF(); - protected void writeNBTTagCompound(NBTTagCompound nbttagcompound, DataOutputStream data) throws IOException { + if (!itemName.isEmpty()) { + Item item = GameData.getItemRegistry().getRaw(itemName); + byte stackSize = data.readByte(); + short meta = data.readShort(); + itemstack = new ItemStack(item, stackSize, meta); - if (nbttagcompound == null) { - data.writeShort(-1); - } else { - byte[] compressed = CompressedStreamTools.compress(nbttagcompound); - data.writeShort((short) compressed.length); - data.write(compressed); - } + if (item.isDamageable() || item.getShareTag()) { + itemstack.stackTagCompound = this.readNBTTagCompound(data); + } + } - } + return itemstack; + } + + protected void writeItemStackToData(ItemStack itemstack, DataOutputStream data) throws IOException { + if (itemstack == null) { + data.writeUTF(""); + } else { + data.writeUTF(GameData.getItemRegistry().getNameForObject(itemstack.getItem())); + data.writeByte(itemstack.stackSize); + data.writeShort(itemstack.getItemDamage()); + + if (itemstack.getItem().isDamageable() || itemstack.getItem().getShareTag()) { + this.writeNBTTagCompound(itemstack.stackTagCompound, data); + } + } + } + + protected NBTTagCompound readNBTTagCompound(DataInputStream data) throws IOException { + + short length = data.readShort(); + + if (length < 0) { + return null; + } else { + byte[] compressed = new byte[length]; + data.readFully(compressed); + return CompressedStreamTools.readCompressed(new ByteArrayInputStream(compressed)); + } + } + + protected void writeNBTTagCompound(NBTTagCompound nbttagcompound, DataOutputStream data) throws IOException { + + if (nbttagcompound == null) { + data.writeShort(-1); + } else { + byte[] compressed = CompressedStreamTools.compress(nbttagcompound); + data.writeShort((short) compressed.length); + data.write(compressed); + } + } } diff --git a/src/main/java/magicbees/main/utils/net/EventCoords.java b/src/main/java/magicbees/main/utils/net/EventCoords.java index 907e74b..74425d5 100644 --- a/src/main/java/magicbees/main/utils/net/EventCoords.java +++ b/src/main/java/magicbees/main/utils/net/EventCoords.java @@ -3,58 +3,55 @@ package magicbees.main.utils.net; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; - import magicbees.main.utils.ChunkCoords; import magicbees.main.utils.LogHelper; public class EventCoords extends EventBase { - - private ChunkCoords coords; - - public EventCoords(NetworkEventHandler.EventType type, ChunkCoords position) { - super(type); - this.coords = position; - } - - public EventCoords(NetworkEventHandler.EventType type, DataInputStream byteStream) { - super(type); - } - - public ChunkCoords getCoords() { - return this.coords; - } - - @Override - protected void writeDataToOutputStream(DataOutputStream byteStream) { - super.writeDataToOutputStream(byteStream); - - try { - byteStream.writeInt(coords.dimension); - byteStream.writeInt(coords.x); - byteStream.writeInt(coords.y); - byteStream.writeInt(coords.z); - } - catch (IOException e) { - LogHelper.error("Could not write EventCoords data to stream."); - e.printStackTrace(); - } - } - - @Override - protected void readDataFromInputStream(DataInputStream byteStream) { - super.readDataFromInputStream(byteStream); - - try { - int dim = byteStream.readInt(); - int x = byteStream.readInt(); - int y = byteStream.readInt(); - int z = byteStream.readInt(); - - this.coords = new ChunkCoords(dim, x, y, z); - } - catch (IOException e) { - LogHelper.error("Could not read EventCoords data from stream."); - e.printStackTrace(); - } - } + + private ChunkCoords coords; + + public EventCoords(NetworkEventHandler.EventType type, ChunkCoords position) { + super(type); + this.coords = position; + } + + public EventCoords(NetworkEventHandler.EventType type, DataInputStream byteStream) { + super(type); + } + + public ChunkCoords getCoords() { + return this.coords; + } + + @Override + protected void writeDataToOutputStream(DataOutputStream byteStream) { + super.writeDataToOutputStream(byteStream); + + try { + byteStream.writeInt(coords.dimension); + byteStream.writeInt(coords.x); + byteStream.writeInt(coords.y); + byteStream.writeInt(coords.z); + } catch (IOException e) { + LogHelper.error("Could not write EventCoords data to stream."); + e.printStackTrace(); + } + } + + @Override + protected void readDataFromInputStream(DataInputStream byteStream) { + super.readDataFromInputStream(byteStream); + + try { + int dim = byteStream.readInt(); + int x = byteStream.readInt(); + int y = byteStream.readInt(); + int z = byteStream.readInt(); + + this.coords = new ChunkCoords(dim, x, y, z); + } catch (IOException e) { + LogHelper.error("Could not read EventCoords data from stream."); + e.printStackTrace(); + } + } } diff --git a/src/main/java/magicbees/main/utils/net/EventFlagsUpdate.java b/src/main/java/magicbees/main/utils/net/EventFlagsUpdate.java index e5042c9..ac60f18 100644 --- a/src/main/java/magicbees/main/utils/net/EventFlagsUpdate.java +++ b/src/main/java/magicbees/main/utils/net/EventFlagsUpdate.java @@ -1,77 +1,76 @@ package magicbees.main.utils.net; +import cpw.mods.fml.client.FMLClientHandler; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.client.FMLClientHandler; import magicbees.main.utils.ChunkCoords; import magicbees.main.utils.LogHelper; import magicbees.main.utils.net.NetworkEventHandler.EventType; import magicbees.tileentity.ITileEntityFlags; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.tileentity.TileEntity; public class EventFlagsUpdate extends EventCoords { - private int[] flags; - - public EventFlagsUpdate(ChunkCoords position, int[] flagValues) { - super(EventType.FLAGS_UPDATE, position); - flags = flagValues; - } - - public EventFlagsUpdate(DataInputStream byteStream) { - super(EventType.FLAGS_UPDATE, byteStream); - - this.readDataFromInputStream(byteStream); - } - - public int[] getFlags() { - return flags; - } + private int[] flags; - @Override - protected void writeDataToOutputStream(DataOutputStream byteStream) { - super.writeDataToOutputStream(byteStream); - - try { - byteStream.writeByte(flags.length); - for (int index = 0; index < flags.length; ++index) { - byteStream.writeInt(flags[index]); - } - } - catch (IOException e) { - LogHelper.error("Could not write EventFlagsUpdate data to stream."); - e.printStackTrace(); - } - } + public EventFlagsUpdate(ChunkCoords position, int[] flagValues) { + super(EventType.FLAGS_UPDATE, position); + flags = flagValues; + } - @Override - protected void readDataFromInputStream(DataInputStream byteStream) { - super.readDataFromInputStream(byteStream); - - try { - byte length = byteStream.readByte(); + public EventFlagsUpdate(DataInputStream byteStream) { + super(EventType.FLAGS_UPDATE, byteStream); - this.flags = new int[length]; - for (int index = 0; index < length; ++index) { - flags[index] = byteStream.readInt(); - } - } - catch (IOException e) { - LogHelper.error("Could not read EventFlagsUpdate data from stream."); - e.printStackTrace(); - } - } - - @Override - public void process(EntityPlayerMP player) { - TileEntity tile = FMLClientHandler.instance().getClient().theWorld.getTileEntity(getCoords().x, getCoords().y, getCoords().z); - - if (tile != null && tile instanceof ITileEntityFlags) { - ((ITileEntityFlags) tile).setFlags(this.flags); - } - } + this.readDataFromInputStream(byteStream); + } + public int[] getFlags() { + return flags; + } + + @Override + protected void writeDataToOutputStream(DataOutputStream byteStream) { + super.writeDataToOutputStream(byteStream); + + try { + byteStream.writeByte(flags.length); + for (int index = 0; index < flags.length; ++index) { + byteStream.writeInt(flags[index]); + } + } catch (IOException e) { + LogHelper.error("Could not write EventFlagsUpdate data to stream."); + e.printStackTrace(); + } + } + + @Override + protected void readDataFromInputStream(DataInputStream byteStream) { + super.readDataFromInputStream(byteStream); + + try { + byte length = byteStream.readByte(); + + this.flags = new int[length]; + for (int index = 0; index < length; ++index) { + flags[index] = byteStream.readInt(); + } + } catch (IOException e) { + LogHelper.error("Could not read EventFlagsUpdate data from stream."); + e.printStackTrace(); + } + } + + @Override + public void process(EntityPlayerMP player) { + TileEntity tile = FMLClientHandler.instance() + .getClient() + .theWorld + .getTileEntity(getCoords().x, getCoords().y, getCoords().z); + + if (tile != null && tile instanceof ITileEntityFlags) { + ((ITileEntityFlags) tile).setFlags(this.flags); + } + } } diff --git a/src/main/java/magicbees/main/utils/net/EventInventoryUpdate.java b/src/main/java/magicbees/main/utils/net/EventInventoryUpdate.java index c813783..4c9e088 100644 --- a/src/main/java/magicbees/main/utils/net/EventInventoryUpdate.java +++ b/src/main/java/magicbees/main/utils/net/EventInventoryUpdate.java @@ -1,10 +1,9 @@ package magicbees.main.utils.net; +import cpw.mods.fml.client.FMLClientHandler; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; - -import cpw.mods.fml.client.FMLClientHandler; import magicbees.main.utils.ChunkCoords; import magicbees.main.utils.LogHelper; import net.minecraft.entity.player.EntityPlayerMP; @@ -14,54 +13,57 @@ import net.minecraft.tileentity.TileEntity; public class EventInventoryUpdate extends EventCoords { - private int slotIndex; - private ItemStack itemStack; - - public EventInventoryUpdate(ChunkCoords position, int slot, ItemStack item) { - super(NetworkEventHandler.EventType.INVENTORY_UPDATE, position); - - this.slotIndex = slot; - this.itemStack = item; - } - - public EventInventoryUpdate(DataInputStream byteStream) { - super(NetworkEventHandler.EventType.INVENTORY_UPDATE, byteStream); - - this.readDataFromInputStream(byteStream); - } + private int slotIndex; + private ItemStack itemStack; - @Override - protected void writeDataToOutputStream(DataOutputStream byteStream) { - super.writeDataToOutputStream(byteStream); - - try { - byteStream.writeInt(this.slotIndex); - this.writeItemStackToData(this.itemStack, byteStream); - } catch (IOException e) { - LogHelper.error("Could not write EventInventoryUpdate to byte stream."); - e.printStackTrace(); - } - } + public EventInventoryUpdate(ChunkCoords position, int slot, ItemStack item) { + super(NetworkEventHandler.EventType.INVENTORY_UPDATE, position); - @Override - protected void readDataFromInputStream(DataInputStream byteStream) { - super.readDataFromInputStream(byteStream); - - try { - this.slotIndex = byteStream.readInt(); - this.itemStack = this.readItemStackFromData(byteStream); - } catch (IOException e) { - LogHelper.error("Could not read EventInventoryUpdate to byte stream."); - e.printStackTrace(); - } - } - - @Override - public void process(EntityPlayerMP player) { - TileEntity tile = FMLClientHandler.instance().getClient().theWorld.getTileEntity(getCoords().x, getCoords().y, getCoords().z); - - if (tile != null && tile instanceof IInventory) { - ((IInventory) tile).setInventorySlotContents(slotIndex, itemStack); - } - } + this.slotIndex = slot; + this.itemStack = item; + } + + public EventInventoryUpdate(DataInputStream byteStream) { + super(NetworkEventHandler.EventType.INVENTORY_UPDATE, byteStream); + + this.readDataFromInputStream(byteStream); + } + + @Override + protected void writeDataToOutputStream(DataOutputStream byteStream) { + super.writeDataToOutputStream(byteStream); + + try { + byteStream.writeInt(this.slotIndex); + this.writeItemStackToData(this.itemStack, byteStream); + } catch (IOException e) { + LogHelper.error("Could not write EventInventoryUpdate to byte stream."); + e.printStackTrace(); + } + } + + @Override + protected void readDataFromInputStream(DataInputStream byteStream) { + super.readDataFromInputStream(byteStream); + + try { + this.slotIndex = byteStream.readInt(); + this.itemStack = this.readItemStackFromData(byteStream); + } catch (IOException e) { + LogHelper.error("Could not read EventInventoryUpdate to byte stream."); + e.printStackTrace(); + } + } + + @Override + public void process(EntityPlayerMP player) { + TileEntity tile = FMLClientHandler.instance() + .getClient() + .theWorld + .getTileEntity(getCoords().x, getCoords().y, getCoords().z); + + if (tile != null && tile instanceof IInventory) { + ((IInventory) tile).setInventorySlotContents(slotIndex, itemStack); + } + } } diff --git a/src/main/java/magicbees/main/utils/net/NetworkEventHandler.java b/src/main/java/magicbees/main/utils/net/NetworkEventHandler.java index 91ef606..063aba3 100644 --- a/src/main/java/magicbees/main/utils/net/NetworkEventHandler.java +++ b/src/main/java/magicbees/main/utils/net/NetworkEventHandler.java @@ -1,23 +1,5 @@ package magicbees.main.utils.net; -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; - -import java.io.DataInputStream; -import java.io.IOException; - -import magicbees.main.MagicBees; -import magicbees.main.utils.ChunkCoords; -import magicbees.main.utils.LogHelper; -import magicbees.main.utils.VersionInfo; -import magicbees.main.utils.error.InvalidEventTypeIndexException; -import magicbees.tileentity.AuraCharges; -import magicbees.tileentity.ITileEntityAuraCharged; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.network.NetHandlerPlayServer; -import net.minecraft.tileentity.TileEntity; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.network.FMLEventChannel; @@ -25,101 +7,111 @@ import cpw.mods.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent; import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import magicbees.main.MagicBees; +import magicbees.main.utils.ChunkCoords; +import magicbees.main.utils.LogHelper; +import magicbees.main.utils.VersionInfo; +import magicbees.main.utils.error.InvalidEventTypeIndexException; +import magicbees.tileentity.AuraCharges; +import magicbees.tileentity.ITileEntityAuraCharged; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.network.NetHandlerPlayServer; +import net.minecraft.tileentity.TileEntity; public class NetworkEventHandler { - - public static final String CHANNEL_NAME = VersionInfo.ModName; - - public static NetworkEventHandler getInstance() { - return MagicBees.object.netHandler; - } - - public enum EventType { - UNKNOWN, - INVENTORY_UPDATE, - FLAGS_UPDATE, - AURA_CHARGE_UPDATE - ; - } - - private FMLEventChannel channel; - - public NetworkEventHandler() { - channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(CHANNEL_NAME); - channel.register(this); - } - - @SubscribeEvent - public void onPacket(ServerCustomPacketEvent event) { - this.parseAndDispatchPacket(event.packet.payload(), ((NetHandlerPlayServer)event.handler).playerEntity); - } - - @SubscribeEvent - public void onPacket(ClientCustomPacketEvent event) { - this.parseAndDispatchPacket(event.packet.payload(), null); - } - - public void sendInventoryUpdate(TileEntity entity, int slotIndex, ItemStack itemStack) { - EventInventoryUpdate event = new EventInventoryUpdate(new ChunkCoords(entity), slotIndex, itemStack); - FMLProxyPacket packet = event.getPacket(); - - sendPacket(packet); - } - - public void sendFlagsUpdate(TileEntity entity, int[] flags) { - EventFlagsUpdate event = new EventFlagsUpdate(new ChunkCoords(entity), flags); - FMLProxyPacket packet = event.getPacket(); - - sendPacket(packet); - } - public void sendAuraChargeUpdate(T entity, AuraCharges auraCharges) { - EventAuraChargeUpdate event = new EventAuraChargeUpdate(new ChunkCoords(entity), auraCharges); - FMLProxyPacket packet = event.getPacket(); + public static final String CHANNEL_NAME = VersionInfo.ModName; - sendPacket(packet); - } - - private void sendPacket(FMLProxyPacket packet) { - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - channel.sendToAll(packet); - } - else { - channel.sendToServer(packet); - } - } - - private void parseAndDispatchPacket(ByteBuf packetPayload, EntityPlayerMP player) { - try { - DataInputStream data = new DataInputStream(new ByteBufInputStream(packetPayload)); - - processEventData(data, player); - - data.close(); - } catch (IOException e) { - LogHelper.info("DataInputStream had a problem closing. Good for it."); - //e.printStackTrace(); - } - } + public static NetworkEventHandler getInstance() { + return MagicBees.object.netHandler; + } - private void processEventData(DataInputStream data, EntityPlayerMP player) throws IOException { - int eventId = data.readInt(); - - if (eventId == EventType.INVENTORY_UPDATE.ordinal()) { - EventInventoryUpdate eventData = new EventInventoryUpdate(data); - eventData.process(player); - } - else if (eventId == EventType.FLAGS_UPDATE.ordinal()) { - EventFlagsUpdate eventData = new EventFlagsUpdate(data); - eventData.process(player); - } - else if (eventId == EventType.AURA_CHARGE_UPDATE.ordinal()) { - EventAuraChargeUpdate evenData = new EventAuraChargeUpdate(data); - evenData.process(player); - } - else { - throw new InvalidEventTypeIndexException(""); - } - } + public enum EventType { + UNKNOWN, + INVENTORY_UPDATE, + FLAGS_UPDATE, + AURA_CHARGE_UPDATE; + } + private FMLEventChannel channel; + + public NetworkEventHandler() { + channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(CHANNEL_NAME); + channel.register(this); + } + + @SubscribeEvent + public void onPacket(ServerCustomPacketEvent event) { + this.parseAndDispatchPacket(event.packet.payload(), ((NetHandlerPlayServer) event.handler).playerEntity); + } + + @SubscribeEvent + public void onPacket(ClientCustomPacketEvent event) { + this.parseAndDispatchPacket(event.packet.payload(), null); + } + + public void sendInventoryUpdate(TileEntity entity, int slotIndex, ItemStack itemStack) { + EventInventoryUpdate event = new EventInventoryUpdate(new ChunkCoords(entity), slotIndex, itemStack); + FMLProxyPacket packet = event.getPacket(); + + sendPacket(packet); + } + + public void sendFlagsUpdate(TileEntity entity, int[] flags) { + EventFlagsUpdate event = new EventFlagsUpdate(new ChunkCoords(entity), flags); + FMLProxyPacket packet = event.getPacket(); + + sendPacket(packet); + } + + public void sendAuraChargeUpdate( + T entity, AuraCharges auraCharges) { + EventAuraChargeUpdate event = new EventAuraChargeUpdate(new ChunkCoords(entity), auraCharges); + FMLProxyPacket packet = event.getPacket(); + + sendPacket(packet); + } + + private void sendPacket(FMLProxyPacket packet) { + if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { + channel.sendToAll(packet); + } else { + channel.sendToServer(packet); + } + } + + private void parseAndDispatchPacket(ByteBuf packetPayload, EntityPlayerMP player) { + try { + DataInputStream data = new DataInputStream(new ByteBufInputStream(packetPayload)); + + processEventData(data, player); + + data.close(); + } catch (IOException e) { + LogHelper.info("DataInputStream had a problem closing. Good for it."); + // e.printStackTrace(); + } + } + + private void processEventData(DataInputStream data, EntityPlayerMP player) throws IOException { + int eventId = data.readInt(); + + if (eventId == EventType.INVENTORY_UPDATE.ordinal()) { + EventInventoryUpdate eventData = new EventInventoryUpdate(data); + eventData.process(player); + } else if (eventId == EventType.FLAGS_UPDATE.ordinal()) { + EventFlagsUpdate eventData = new EventFlagsUpdate(data); + eventData.process(player); + } else if (eventId == EventType.AURA_CHARGE_UPDATE.ordinal()) { + EventAuraChargeUpdate evenData = new EventAuraChargeUpdate(data); + evenData.process(player); + } else { + throw new InvalidEventTypeIndexException(""); + } + } } diff --git a/src/main/java/magicbees/storage/BackpackDefinition.java b/src/main/java/magicbees/storage/BackpackDefinition.java index 70323cf..acf63dc 100644 --- a/src/main/java/magicbees/storage/BackpackDefinition.java +++ b/src/main/java/magicbees/storage/BackpackDefinition.java @@ -1,89 +1,76 @@ package magicbees.storage; +import forestry.api.storage.IBackpackDefinition; import java.util.ArrayList; import java.util.List; - import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -import forestry.api.storage.IBackpackDefinition; /** * Backpack definition for Forestry. * * @author MysteriousAges */ -public class BackpackDefinition implements IBackpackDefinition -{ - private ArrayList items; - private String key; - private String name; - private int colour; +public class BackpackDefinition implements IBackpackDefinition { + private ArrayList items; + private String key; + private String name; + private int colour; - public BackpackDefinition(String backpackKey, String backpackName, int backpackColour) - { - items = new ArrayList(); - this.name = backpackName; - this.key = backpackKey; - this.colour = backpackColour; - } + public BackpackDefinition(String backpackKey, String backpackName, int backpackColour) { + items = new ArrayList(); + this.name = backpackName; + this.key = backpackKey; + this.colour = backpackColour; + } - @Override - public String getKey() - { - return this.key; - } + @Override + public String getKey() { + return this.key; + } - @Override - public String getName(ItemStack backpack) - { - return name; - } + @Override + public String getName(ItemStack backpack) { + return name; + } - @Override - public int getPrimaryColour() - { - return this.colour; - } + @Override + public int getPrimaryColour() { + return this.colour; + } - @Override - public int getSecondaryColour() - { - return 0xFFFFFF; - } + @Override + public int getSecondaryColour() { + return 0xFFFFFF; + } - @Override - public void addValidItem(ItemStack validItem) - { - if (!this.items.contains(validItem)) - { - this.items.add(validItem); - } - } + @Override + public void addValidItem(ItemStack validItem) { + if (!this.items.contains(validItem)) { + this.items.add(validItem); + } + } - @Override - public boolean isValidItem(ItemStack itemStack) { - boolean flag = false; + @Override + public boolean isValidItem(ItemStack itemStack) { + boolean flag = false; - ItemStack stack; - for (int i = 0; i < this.items.size() && !flag; i++) - { - stack = this.items.get(i); - // If comparison stack has meta of -1 - if (stack.getItem() == itemStack.getItem()) - { - flag = stack.getItemDamage() == -1 || stack.getItemDamage() == OreDictionary.WILDCARD_VALUE || stack.getItemDamage() == itemStack.getItemDamage(); - } - } + ItemStack stack; + for (int i = 0; i < this.items.size() && !flag; i++) { + stack = this.items.get(i); + // If comparison stack has meta of -1 + if (stack.getItem() == itemStack.getItem()) { + flag = stack.getItemDamage() == -1 + || stack.getItemDamage() == OreDictionary.WILDCARD_VALUE + || stack.getItemDamage() == itemStack.getItemDamage(); + } + } - return flag; - } - - @Override - public void addValidItems(List validItems) - { - for (ItemStack s : validItems) - addValidItem(s); - - } + return flag; + } + @Override + public void addValidItems(List validItems) { + for (ItemStack s : validItems) addValidItem(s); + } } diff --git a/src/main/java/magicbees/tileentity/AuraCharges.java b/src/main/java/magicbees/tileentity/AuraCharges.java index 4d73d78..0d3e61e 100644 --- a/src/main/java/magicbees/tileentity/AuraCharges.java +++ b/src/main/java/magicbees/tileentity/AuraCharges.java @@ -2,69 +2,67 @@ package magicbees.tileentity; import java.util.HashMap; import java.util.Map; - +import magicbees.bees.AuraCharge; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -import magicbees.bees.AuraCharge; - public class AuraCharges { - private static final String auraChargesTagName = "AuraCharges"; + private static final String auraChargesTagName = "AuraCharges"; - private final Map charges = new HashMap(AuraCharge.values().length); + private final Map charges = new HashMap(AuraCharge.values().length); - public void start(AuraCharge auraChargeType, World worldObj) { - charges.put(auraChargeType, worldObj.getTotalWorldTime()); - } + public void start(AuraCharge auraChargeType, World worldObj) { + charges.put(auraChargeType, worldObj.getTotalWorldTime()); + } - public boolean isActive(AuraCharge auraChargeType) { - return charges.keySet().contains(auraChargeType); - } + public boolean isActive(AuraCharge auraChargeType) { + return charges.keySet().contains(auraChargeType); + } - public boolean isExpired(AuraCharge auraChargeType, World worldObj) { - Long chargeStart = charges.get(auraChargeType); - return chargeStart == null || chargeStart + auraChargeType.duration <= worldObj.getTotalWorldTime(); - } + public boolean isExpired(AuraCharge auraChargeType, World worldObj) { + Long chargeStart = charges.get(auraChargeType); + return chargeStart == null || chargeStart + auraChargeType.duration <= worldObj.getTotalWorldTime(); + } - public void stop(AuraCharge AuraChargeType) { - charges.remove(AuraChargeType); - } + public void stop(AuraCharge AuraChargeType) { + charges.remove(AuraChargeType); + } - public void writeToNBT(NBTTagCompound nbtTagCompound) { - NBTTagCompound auraChargeTags = new NBTTagCompound(); - for (Map.Entry chargeEntry : charges.entrySet()) { - String chargeName = chargeEntry.getKey().toString(); - Long chargeStart = chargeEntry.getValue(); - auraChargeTags.setLong(chargeName, chargeStart); - } - nbtTagCompound.setTag(auraChargesTagName, auraChargeTags); - } + public void writeToNBT(NBTTagCompound nbtTagCompound) { + NBTTagCompound auraChargeTags = new NBTTagCompound(); + for (Map.Entry chargeEntry : charges.entrySet()) { + String chargeName = chargeEntry.getKey().toString(); + Long chargeStart = chargeEntry.getValue(); + auraChargeTags.setLong(chargeName, chargeStart); + } + nbtTagCompound.setTag(auraChargesTagName, auraChargeTags); + } - public void readFromNBT(NBTTagCompound nbtTagCompound) { - NBTTagCompound auraChargeTags = nbtTagCompound.getCompoundTag(auraChargesTagName); - for (AuraCharge auraCharge : AuraCharge.values()) { - String chargeName = auraCharge.toString(); - Long chargeStart = auraChargeTags.getLong(chargeName); - if (chargeStart > 0) { - charges.put(auraCharge, chargeStart); - } - } - } + public void readFromNBT(NBTTagCompound nbtTagCompound) { + NBTTagCompound auraChargeTags = nbtTagCompound.getCompoundTag(auraChargesTagName); + for (AuraCharge auraCharge : AuraCharge.values()) { + String chargeName = auraCharge.toString(); + Long chargeStart = auraChargeTags.getLong(chargeName); + if (chargeStart > 0) { + charges.put(auraCharge, chargeStart); + } + } + } - public int writeToFlags() { - int flags = 0; - for (AuraCharge auraChargeType : charges.keySet()) { - flags |= auraChargeType.flag; - } - return flags; - } + public int writeToFlags() { + int flags = 0; + for (AuraCharge auraChargeType : charges.keySet()) { + flags |= auraChargeType.flag; + } + return flags; + } - public void readFromFlags(int flags) { - charges.clear(); - for (AuraCharge auraCharge : AuraCharge.values()) { - if ((flags & auraCharge.flag) > 0) { - charges.put(auraCharge, 0L); - } - } - } + public void readFromFlags(int flags) { + charges.clear(); + for (AuraCharge auraCharge : AuraCharge.values()) { + if ((flags & auraCharge.flag) > 0) { + charges.put(auraCharge, 0L); + } + } + } } diff --git a/src/main/java/magicbees/tileentity/EffectJarHousing.java b/src/main/java/magicbees/tileentity/EffectJarHousing.java index 8c849d2..9edd94f 100644 --- a/src/main/java/magicbees/tileentity/EffectJarHousing.java +++ b/src/main/java/magicbees/tileentity/EffectJarHousing.java @@ -1,19 +1,7 @@ package magicbees.tileentity; import com.google.common.collect.ImmutableSet; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - import com.mojang.authlib.GameProfile; - import forestry.api.apiculture.DefaultBeeListener; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; @@ -25,9 +13,15 @@ import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.core.IErrorLogic; import forestry.api.core.IErrorState; - +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; import magicbees.bees.BeeManager; - +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; /** * Simulates enough of a bee house to fire the bee effects. =D @@ -36,211 +30,204 @@ import magicbees.bees.BeeManager; */ public class EffectJarHousing implements IBeeHousing { - private static final IErrorLogic errorLogic = new JarErrorLogic(); - private static final Iterable beeListeners = ImmutableSet.of(new DefaultBeeListener()); - private static final Iterable beeModifiers = ImmutableSet.of(new JarHousingModifier()); + private static final IErrorLogic errorLogic = new JarErrorLogic(); + private static final Iterable beeListeners = ImmutableSet.of(new DefaultBeeListener()); + private static final Iterable beeModifiers = ImmutableSet.of(new JarHousingModifier()); - private final IBeekeepingLogic beekeepingLogic; - private final TileEntityEffectJar jarEntity; - private final BiomeGenBase biome; - private final IBeeHousingInventory inventory; + private final IBeekeepingLogic beekeepingLogic; + private final TileEntityEffectJar jarEntity; + private final BiomeGenBase biome; + private final IBeeHousingInventory inventory; - public EffectJarHousing(TileEntityEffectJar entity) { - this.jarEntity = entity; - this.biome = entity.getWorldObj().getBiomeGenForCoords(entity.xCoord, entity.zCoord); - this.inventory = new JarBeeHousingInventory(entity); - this.beekeepingLogic = BeeManager.beeRoot.createBeekeepingLogic(this); - } + public EffectJarHousing(TileEntityEffectJar entity) { + this.jarEntity = entity; + this.biome = entity.getWorldObj().getBiomeGenForCoords(entity.xCoord, entity.zCoord); + this.inventory = new JarBeeHousingInventory(entity); + this.beekeepingLogic = BeeManager.beeRoot.createBeekeepingLogic(this); + } - @Override - public ChunkCoordinates getCoordinates() { - return new ChunkCoordinates(jarEntity.xCoord, jarEntity.yCoord, jarEntity.zCoord); - } + @Override + public ChunkCoordinates getCoordinates() { + return new ChunkCoordinates(jarEntity.xCoord, jarEntity.yCoord, jarEntity.zCoord); + } - @Override - public BiomeGenBase getBiome() { - return biome; - } + @Override + public BiomeGenBase getBiome() { + return biome; + } - @Override - public EnumTemperature getTemperature() { - return EnumTemperature.getFromBiome(biome, jarEntity.xCoord, jarEntity.yCoord, jarEntity.zCoord); - } + @Override + public EnumTemperature getTemperature() { + return EnumTemperature.getFromBiome(biome, jarEntity.xCoord, jarEntity.yCoord, jarEntity.zCoord); + } - @Override - public EnumHumidity getHumidity() { - return EnumHumidity.getFromValue(biome.rainfall); - } + @Override + public EnumHumidity getHumidity() { + return EnumHumidity.getFromValue(biome.rainfall); + } - @Override - public int getBlockLightValue() { - return jarEntity.getWorldObj().getBlockLightValue(jarEntity.xCoord, jarEntity.yCoord + 1, jarEntity.zCoord); - } + @Override + public int getBlockLightValue() { + return jarEntity.getWorldObj().getBlockLightValue(jarEntity.xCoord, jarEntity.yCoord + 1, jarEntity.zCoord); + } - @Override - public boolean canBlockSeeTheSky() { - return jarEntity.getWorldObj().canBlockSeeTheSky(jarEntity.xCoord, jarEntity.yCoord + 1, jarEntity.zCoord); - } + @Override + public boolean canBlockSeeTheSky() { + return jarEntity.getWorldObj().canBlockSeeTheSky(jarEntity.xCoord, jarEntity.yCoord + 1, jarEntity.zCoord); + } - @Override - public World getWorld() { - return jarEntity.getWorldObj(); - } + @Override + public World getWorld() { + return jarEntity.getWorldObj(); + } - @Override - public GameProfile getOwner() { - return jarEntity.getOwner(); - } + @Override + public GameProfile getOwner() { + return jarEntity.getOwner(); + } - @Override - public Vec3 getBeeFXCoordinates() { - return Vec3.createVectorHelper(jarEntity.xCoord + 0.5f, jarEntity.yCoord + 0.5f, jarEntity.zCoord + 0.5f); - } + @Override + public Vec3 getBeeFXCoordinates() { + return Vec3.createVectorHelper(jarEntity.xCoord + 0.5f, jarEntity.yCoord + 0.5f, jarEntity.zCoord + 0.5f); + } - @Override - public IErrorLogic getErrorLogic() { - return errorLogic; - } + @Override + public IErrorLogic getErrorLogic() { + return errorLogic; + } - @Override - public IBeeHousingInventory getBeeInventory() { - return inventory; - } + @Override + public IBeeHousingInventory getBeeInventory() { + return inventory; + } - @Override - public IBeekeepingLogic getBeekeepingLogic() { - return beekeepingLogic; - } + @Override + public IBeekeepingLogic getBeekeepingLogic() { + return beekeepingLogic; + } - @Override - public Iterable getBeeModifiers() { - return beeModifiers; - } + @Override + public Iterable getBeeModifiers() { + return beeModifiers; + } - @Override - public Iterable getBeeListeners() { - return beeListeners; - } + @Override + public Iterable getBeeListeners() { + return beeListeners; + } - private static class JarBeeHousingInventory implements IBeeHousingInventory { - private final TileEntityEffectJar jarEntity; + private static class JarBeeHousingInventory implements IBeeHousingInventory { + private final TileEntityEffectJar jarEntity; - public JarBeeHousingInventory(TileEntityEffectJar jarEntity) { - this.jarEntity = jarEntity; - } + public JarBeeHousingInventory(TileEntityEffectJar jarEntity) { + this.jarEntity = jarEntity; + } - @Override - public ItemStack getQueen() { - return jarEntity.getStackInSlot(TileEntityEffectJar.QUEEN_SLOT); - } + @Override + public ItemStack getQueen() { + return jarEntity.getStackInSlot(TileEntityEffectJar.QUEEN_SLOT); + } - @Override - public ItemStack getDrone() { - return null; - } + @Override + public ItemStack getDrone() { + return null; + } - @Override - public void setQueen(ItemStack itemStack) { - jarEntity.setInventorySlotContents(TileEntityEffectJar.QUEEN_SLOT, itemStack); - } + @Override + public void setQueen(ItemStack itemStack) { + jarEntity.setInventorySlotContents(TileEntityEffectJar.QUEEN_SLOT, itemStack); + } - @Override - public void setDrone(ItemStack itemstack) { - } + @Override + public void setDrone(ItemStack itemstack) {} - @Override - public boolean addProduct(ItemStack product, boolean all) { - return false; - } - } + @Override + public boolean addProduct(ItemStack product, boolean all) { + return false; + } + } - private static class JarErrorLogic implements IErrorLogic { + private static class JarErrorLogic implements IErrorLogic { - @Override - public boolean setCondition(boolean condition, IErrorState errorState) { - return condition; - } + @Override + public boolean setCondition(boolean condition, IErrorState errorState) { + return condition; + } - @Override - public boolean contains(IErrorState state) { - return false; - } + @Override + public boolean contains(IErrorState state) { + return false; + } - @Override - public boolean hasErrors() { - return false; - } + @Override + public boolean hasErrors() { + return false; + } - @Override - public void clearErrors() { + @Override + public void clearErrors() {} - } + @Override + public void writeData(DataOutputStream data) throws IOException {} - @Override - public void writeData(DataOutputStream data) throws IOException { + @Override + public void readData(DataInputStream data) throws IOException {} - } + @Override + public ImmutableSet getErrorStates() { + return ImmutableSet.of(); + } + } - @Override - public void readData(DataInputStream data) throws IOException { + private static class JarHousingModifier implements IBeeModifier { + @Override + public float getTerritoryModifier(IBeeGenome genome, float currentModifier) { + return 0.9f; + } - } + @Override + public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { + return 0f; + } - @Override - public ImmutableSet getErrorStates() { - return ImmutableSet.of(); - } - } + @Override + public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { + return 0f; + } - private static class JarHousingModifier implements IBeeModifier { - @Override - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) { - return 0.9f; - } + @Override + public float getProductionModifier(IBeeGenome genome, float currentModifier) { + return 0f; + } - @Override - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { - return 0f; - } + @Override + public float getFloweringModifier(IBeeGenome genome, float currentModifier) { + return 0f; + } - @Override - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { - return 0f; - } + @Override + public float getGeneticDecay(IBeeGenome genome, float currentModifier) { + return 0f; + } - @Override - public float getProductionModifier(IBeeGenome genome, float currentModifier) { - return 0f; - } + @Override + public boolean isSealed() { + return true; + } - @Override - public float getFloweringModifier(IBeeGenome genome, float currentModifier) { - return 0f; - } + @Override + public boolean isSelfLighted() { + return true; + } - @Override - public float getGeneticDecay(IBeeGenome genome, float currentModifier) { - return 0f; - } + @Override + public boolean isSunlightSimulated() { + return true; + } - @Override - public boolean isSealed() { - return true; - } - - @Override - public boolean isSelfLighted() { - return true; - } - - @Override - public boolean isSunlightSimulated() { - return true; - } - - @Override - public boolean isHellish() { - return false; - } - } + @Override + public boolean isHellish() { + return false; + } + } } diff --git a/src/main/java/magicbees/tileentity/ITileEntityAuraCharged.java b/src/main/java/magicbees/tileentity/ITileEntityAuraCharged.java index c1e2938..4196766 100644 --- a/src/main/java/magicbees/tileentity/ITileEntityAuraCharged.java +++ b/src/main/java/magicbees/tileentity/ITileEntityAuraCharged.java @@ -1,5 +1,5 @@ package magicbees.tileentity; public interface ITileEntityAuraCharged { - AuraCharges getAuraCharges(); + AuraCharges getAuraCharges(); } diff --git a/src/main/java/magicbees/tileentity/ITileEntityFlags.java b/src/main/java/magicbees/tileentity/ITileEntityFlags.java index 8506fac..be3725b 100644 --- a/src/main/java/magicbees/tileentity/ITileEntityFlags.java +++ b/src/main/java/magicbees/tileentity/ITileEntityFlags.java @@ -2,5 +2,5 @@ package magicbees.tileentity; public interface ITileEntityFlags { - public void setFlags(int[] flags); + public void setFlags(int[] flags); } diff --git a/src/main/java/magicbees/tileentity/TileEntityEffectJar.java b/src/main/java/magicbees/tileentity/TileEntityEffectJar.java index 36d479f..ef9f1b4 100644 --- a/src/main/java/magicbees/tileentity/TileEntityEffectJar.java +++ b/src/main/java/magicbees/tileentity/TileEntityEffectJar.java @@ -1,6 +1,8 @@ package magicbees.tileentity; import com.mojang.authlib.GameProfile; +import forestry.api.apiculture.IBee; +import forestry.api.genetics.IEffectData; import magicbees.main.CommonProxy; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -9,235 +11,219 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.Constants; -import forestry.api.apiculture.IBee; -import forestry.api.genetics.IEffectData; - public class TileEntityEffectJar extends TileEntity implements IInventory { - public static final String tileEntityName = CommonProxy.DOMAIN + ".effectJar"; - private static final int SLOT_COUNT = 2; - public static final int DRONE_SLOT = 0; - public static final int QUEEN_SLOT = SLOT_COUNT - 1; + public static final String tileEntityName = CommonProxy.DOMAIN + ".effectJar"; + private static final int SLOT_COUNT = 2; + public static final int DRONE_SLOT = 0; + public static final int QUEEN_SLOT = SLOT_COUNT - 1; - private GameProfile ownerName; - private ItemStack[] beeSlots; - private IEffectData[] effectData = new IEffectData[2]; - private int throttle; - public int currentBeeHealth; - public int currentBeeColour; - - public TileEntityEffectJar() { - super(); - this.beeSlots = new ItemStack[SLOT_COUNT]; - } - - public void setOwner(EntityPlayer player) { - this.ownerName = player.getGameProfile(); - } - - @Override - public boolean shouldRenderInPass(int pass) { - return pass == 1; - } + private GameProfile ownerName; + private ItemStack[] beeSlots; + private IEffectData[] effectData = new IEffectData[2]; + private int throttle; + public int currentBeeHealth; + public int currentBeeColour; - public GameProfile getOwner() { - return this.ownerName; - } + public TileEntityEffectJar() { + super(); + this.beeSlots = new ItemStack[SLOT_COUNT]; + } - @Override - public int getSizeInventory() { - // Last slot reserved for "queen" - return this.beeSlots.length - 1; - } + public void setOwner(EntityPlayer player) { + this.ownerName = player.getGameProfile(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return beeSlots[slot]; - } + @Override + public boolean shouldRenderInPass(int pass) { + return pass == 1; + } - @Override - public void updateEntity() { - if (hasQueen()) { - tickQueen(); - } - else if (hasDrone()) { - createQueenFromDrone(); - } - } + public GameProfile getOwner() { + return this.ownerName; + } - private void createQueenFromDrone() { - ItemStack droneStack = this.beeSlots[DRONE_SLOT]; - if (magicbees.bees.BeeManager.beeRoot.isDrone(droneStack)) - { - IBee bee = magicbees.bees.BeeManager.beeRoot.getMember(droneStack); - if (droneStack.stackSize == 1) - { - this.beeSlots[DRONE_SLOT] = null; - } - else - { - droneStack.stackSize--; - } - - this.beeSlots[QUEEN_SLOT] = droneStack.copy(); - this.beeSlots[QUEEN_SLOT].stackSize = 1; - - int current = bee.getHealth(); - int max = bee.getMaxHealth(); - currentBeeHealth = (current * 100) / max; - currentBeeColour = bee.getGenome().getPrimary().getIconColour(0); - } - this.markDirty(); - } + @Override + public int getSizeInventory() { + // Last slot reserved for "queen" + return this.beeSlots.length - 1; + } - private boolean hasDrone() { - return this.beeSlots[DRONE_SLOT] != null; - } + @Override + public ItemStack getStackInSlot(int slot) { + return beeSlots[slot]; + } - private void tickQueen() { - IBee queen = magicbees.bees.BeeManager.beeRoot.getMember(this.beeSlots[QUEEN_SLOT]); + @Override + public void updateEntity() { + if (hasQueen()) { + tickQueen(); + } else if (hasDrone()) { + createQueenFromDrone(); + } + } - currentBeeHealth = (queen.getHealth() * 100) / queen.getMaxHealth(); - currentBeeColour = queen.getGenome().getPrimary().getIconColour(0); - - EffectJarHousing housingLogic = new EffectJarHousing(this); - this.effectData = queen.doEffect(this.effectData, housingLogic); - if (this.worldObj.getWorldTime() % 5 == 0) - { - this.effectData = queen.doFX(this.effectData, housingLogic); - } - - // run the queen - if (throttle > 550) - { - throttle = 0; - queen.age(this.worldObj, 0.26f); - - if (queen.getHealth() == 0) - { - this.beeSlots[QUEEN_SLOT] = null; - currentBeeHealth = 0; - currentBeeColour = 0x0ffffff; - } - else - { - queen.writeToNBT(this.beeSlots[QUEEN_SLOT].stackTagCompound); - } - this.markDirty(); - } - else - { - throttle++; - } - } + private void createQueenFromDrone() { + ItemStack droneStack = this.beeSlots[DRONE_SLOT]; + if (magicbees.bees.BeeManager.beeRoot.isDrone(droneStack)) { + IBee bee = magicbees.bees.BeeManager.beeRoot.getMember(droneStack); + if (droneStack.stackSize == 1) { + this.beeSlots[DRONE_SLOT] = null; + } else { + droneStack.stackSize--; + } - private boolean hasQueen() { - return this.beeSlots[QUEEN_SLOT] != null; - } + this.beeSlots[QUEEN_SLOT] = droneStack.copy(); + this.beeSlots[QUEEN_SLOT].stackSize = 1; - @Override - public ItemStack decrStackSize(int slot, int count) { - ItemStack value = null; - if (this.beeSlots[slot] != null) { - value = this.beeSlots[slot].copy(); - value.stackSize = Math.min(count, this.beeSlots[slot].stackSize); - this.beeSlots[slot].stackSize -= value.stackSize; - if (this.beeSlots[slot].stackSize == 0) { - this.beeSlots[slot] = null; - } - } - markDirty(); - return value; - } + int current = bee.getHealth(); + int max = bee.getMaxHealth(); + currentBeeHealth = (current * 100) / max; + currentBeeColour = bee.getGenome().getPrimary().getIconColour(0); + } + this.markDirty(); + } - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - ItemStack value = null; - if (this.beeSlots[slot] != null) { - value = this.beeSlots[slot]; - this.beeSlots[slot] = null; - } - markDirty(); - return value; - } + private boolean hasDrone() { + return this.beeSlots[DRONE_SLOT] != null; + } - @Override - public void readFromNBT(NBTTagCompound tagRoot) { - super.readFromNBT(tagRoot); - - NBTTagList nbttaglist = tagRoot.getTagList("Items", Constants.NBT.TAG_COMPOUND); - this.beeSlots = new ItemStack[SLOT_COUNT]; + private void tickQueen() { + IBee queen = magicbees.bees.BeeManager.beeRoot.getMember(this.beeSlots[QUEEN_SLOT]); - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); + currentBeeHealth = (queen.getHealth() * 100) / queen.getMaxHealth(); + currentBeeColour = queen.getGenome().getPrimary().getIconColour(0); - if (b0 >= 0 && b0 < this.beeSlots.length) { - this.beeSlots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - this.currentBeeHealth = tagRoot.getInteger("currentBeeHealth"); - this.throttle = tagRoot.getInteger("throttle"); - } + EffectJarHousing housingLogic = new EffectJarHousing(this); + this.effectData = queen.doEffect(this.effectData, housingLogic); + if (this.worldObj.getWorldTime() % 5 == 0) { + this.effectData = queen.doFX(this.effectData, housingLogic); + } - @Override - public void writeToNBT(NBTTagCompound tagRoot) { - super.writeToNBT(tagRoot); + // run the queen + if (throttle > 550) { + throttle = 0; + queen.age(this.worldObj, 0.26f); - NBTTagList inventory = new NBTTagList(); - for (int i = 0; i < this.beeSlots.length; ++i) { - if (this.beeSlots[i] != null) { - NBTTagCompound itemTag = new NBTTagCompound(); - itemTag.setByte("Slot", (byte)i); - this.beeSlots[i].writeToNBT(itemTag); - inventory.appendTag(itemTag); - } - } - tagRoot.setTag("Items", inventory); - tagRoot.setInteger("currentBeeHealth", this.currentBeeHealth); - tagRoot.setInteger("throttle", this.throttle); - } + if (queen.getHealth() == 0) { + this.beeSlots[QUEEN_SLOT] = null; + currentBeeHealth = 0; + currentBeeColour = 0x0ffffff; + } else { + queen.writeToNBT(this.beeSlots[QUEEN_SLOT].stackTagCompound); + } + this.markDirty(); + } else { + throttle++; + } + } - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - this.beeSlots[slot] = itemStack; - if (this.beeSlots[slot] != null) { - this.beeSlots[slot].stackSize = Math.min(this.beeSlots[slot].stackSize, - this.beeSlots[slot].getItem().getItemStackLimit(this.beeSlots[slot])); - } - this.markDirty(); - } + private boolean hasQueen() { + return this.beeSlots[QUEEN_SLOT] != null; + } - @Override - public String getInventoryName() { - return "container.effectJar"; - } + @Override + public ItemStack decrStackSize(int slot, int count) { + ItemStack value = null; + if (this.beeSlots[slot] != null) { + value = this.beeSlots[slot].copy(); + value.stackSize = Math.min(count, this.beeSlots[slot].stackSize); + this.beeSlots[slot].stackSize -= value.stackSize; + if (this.beeSlots[slot].stackSize == 0) { + this.beeSlots[slot] = null; + } + } + markDirty(); + return value; + } - @Override - public boolean hasCustomInventoryName() { - return false; - } + @Override + public ItemStack getStackInSlotOnClosing(int slot) { + ItemStack value = null; + if (this.beeSlots[slot] != null) { + value = this.beeSlots[slot]; + this.beeSlots[slot] = null; + } + markDirty(); + return value; + } - @Override - public int getInventoryStackLimit() { - return 64; - } + @Override + public void readFromNBT(NBTTagCompound tagRoot) { + super.readFromNBT(tagRoot); - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return true; - } + NBTTagList nbttaglist = tagRoot.getTagList("Items", Constants.NBT.TAG_COMPOUND); + this.beeSlots = new ItemStack[SLOT_COUNT]; - @Override - public boolean isItemValidForSlot(int i, ItemStack itemStack) { - return true; - } + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); - @Override - public void openInventory() { - } + if (b0 >= 0 && b0 < this.beeSlots.length) { + this.beeSlots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + this.currentBeeHealth = tagRoot.getInteger("currentBeeHealth"); + this.throttle = tagRoot.getInteger("throttle"); + } - @Override - public void closeInventory() { - } + @Override + public void writeToNBT(NBTTagCompound tagRoot) { + super.writeToNBT(tagRoot); + + NBTTagList inventory = new NBTTagList(); + for (int i = 0; i < this.beeSlots.length; ++i) { + if (this.beeSlots[i] != null) { + NBTTagCompound itemTag = new NBTTagCompound(); + itemTag.setByte("Slot", (byte) i); + this.beeSlots[i].writeToNBT(itemTag); + inventory.appendTag(itemTag); + } + } + tagRoot.setTag("Items", inventory); + tagRoot.setInteger("currentBeeHealth", this.currentBeeHealth); + tagRoot.setInteger("throttle", this.throttle); + } + + @Override + public void setInventorySlotContents(int slot, ItemStack itemStack) { + this.beeSlots[slot] = itemStack; + if (this.beeSlots[slot] != null) { + this.beeSlots[slot].stackSize = Math.min( + this.beeSlots[slot].stackSize, + this.beeSlots[slot].getItem().getItemStackLimit(this.beeSlots[slot])); + } + this.markDirty(); + } + + @Override + public String getInventoryName() { + return "container.effectJar"; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return true; + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemStack) { + return true; + } + + @Override + public void openInventory() {} + + @Override + public void closeInventory() {} } diff --git a/src/main/java/magicbees/tileentity/TileEntityMagicApiary.java b/src/main/java/magicbees/tileentity/TileEntityMagicApiary.java index 58c6dbc..46772ae 100644 --- a/src/main/java/magicbees/tileentity/TileEntityMagicApiary.java +++ b/src/main/java/magicbees/tileentity/TileEntityMagicApiary.java @@ -1,11 +1,26 @@ package magicbees.tileentity; +import com.mojang.authlib.GameProfile; +import forestry.api.apiculture.DefaultBeeListener; +import forestry.api.apiculture.DefaultBeeModifier; +import forestry.api.apiculture.IBee; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.apiculture.IBeeHousingInventory; +import forestry.api.apiculture.IBeeListener; +import forestry.api.apiculture.IBeeModifier; +import forestry.api.apiculture.IBeekeepingLogic; +import forestry.api.apiculture.IBeekeepingMode; +import forestry.api.apiculture.IHiveFrame; +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; +import forestry.api.core.ForestryAPI; +import forestry.api.core.IErrorLogic; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; - import magicbees.api.bees.IMagicApiaryAuraProvider; import magicbees.bees.AuraCharge; import magicbees.bees.BeeManager; @@ -32,24 +47,6 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.Constants; -import com.mojang.authlib.GameProfile; - -import forestry.api.apiculture.DefaultBeeListener; -import forestry.api.apiculture.DefaultBeeModifier; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeHousingInventory; -import forestry.api.apiculture.IBeeListener; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.apiculture.IBeekeepingLogic; -import forestry.api.apiculture.IBeekeepingMode; -import forestry.api.apiculture.IHiveFrame; -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; -import forestry.api.core.ForestryAPI; -import forestry.api.core.IErrorLogic; - public class TileEntityMagicApiary extends TileEntity implements ISidedInventory, IBeeHousing, ITileEntityAuraCharged { // Constants @@ -69,7 +66,7 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory private final MagicApiaryInventory inventory; private final AuraCharges auraCharges = new AuraCharges(); - public TileEntityMagicApiary(){ + public TileEntityMagicApiary() { beeLogic = BeeManager.beeRoot.createBeekeepingLogic(this); beeModifier = new MagicApiaryBeeModifier(this); beeListener = new MagicApiaryBeeListener(this); @@ -106,7 +103,7 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory } public void setOwner(EntityPlayer player) { - this.ownerProfile = player.getGameProfile(); + this.ownerProfile = player.getGameProfile(); } @Override @@ -179,7 +176,7 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory if (itemStack != null) { if (itemStack.stackSize <= j) { setInventorySlotContents(i, null); - }else{ + } else { itemStack = itemStack.splitStack(j); markDirty(); } @@ -222,14 +219,10 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory } @Override - public void openInventory() { - - } + public void openInventory() {} @Override - public void closeInventory() { - - } + public void closeInventory() {} @Override public boolean isItemValidForSlot(int i, ItemStack itemStack) { @@ -288,9 +281,8 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory public void updateEntity() { if (worldObj.isRemote) { updateClientSide(); - } - else { - updateServerSide(); + } else { + updateServerSide(); } } @@ -301,13 +293,12 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory } public void updateServerSide() { - if (this.auraProvider == null) { - findAuraProvider(); - } - else { - updateAuraProvider(); - } - tickCharges(); + if (this.auraProvider == null) { + findAuraProvider(); + } else { + updateAuraProvider(); + } + tickCharges(); if (beeLogic.canWork()) { beeLogic.doWork(); @@ -325,61 +316,63 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory public void sendGUINetworkData(Container container, ICrafting iCrafting) { iCrafting.sendProgressBarUpdate(container, 0, beeLogic.getBeeProgressPercent()); } - + public boolean isProductionBoosted() { return auraCharges.isActive(AuraCharge.PRODUCTION); } - + public boolean isDeathRateBoosted() { return auraCharges.isActive(AuraCharge.DEATH); } - + public boolean isMutationBoosted() { return auraCharges.isActive(AuraCharge.MUTATION); } - + private void updateAuraProvider() { - if (worldObj.getTotalWorldTime() % 10 != 0) { - return; - } - if (getAuraProvider(auraProviderPosition) == null) { - this.auraProvider = null; - this.auraProviderPosition = null; - return; - } - - boolean auraChargesChanged = false; + if (worldObj.getTotalWorldTime() % 10 != 0) { + return; + } + if (getAuraProvider(auraProviderPosition) == null) { + this.auraProvider = null; + this.auraProviderPosition = null; + return; + } + + boolean auraChargesChanged = false; for (AuraCharge charge : AuraCharge.values()) { if (!auraCharges.isActive(charge) && auraProvider.getCharge(charge.type)) { auraCharges.start(charge, worldObj); auraChargesChanged = true; } } - - if (auraChargesChanged) { + + if (auraChargesChanged) { NetworkEventHandler.getInstance().sendAuraChargeUpdate(this, auraCharges); - } + } } - + private void tickCharges() { boolean auraChargesChanged = false; for (AuraCharge charge : AuraCharge.values()) { - if (auraCharges.isActive(charge) && auraCharges.isExpired(charge, worldObj) && (auraProvider == null || !auraProvider.getCharge(charge.type))) { + if (auraCharges.isActive(charge) + && auraCharges.isExpired(charge, worldObj) + && (auraProvider == null || !auraProvider.getCharge(charge.type))) { auraCharges.stop(charge); auraChargesChanged = true; } } - if (auraChargesChanged) { - NetworkEventHandler.getInstance().sendAuraChargeUpdate(this, auraCharges); - } + if (auraChargesChanged) { + NetworkEventHandler.getInstance().sendAuraChargeUpdate(this, auraCharges); + } } private void findAuraProvider() { - if (worldObj.getTotalWorldTime() % 5 != 0) { - return; - } + if (worldObj.getTotalWorldTime() % 5 != 0) { + return; + } if (this.auraProviderPosition == null) { List chunks = getChunksInSearchRange(); @@ -395,67 +388,72 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory } } } - - private List getChunksInSearchRange() { - List chunks = new ArrayList(4); - chunks.add(worldObj.getChunkFromBlockCoords(xCoord - AURAPROVIDER_SEARCH_RADIUS, zCoord - AURAPROVIDER_SEARCH_RADIUS)); - Chunk chunk = worldObj.getChunkFromBlockCoords(xCoord + AURAPROVIDER_SEARCH_RADIUS, zCoord - AURAPROVIDER_SEARCH_RADIUS); - if (!chunks.contains(chunk)) { - chunks.add(chunk); - } - chunk = worldObj.getChunkFromBlockCoords(xCoord - AURAPROVIDER_SEARCH_RADIUS, zCoord + AURAPROVIDER_SEARCH_RADIUS); - if (!chunks.contains(chunk)) { - chunks.add(chunk); - } - chunk = worldObj.getChunkFromBlockCoords(xCoord + AURAPROVIDER_SEARCH_RADIUS, zCoord + AURAPROVIDER_SEARCH_RADIUS); - if (!chunks.contains(chunk)) { - chunks.add(chunk); - } - return chunks; - } - - @SuppressWarnings("unchecked") - private boolean searchChunkForBooster(Chunk chunk) { - Vec3 apiaryPos = Vec3.createVectorHelper(xCoord, yCoord, zCoord); - for (Map.Entry entry : ((Map)chunk.chunkTileEntityMap).entrySet()) { - TileEntity entity = entry.getValue(); - if (entity instanceof IMagicApiaryAuraProvider) { - Vec3 tePos = Vec3.createVectorHelper(entity.xCoord, entity.yCoord, entity.zCoord); - Vec3 result = apiaryPos.subtract(tePos); - if (result.lengthVector() <= AURAPROVIDER_SEARCH_RADIUS) { - saveAuraProviderPosition(entity.xCoord, entity.yCoord, entity.zCoord); - this.auraProvider = (IMagicApiaryAuraProvider)entity; - return true; - } - } - } - return false; - } - - private void saveAuraProviderPosition(int x, int y, int z) { - auraProviderPosition = new ChunkCoords(worldObj.provider.dimensionId, x, y, z); - } + + private List getChunksInSearchRange() { + List chunks = new ArrayList(4); + chunks.add(worldObj.getChunkFromBlockCoords( + xCoord - AURAPROVIDER_SEARCH_RADIUS, zCoord - AURAPROVIDER_SEARCH_RADIUS)); + Chunk chunk = worldObj.getChunkFromBlockCoords( + xCoord + AURAPROVIDER_SEARCH_RADIUS, zCoord - AURAPROVIDER_SEARCH_RADIUS); + if (!chunks.contains(chunk)) { + chunks.add(chunk); + } + chunk = worldObj.getChunkFromBlockCoords( + xCoord - AURAPROVIDER_SEARCH_RADIUS, zCoord + AURAPROVIDER_SEARCH_RADIUS); + if (!chunks.contains(chunk)) { + chunks.add(chunk); + } + chunk = worldObj.getChunkFromBlockCoords( + xCoord + AURAPROVIDER_SEARCH_RADIUS, zCoord + AURAPROVIDER_SEARCH_RADIUS); + if (!chunks.contains(chunk)) { + chunks.add(chunk); + } + return chunks; + } + + @SuppressWarnings("unchecked") + private boolean searchChunkForBooster(Chunk chunk) { + Vec3 apiaryPos = Vec3.createVectorHelper(xCoord, yCoord, zCoord); + for (Map.Entry entry : + ((Map) chunk.chunkTileEntityMap).entrySet()) { + TileEntity entity = entry.getValue(); + if (entity instanceof IMagicApiaryAuraProvider) { + Vec3 tePos = Vec3.createVectorHelper(entity.xCoord, entity.yCoord, entity.zCoord); + Vec3 result = apiaryPos.subtract(tePos); + if (result.lengthVector() <= AURAPROVIDER_SEARCH_RADIUS) { + saveAuraProviderPosition(entity.xCoord, entity.yCoord, entity.zCoord); + this.auraProvider = (IMagicApiaryAuraProvider) entity; + return true; + } + } + } + return false; + } + + private void saveAuraProviderPosition(int x, int y, int z) { + auraProviderPosition = new ChunkCoords(worldObj.provider.dimensionId, x, y, z); + } private IMagicApiaryAuraProvider getAuraProvider(ChunkCoords coords) { - return getAuraProvider(coords.x, coords.y, coords.z); - } - - private IMagicApiaryAuraProvider getAuraProvider(int x, int y, int z) { - Chunk chunk = worldObj.getChunkFromBlockCoords(x, z); - x %= 16; - z %= 16; - if (x < 0) { - x += 16; - } - if (z < 0) { - z += 16; - } - ChunkPosition cPos = new ChunkPosition(x, y, z); - TileEntity entity = (TileEntity)chunk.chunkTileEntityMap.get(cPos); + return getAuraProvider(coords.x, coords.y, coords.z); + } + + private IMagicApiaryAuraProvider getAuraProvider(int x, int y, int z) { + Chunk chunk = worldObj.getChunkFromBlockCoords(x, z); + x %= 16; + z %= 16; + if (x < 0) { + x += 16; + } + if (z < 0) { + z += 16; + } + ChunkPosition cPos = new ChunkPosition(x, y, z); + TileEntity entity = (TileEntity) chunk.chunkTileEntityMap.get(cPos); if (!(entity instanceof IMagicApiaryAuraProvider)) { return null; } - return (IMagicApiaryAuraProvider)entity; + return (IMagicApiaryAuraProvider) entity; } @Override @@ -516,12 +514,12 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory @Override public boolean addProduct(ItemStack product, boolean all) { - int countAdded = ItemStackUtils.addItemToInventory(magicApiary, product, SLOT_PRODUCTS_START, SLOT_PRODUCTS_COUNT); + int countAdded = + ItemStackUtils.addItemToInventory(magicApiary, product, SLOT_PRODUCTS_START, SLOT_PRODUCTS_COUNT); if (all) { return countAdded == product.stackSize; - } - else { + } else { return countAdded > 0; } } @@ -537,16 +535,15 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory public void setInventorySlotContents(int i, ItemStack itemStack) { items[i] = itemStack; - if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()){ + if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) { itemStack.stackSize = getInventoryStackLimit(); } } public int[] getAccessibleSlotsFromSide(int side) { if (side == 0 || side == 1) { - return new int[] { SLOT_QUEEN, SLOT_DRONE }; - } - else { + return new int[] {SLOT_QUEEN, SLOT_DRONE}; + } else { int[] slots = new int[SLOT_PRODUCTS_COUNT]; for (int i = 0, slot = SLOT_PRODUCTS_START; i < SLOT_PRODUCTS_COUNT; ++i, ++slot) { slots[i] = slot; @@ -556,18 +553,18 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory } public boolean canInsertItem(int slot, ItemStack itemStack, int side) { - if(slot == SLOT_QUEEN && BeeManager.beeRoot.isMember(itemStack) + if (slot == SLOT_QUEEN + && BeeManager.beeRoot.isMember(itemStack) && !BeeManager.beeRoot.isDrone(itemStack)) { return true; - } - else if (slot == SLOT_DRONE && BeeManager.beeRoot.isDrone(itemStack)) { + } else if (slot == SLOT_DRONE && BeeManager.beeRoot.isDrone(itemStack)) { return true; } return slot == SLOT_DRONE && BeeManager.beeRoot.isDrone(itemStack); } public boolean canExtractItem(int slot, ItemStack itemStack, int side) { - switch (slot){ + switch (slot) { case SLOT_FRAME_START: case SLOT_FRAME_START + 1: case SLOT_FRAME_START + 2: @@ -607,7 +604,7 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory if (itemStack != null) { NBTTagCompound item = new NBTTagCompound(); - item.setByte("Slot", (byte)i); + item.setByte("Slot", (byte) i); itemStack.writeToNBT(item); itemsNBT.appendTag(item); } @@ -683,7 +680,9 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(magicApiary.getWorldObj()); int wear = Math.round(amount * beekeepingMode.getWearModifier()); - for (int i = MagicApiaryInventory.SLOT_FRAME_START; i < MagicApiaryInventory.SLOT_FRAME_START + MagicApiaryInventory.SLOT_FRAME_COUNT; i++) { + for (int i = MagicApiaryInventory.SLOT_FRAME_START; + i < MagicApiaryInventory.SLOT_FRAME_START + MagicApiaryInventory.SLOT_FRAME_COUNT; + i++) { ItemStack hiveFrameStack = magicApiary.getStackInSlot(i); if (hiveFrameStack == null) { continue; diff --git a/src/main/java/magicbees/tileentity/TileEntityManaAuraProvider.java b/src/main/java/magicbees/tileentity/TileEntityManaAuraProvider.java index f194f71..a77a800 100644 --- a/src/main/java/magicbees/tileentity/TileEntityManaAuraProvider.java +++ b/src/main/java/magicbees/tileentity/TileEntityManaAuraProvider.java @@ -1,8 +1,8 @@ package magicbees.tileentity; +import cpw.mods.fml.common.Optional; import java.util.HashMap; import java.util.Map; - import magicbees.api.bees.AuraChargeType; import magicbees.api.bees.IMagicApiaryAuraProvider; import magicbees.bees.AuraCharge; @@ -13,149 +13,147 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import vazkii.botania.api.mana.IManaReceiver; -import cpw.mods.fml.common.Optional; @Optional.InterfaceList({ - @Optional.Interface(iface = "vazkii.botania.api.mana.IManaReceiver", modid = BotaniaHelper.Name) + @Optional.Interface(iface = "vazkii.botania.api.mana.IManaReceiver", modid = BotaniaHelper.Name) }) public class TileEntityManaAuraProvider extends TileEntity implements IMagicApiaryAuraProvider, IManaReceiver { - public static final String tileEntityName = CommonProxy.DOMAIN + ".manaAuraProvider"; - - private static final int MAX_CHARGES = 4; - private static final int MANA_PER_CHARGE = 4000; - private static final int MAX_MANA = MANA_PER_CHARGE * 4; - - private static class ManaAuraCharge { - int charges; - int mana; + public static final String tileEntityName = CommonProxy.DOMAIN + ".manaAuraProvider"; - public int[] toArray() { - return new int[]{charges, mana}; - } + private static final int MAX_CHARGES = 4; + private static final int MANA_PER_CHARGE = 4000; + private static final int MAX_MANA = MANA_PER_CHARGE * 4; - public void fromArray(int[] array) { - if (array.length == 2) { - charges = array[0]; - mana = array[1]; - } - } - } - - private final Map currentCharges; - private int currentMana; - - public TileEntityManaAuraProvider() { - super(); - - AuraCharge[] auraChargeTypes = AuraCharge.values(); - currentCharges = new HashMap(auraChargeTypes.length); - for (AuraCharge auraChargeType : auraChargeTypes) { - currentCharges.put(auraChargeType, new ManaAuraCharge()); - } - } - - @Override - public void updateEntity() { - long tick = worldObj.getTotalWorldTime(); - int manaForCharge = currentMana / 5; - - if (manaForCharge > 0) { - for (Map.Entry currentCharge : currentCharges.entrySet()) { - AuraCharge type = currentCharge.getKey(); - ManaAuraCharge auraCharge = currentCharge.getValue(); - - if (auraCharge.charges < MAX_CHARGES && (tick % type.tickRate) == 0 && currentMana > 0) { - auraCharge.mana += manaForCharge; - if (auraCharge.mana > MANA_PER_CHARGE) { - auraCharge.mana -= MANA_PER_CHARGE; - auraCharge.charges++; - } - } - } - } - } + private static class ManaAuraCharge { + int charges; + int mana; - @Override - public boolean getMutationCharge() { - return getCharge(AuraChargeType.MUTATION); - } + public int[] toArray() { + return new int[] {charges, mana}; + } - @Override - public boolean getDeathRateCharge() { - return getCharge(AuraChargeType.DEATH); - } + public void fromArray(int[] array) { + if (array.length == 2) { + charges = array[0]; + mana = array[1]; + } + } + } - @Override - public boolean getProductionCharge() { - return getCharge(AuraChargeType.PRODUCTION); - } + private final Map currentCharges; + private int currentMana; - @Override - public boolean getCharge(AuraChargeType auraChargeType) { - ManaAuraCharge charge = currentCharges.get(AuraCharge.fromChargeType(auraChargeType)); - if (charge == null) { - return false; - } - if (charge.charges > 0) { - charge.charges--; - return true; - } - return false; - } + public TileEntityManaAuraProvider() { + super(); - @Override - @Optional.Method(modid = BotaniaHelper.Name) - public int getCurrentMana() { - return currentMana; - } + AuraCharge[] auraChargeTypes = AuraCharge.values(); + currentCharges = new HashMap(auraChargeTypes.length); + for (AuraCharge auraChargeType : auraChargeTypes) { + currentCharges.put(auraChargeType, new ManaAuraCharge()); + } + } - @Override - @Optional.Method(modid = BotaniaHelper.Name) - public boolean canRecieveManaFromBursts() { - return true; - } + @Override + public void updateEntity() { + long tick = worldObj.getTotalWorldTime(); + int manaForCharge = currentMana / 5; - @Override - @Optional.Method(modid = BotaniaHelper.Name) - public boolean isFull() { - return currentMana == MAX_MANA; - } + if (manaForCharge > 0) { + for (Map.Entry currentCharge : currentCharges.entrySet()) { + AuraCharge type = currentCharge.getKey(); + ManaAuraCharge auraCharge = currentCharge.getValue(); - @Override - @Optional.Method(modid = BotaniaHelper.Name) - public void recieveMana(int amount) { - currentMana = (currentMana + amount > MAX_MANA) ? MAX_MANA : currentMana + amount; - } + if (auraCharge.charges < MAX_CHARGES && (tick % type.tickRate) == 0 && currentMana > 0) { + auraCharge.mana += manaForCharge; + if (auraCharge.mana > MANA_PER_CHARGE) { + auraCharge.mana -= MANA_PER_CHARGE; + auraCharge.charges++; + } + } + } + } + } - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); - - for (Map.Entry charge : currentCharges.entrySet()) { - String auraName = charge.getKey().toString(); - int[] array = tag.getIntArray(auraName); - ManaAuraCharge auraCharge = charge.getValue(); - auraCharge.fromArray(array); - } - } + @Override + public boolean getMutationCharge() { + return getCharge(AuraChargeType.MUTATION); + } - @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); - - for (Map.Entry charge : currentCharges.entrySet()) { - String auraName = charge.getKey().toString(); - ManaAuraCharge auraCharge = charge.getValue(); - int[] array = auraCharge.toArray(); - tag.setIntArray(auraName, array); - } - } - - @Override - public Packet getDescriptionPacket() { - NBTTagCompound compound = new NBTTagCompound(); - return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, compound); - } + @Override + public boolean getDeathRateCharge() { + return getCharge(AuraChargeType.DEATH); + } + @Override + public boolean getProductionCharge() { + return getCharge(AuraChargeType.PRODUCTION); + } + + @Override + public boolean getCharge(AuraChargeType auraChargeType) { + ManaAuraCharge charge = currentCharges.get(AuraCharge.fromChargeType(auraChargeType)); + if (charge == null) { + return false; + } + if (charge.charges > 0) { + charge.charges--; + return true; + } + return false; + } + + @Override + @Optional.Method(modid = BotaniaHelper.Name) + public int getCurrentMana() { + return currentMana; + } + + @Override + @Optional.Method(modid = BotaniaHelper.Name) + public boolean canRecieveManaFromBursts() { + return true; + } + + @Override + @Optional.Method(modid = BotaniaHelper.Name) + public boolean isFull() { + return currentMana == MAX_MANA; + } + + @Override + @Optional.Method(modid = BotaniaHelper.Name) + public void recieveMana(int amount) { + currentMana = (currentMana + amount > MAX_MANA) ? MAX_MANA : currentMana + amount; + } + + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + + for (Map.Entry charge : currentCharges.entrySet()) { + String auraName = charge.getKey().toString(); + int[] array = tag.getIntArray(auraName); + ManaAuraCharge auraCharge = charge.getValue(); + auraCharge.fromArray(array); + } + } + + @Override + public void writeToNBT(NBTTagCompound tag) { + super.writeToNBT(tag); + + for (Map.Entry charge : currentCharges.entrySet()) { + String auraName = charge.getKey().toString(); + ManaAuraCharge auraCharge = charge.getValue(); + int[] array = auraCharge.toArray(); + tag.setIntArray(auraName, array); + } + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound compound = new NBTTagCompound(); + return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, compound); + } } diff --git a/src/main/java/magicbees/tileentity/TileEntityVisAuraProvider.java b/src/main/java/magicbees/tileentity/TileEntityVisAuraProvider.java index 05d0dc9..dc45115 100644 --- a/src/main/java/magicbees/tileentity/TileEntityVisAuraProvider.java +++ b/src/main/java/magicbees/tileentity/TileEntityVisAuraProvider.java @@ -2,10 +2,9 @@ package magicbees.tileentity; import java.util.HashMap; import java.util.Map; - import magicbees.api.bees.AuraChargeType; -import magicbees.bees.AuraCharge; import magicbees.api.bees.IMagicApiaryAuraProvider; +import magicbees.bees.AuraCharge; import magicbees.main.CommonProxy; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -14,120 +13,120 @@ import thaumcraft.api.visnet.VisNetHandler; public class TileEntityVisAuraProvider extends TileEntity implements IMagicApiaryAuraProvider { - public static final String tileEntityName = CommonProxy.DOMAIN + ".visAuraProvider"; - - private static final int MAX_CHARGES = 10; - private static final int VIS_PER_CHARGE = 8; - private static Map aspectMap; - - static { - aspectMap = new HashMap(AuraChargeType.values().length); - aspectMap.put(AuraChargeType.MUTATION, Aspect.WATER); - aspectMap.put(AuraChargeType.DEATH, Aspect.ENTROPY); - aspectMap.put(AuraChargeType.PRODUCTION, Aspect.AIR); - } + public static final String tileEntityName = CommonProxy.DOMAIN + ".visAuraProvider"; - private static class VisAuraCharge { - int charges; - int vis; + private static final int MAX_CHARGES = 10; + private static final int VIS_PER_CHARGE = 8; + private static Map aspectMap; - public int[] toArray() { - return new int[]{charges, vis}; - } + static { + aspectMap = new HashMap(AuraChargeType.values().length); + aspectMap.put(AuraChargeType.MUTATION, Aspect.WATER); + aspectMap.put(AuraChargeType.DEATH, Aspect.ENTROPY); + aspectMap.put(AuraChargeType.PRODUCTION, Aspect.AIR); + } - public void fromArray(int[] array) { - if (array.length == 2) { - charges = array[0]; - vis = array[1]; - } - } - } + private static class VisAuraCharge { + int charges; + int vis; - private final Map currentCharges; + public int[] toArray() { + return new int[] {charges, vis}; + } - public TileEntityVisAuraProvider() { - super(); + public void fromArray(int[] array) { + if (array.length == 2) { + charges = array[0]; + vis = array[1]; + } + } + } - AuraCharge[] auraChargeTypes = AuraCharge.values(); - currentCharges = new HashMap(auraChargeTypes.length); - for (AuraCharge auraChargeType : auraChargeTypes) { - currentCharges.put(auraChargeType, new VisAuraCharge()); - } - } - - @Override - public void updateEntity() { - - long tick = worldObj.getTotalWorldTime(); + private final Map currentCharges; - for (Map.Entry currentCharge : currentCharges.entrySet()) { - AuraCharge type = currentCharge.getKey(); - VisAuraCharge auraCharge = currentCharge.getValue(); + public TileEntityVisAuraProvider() { + super(); - if (auraCharge.charges < MAX_CHARGES && (tick % type.tickRate) == 0) { - auraCharge.vis += getVisFromNet(aspectMap.get(type.type)); - if (auraCharge.vis >= VIS_PER_CHARGE) { - auraCharge.vis -= VIS_PER_CHARGE; - auraCharge.charges++; - } - } - } - } - - private int getVisFromNet(Aspect aspect) { - return VisNetHandler.drainVis(worldObj, xCoord, yCoord, zCoord, aspect, 1); - } + AuraCharge[] auraChargeTypes = AuraCharge.values(); + currentCharges = new HashMap(auraChargeTypes.length); + for (AuraCharge auraChargeType : auraChargeTypes) { + currentCharges.put(auraChargeType, new VisAuraCharge()); + } + } - @Override - public boolean getMutationCharge() { - return getCharge(AuraChargeType.MUTATION); - } + @Override + public void updateEntity() { - @Override - public boolean getDeathRateCharge() { - return getCharge(AuraChargeType.DEATH); - } + long tick = worldObj.getTotalWorldTime(); - @Override - public boolean getProductionCharge() { - return getCharge(AuraChargeType.PRODUCTION); - } + for (Map.Entry currentCharge : currentCharges.entrySet()) { + AuraCharge type = currentCharge.getKey(); + VisAuraCharge auraCharge = currentCharge.getValue(); - @Override - public boolean getCharge(AuraChargeType auraChargeType) { - VisAuraCharge auraCharge = currentCharges.get(AuraCharge.fromChargeType(auraChargeType)); - if (auraCharge == null) { - return false; - } - if (auraCharge.charges > 0) { - auraCharge.charges--; - return true; - } + if (auraCharge.charges < MAX_CHARGES && (tick % type.tickRate) == 0) { + auraCharge.vis += getVisFromNet(aspectMap.get(type.type)); + if (auraCharge.vis >= VIS_PER_CHARGE) { + auraCharge.vis -= VIS_PER_CHARGE; + auraCharge.charges++; + } + } + } + } - return false; - } + private int getVisFromNet(Aspect aspect) { + return VisNetHandler.drainVis(worldObj, xCoord, yCoord, zCoord, aspect, 1); + } - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); + @Override + public boolean getMutationCharge() { + return getCharge(AuraChargeType.MUTATION); + } - for (Map.Entry charge : currentCharges.entrySet()) { - String auraName = charge.getKey().toString(); - int[] array = tag.getIntArray(auraName); - VisAuraCharge auraCharge = charge.getValue(); - auraCharge.fromArray(array); - } - } + @Override + public boolean getDeathRateCharge() { + return getCharge(AuraChargeType.DEATH); + } - @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); + @Override + public boolean getProductionCharge() { + return getCharge(AuraChargeType.PRODUCTION); + } - for (Map.Entry charge : currentCharges.entrySet()) { - String auraName = charge.getKey().toString(); - VisAuraCharge auraCharge = charge.getValue(); - int[] array = auraCharge.toArray(); - tag.setIntArray(auraName, array); - } - } + @Override + public boolean getCharge(AuraChargeType auraChargeType) { + VisAuraCharge auraCharge = currentCharges.get(AuraCharge.fromChargeType(auraChargeType)); + if (auraCharge == null) { + return false; + } + if (auraCharge.charges > 0) { + auraCharge.charges--; + return true; + } + + return false; + } + + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + + for (Map.Entry charge : currentCharges.entrySet()) { + String auraName = charge.getKey().toString(); + int[] array = tag.getIntArray(auraName); + VisAuraCharge auraCharge = charge.getValue(); + auraCharge.fromArray(array); + } + } + + @Override + public void writeToNBT(NBTTagCompound tag) { + super.writeToNBT(tag); + + for (Map.Entry charge : currentCharges.entrySet()) { + String auraName = charge.getKey().toString(); + VisAuraCharge auraCharge = charge.getValue(); + int[] array = auraCharge.toArray(); + tag.setIntArray(auraName, array); + } + } } diff --git a/src/main/java/magicbees/world/feature/FeatureOreVein.java b/src/main/java/magicbees/world/feature/FeatureOreVein.java index 814861f..c43992d 100644 --- a/src/main/java/magicbees/world/feature/FeatureOreVein.java +++ b/src/main/java/magicbees/world/feature/FeatureOreVein.java @@ -1,83 +1,74 @@ package magicbees.world.feature; import java.util.Random; - +import magicbees.main.utils.BlockUtil; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; -import magicbees.main.utils.BlockUtil; +public class FeatureOreVein { + public static final FeatureOreVein redstoneGen; + public static final FeatureOreVein netherQuartzGen; + public static final FeatureOreVein glowstoneGen; + public static final FeatureOreVein endStoneGen; -public class FeatureOreVein -{ - public static final FeatureOreVein redstoneGen; - public static final FeatureOreVein netherQuartzGen; - public static final FeatureOreVein glowstoneGen; - public static final FeatureOreVein endStoneGen; + static { + redstoneGen = new FeatureOreVein(Blocks.redstone_ore, Blocks.stone); + netherQuartzGen = new FeatureOreVein(Blocks.quartz_ore, Blocks.netherrack); + glowstoneGen = new FeatureOreVein(Blocks.glowstone, Blocks.stone); + endStoneGen = new FeatureOreVein(Blocks.end_stone, Blocks.stone); + } - static - { - redstoneGen = new FeatureOreVein(Blocks.redstone_ore, Blocks.stone); - netherQuartzGen = new FeatureOreVein(Blocks.quartz_ore, Blocks.netherrack); - glowstoneGen = new FeatureOreVein(Blocks.glowstone, Blocks.stone); - endStoneGen = new FeatureOreVein(Blocks.end_stone, Blocks.stone); - } + private final Block veinBlock; + private final int veinBlockMeta; + private final Block replacesBlock; - private final Block veinBlock; - private final int veinBlockMeta; - private final Block replacesBlock; + public FeatureOreVein(Block block, Block replacesBlock) { + this(block, 0, replacesBlock); + } - public FeatureOreVein(Block block, Block replacesBlock) - { - this(block, 0, replacesBlock); - } + public FeatureOreVein(Block block, int meta, Block replacesBlock) { + this.veinBlock = block; + this.veinBlockMeta = meta; + this.replacesBlock = replacesBlock; + } - public FeatureOreVein(Block block, int meta, Block replacesBlock) - { - this.veinBlock = block; - this.veinBlockMeta = meta; - this.replacesBlock = replacesBlock; - } + public void generateVein(World world, Random random, int startX, int startY, int startZ, int maxSpawnCount) { + int currentX = startX; + int currentY = startY; + int currentZ = startZ; + int spawnAttempts = 0; + int spawnCount = 0; - public void generateVein(World world, Random random, int startX, int startY, int startZ, int maxSpawnCount) - { - int currentX = startX; - int currentY = startY; - int currentZ = startZ; - int spawnAttempts = 0; - int spawnCount = 0; + while (spawnCount < maxSpawnCount && spawnAttempts < maxSpawnCount * 2) { + ++spawnAttempts; - while (spawnCount < maxSpawnCount && spawnAttempts < maxSpawnCount * 2) - { - ++spawnAttempts; + if (!world.isAirBlock(currentX, currentY, currentZ) + && BlockUtil.canBlockReplaceAt(world, currentX, currentY, currentZ, replacesBlock)) { + world.setBlock(currentX, currentY, currentZ, this.veinBlock, this.veinBlockMeta, 2); + ++spawnCount; + } - if (!world.isAirBlock(currentX, currentY, currentZ) && BlockUtil.canBlockReplaceAt(world, currentX, currentY, currentZ, replacesBlock)) - { - world.setBlock(currentX, currentY, currentZ, this.veinBlock, this.veinBlockMeta, 2); - ++spawnCount; - } - - switch (random.nextInt(6)) - { - case 0: - ++currentY; - break; - case 1: - --currentY; - break; - case 2: - ++currentZ; - break; - case 3: - --currentZ; - break; - case 4: - ++currentX; - break; - case 5: - --currentX; - break; - } - } - } + switch (random.nextInt(6)) { + case 0: + ++currentY; + break; + case 1: + --currentY; + break; + case 2: + ++currentZ; + break; + case 3: + --currentZ; + break; + case 4: + ++currentX; + break; + case 5: + --currentX; + break; + } + } + } } diff --git a/src/main/java/magicbees/world/feature/HiveGenNether.java b/src/main/java/magicbees/world/feature/HiveGenNether.java index 0cd2aab..86950f3 100644 --- a/src/main/java/magicbees/world/feature/HiveGenNether.java +++ b/src/main/java/magicbees/world/feature/HiveGenNether.java @@ -6,29 +6,24 @@ import net.minecraft.world.World; public class HiveGenNether extends HiveGenUnderground { - public HiveGenNether(int minLevel, int range, int surroundCount) - { - super(minLevel, range, Blocks.netherrack, surroundCount); - } + public HiveGenNether(int minLevel, int range, int surroundCount) { + super(minLevel, range, Blocks.netherrack, surroundCount); + } - @Override - public int getYForHive(World world, int x, int z) - { - int y = super.getYForHive(world, x, z); + @Override + public int getYForHive(World world, int x, int z) { + int y = super.getYForHive(world, x, z); - if (!isValidLocation(world, x, y, z)) - { - int searchDirection = world.rand.nextBoolean() ? 4 : -4; - while (!Block.isEqualTo(world.getBlock(x, y, z), replace)) - { - y += searchDirection; - if (y < minLevel || y > minLevel + range) - { - return -1; - } - } - } + if (!isValidLocation(world, x, y, z)) { + int searchDirection = world.rand.nextBoolean() ? 4 : -4; + while (!Block.isEqualTo(world.getBlock(x, y, z), replace)) { + y += searchDirection; + if (y < minLevel || y > minLevel + range) { + return -1; + } + } + } - return y; - } + return y; + } } diff --git a/src/main/java/magicbees/world/feature/HiveGenOblivion.java b/src/main/java/magicbees/world/feature/HiveGenOblivion.java index 1c570e4..9c80920 100644 --- a/src/main/java/magicbees/world/feature/HiveGenOblivion.java +++ b/src/main/java/magicbees/world/feature/HiveGenOblivion.java @@ -1,63 +1,55 @@ package magicbees.world.feature; +import forestry.api.apiculture.hives.IHiveGen; +import magicbees.main.utils.BlockUtil; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; -import forestry.api.apiculture.hives.IHiveGen; - -import magicbees.main.utils.BlockUtil; - public class HiveGenOblivion implements IHiveGen { - @Override - public int getYForHive(World world, int x, int z) { + @Override + public int getYForHive(World world, int x, int z) { - int surface = world.getHeightValue(x, z); - if (surface == 0) - { - return -1; - } + int surface = world.getHeightValue(x, z); + if (surface == 0) { + return -1; + } - int y = 10; + int y = 10; - // get to the end stone - while (!Block.isEqualTo(world.getBlock(x, y - 1, z), Blocks.end_stone) && y < surface) - { - y += 8; - } + // get to the end stone + while (!Block.isEqualTo(world.getBlock(x, y - 1, z), Blocks.end_stone) && y < surface) { + y += 8; + } - // hive must be embedded one deep into the stone - while (!Block.isEqualTo(world.getBlock(x, y - 2, z), Blocks.air) && y > -1) - { - y--; - } + // hive must be embedded one deep into the stone + while (!Block.isEqualTo(world.getBlock(x, y - 2, z), Blocks.air) && y > -1) { + y--; + } - return y; - } + return y; + } - @Override - public boolean isValidLocation(World world, int x, int y, int z) { + @Override + public boolean isValidLocation(World world, int x, int y, int z) { - if (BlockUtil.getSurroundCount(world, x, y, z, Blocks.end_stone) != 6) - { - return false; - } + if (BlockUtil.getSurroundCount(world, x, y, z, Blocks.end_stone) != 6) { + return false; + } - for (int i = 2; i < 4; i++) - { - if (!world.isAirBlock(x, y - i, z)) - { - return false; - } - } + for (int i = 2; i < 4; i++) { + if (!world.isAirBlock(x, y - i, z)) { + return false; + } + } - return true; - } + return true; + } - @Override - public boolean canReplace(World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); - return Block.isEqualTo(block, Blocks.end_stone); - } + @Override + public boolean canReplace(World world, int x, int y, int z) { + Block block = world.getBlock(x, y, z); + return Block.isEqualTo(block, Blocks.end_stone); + } } diff --git a/src/main/java/magicbees/world/feature/HiveGenUnderground.java b/src/main/java/magicbees/world/feature/HiveGenUnderground.java index 27293c1..36126e9 100644 --- a/src/main/java/magicbees/world/feature/HiveGenUnderground.java +++ b/src/main/java/magicbees/world/feature/HiveGenUnderground.java @@ -1,47 +1,40 @@ package magicbees.world.feature; +import forestry.api.apiculture.hives.IHiveGen; +import magicbees.main.utils.BlockUtil; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; -import forestry.api.apiculture.hives.IHiveGen; +public class HiveGenUnderground implements IHiveGen { + protected final int minLevel; + protected final int range; + protected final Block replace; + private final int surroundCount; -import magicbees.main.utils.BlockUtil; + public HiveGenUnderground(int minLevel, int range, int surroundCount) { + this(minLevel, range, Blocks.stone, surroundCount); + } -public class HiveGenUnderground implements IHiveGen -{ - protected final int minLevel; - protected final int range; - protected final Block replace; - private final int surroundCount; + public HiveGenUnderground(int minLevel, int range, Block replace, int surroundCount) { + this.minLevel = minLevel; + this.range = range; + this.replace = replace; + this.surroundCount = surroundCount; + } - public HiveGenUnderground(int minLevel, int range, int surroundCount) { - this(minLevel, range, Blocks.stone, surroundCount); - } + @Override + public int getYForHive(World world, int x, int z) { + return minLevel + world.rand.nextInt(range); + } - public HiveGenUnderground(int minLevel, int range, Block replace, int surroundCount) - { - this.minLevel = minLevel; - this.range = range; - this.replace = replace; - this.surroundCount = surroundCount; - } + @Override + public boolean isValidLocation(World world, int x, int y, int z) { + return BlockUtil.getSurroundCount(world, x, y, z, replace) >= surroundCount; + } - @Override - public int getYForHive(World world, int x, int z) - { - return minLevel + world.rand.nextInt(range); - } - - @Override - public boolean isValidLocation(World world, int x, int y, int z) - { - return BlockUtil.getSurroundCount(world, x, y, z, replace) >= surroundCount; - } - - @Override - public boolean canReplace(World world, int x, int y, int z) - { - return !world.isAirBlock(x, y, z) && BlockUtil.canBlockReplaceAt(world, x, y, z, replace); - } + @Override + public boolean canReplace(World world, int x, int y, int z) { + return !world.isAirBlock(x, y, z) && BlockUtil.canBlockReplaceAt(world, x, y, z, replace); + } }