Merge pull request #113 from MagicBees/api_update

Use new bee API for species and mutations. For Forestry 4.2.1
This commit is contained in:
MysteriousAges committed 2016-01-12 17:23:41 -06:00
commit 3a3bc29155
27 files changed
+715 -1162

No files matched your search

+2 -2
View File
@@ -2,10 +2,10 @@ version_major=2
version_minor=4
version_rev=0
version_forestry=4.0.8.36
version_forestry=4.2.1.848-unstable
version_bloodmagic=1.3.3-4
version_botania=r1.7-221
version_baubles=1.0.1.10
version_mc=1.7.10
version_forge=10.13.2.1291
version_forge=10.13.4.1448-1.7.10
+7 -4
View File
@@ -29,6 +29,8 @@ import magicbees.main.utils.compat.ThaumcraftHelper;
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;
@@ -36,6 +38,7 @@ 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 {
@@ -109,7 +112,7 @@ public class Allele implements IAllele {
forestryBaseEffect = (IAlleleBeeEffect) getBaseAllele("effectNone");
IFlowerProvider vanillaFlowers = ((IAlleleFlowers)getBaseAllele("flowersVanilla")).getProvider();
speedBlinding = new AlleleFloat("speedBlinding", 2f, false);
speedBlinding = new AlleleFloat("speedBlinding", 2f, false, EnumBeeChromosome.SPEED);
flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true);
effectCleansing = new AlleleEffectCure("Curative", false);
@@ -258,7 +261,7 @@ public class Allele implements IAllele {
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", effectNodeConversionPure);
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", effectNodeConversionTaint);
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", effectNodeEmpower);
registry.registerDeprecatedAlleleReplacement("magicbees.speciesTCAttractive", BeeSpecies.TC_EMPOWERING);
registry.registerDeprecatedAlleleReplacement("magicbees.speciesTCAttractive", BeeSpecies.TC_EMPOWERING.getSpecies());
}
public static IAlleleBeeSpecies getBaseSpecies(String name) {
@@ -281,10 +284,10 @@ public class Allele implements IAllele {
private String uid;
private boolean dominant;
public Allele(String id, boolean isDominant) {
public Allele(String id, boolean isDominant, IChromosomeType... chromosomeTypes) {
this.uid = "magicbees." + id;
this.dominant = isDominant;
AlleleManager.alleleRegistry.registerAllele(this);
AlleleManager.alleleRegistry.registerAllele(this, chromosomeTypes);
}
@Override
@@ -3,10 +3,12 @@ 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;
@@ -19,7 +21,7 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
public AlleleEffect(String id, boolean isDominant, int timeout)
{
super("effect" + id, isDominant);
super("effect" + id, isDominant, EnumBeeChromosome.EFFECT);
this.throttle = timeout;
combinable = false;
}
@@ -68,7 +70,7 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
}
@SuppressWarnings("unchecked")
protected List<Entity> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing)
protected <T extends Entity> List<T> getEntitiesWithinRange(IBeeGenome genome, IBeeHousing housing, Class<T> entityClass)
{
// Get the size of the affected area
int[] area = genome.getTerritory();
@@ -87,7 +89,7 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
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<Entity>)housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, bounds);
return (List<T>)housing.getWorld().getEntitiesWithinAABB(entityClass, bounds);
}
}
@@ -1,14 +1,15 @@
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)
public AlleleFloat(String id, float val, boolean isDominant, IChromosomeType... chromosomeTypes)
{
super(id, isDominant);
super(id, isDominant, chromosomeTypes);
this.value = val;
}
@@ -1,5 +1,6 @@
package magicbees.bees;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAlleleFlowers;
import forestry.api.genetics.IFlowerProvider;
@@ -10,10 +11,8 @@ public class AlleleFlower extends Allele implements IAlleleFlowers
public AlleleFlower(String uid, IFlowerProvider flowerProvider, boolean isDominant)
{
super("flower" + uid, isDominant);
super("flower" + uid, isDominant, EnumBeeChromosome.FLOWER_PROVIDER);
this.provider = flowerProvider;
AlleleManager.alleleRegistry.registerAllele(this);
}
@Override
@@ -1,21 +0,0 @@
package magicbees.bees;
import forestry.api.genetics.IAlleleInteger;
public class AlleleInteger extends Allele implements IAlleleInteger
{
private int value;
public AlleleInteger(String id, int val, boolean isDominant)
{
super(id, isDominant);
this.value = val;
}
@Override
public int getValue()
{
return this.value;
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,23 @@
package magicbees.bees;
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;
}
}
}
@@ -0,0 +1,51 @@
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 magicbees.main.CommonProxy;
public enum BeeIconProvider implements IBeeIconProvider {
SKULKING(CommonProxy.DOMAIN + ":bees/skulking/"),
DOCTORAL(CommonProxy.DOMAIN + ":bees/doctoral/");
@SideOnly(Side.CLIENT)
private IIcon[][] icons;
private final String iconPath;
BeeIconProvider(String iconPath) {
this.iconPath = iconPath;
}
@Override
public void registerIcons(IIconRegister itemMap) {
this.icons = new IIcon[EnumBeeType.VALUES.length][3];
IIcon body1 = itemMap.registerIcon(iconPath + "body1");
for (int i = 0; i < EnumBeeType.VALUES.length; i++) {
EnumBeeType beeType = EnumBeeType.VALUES[i];
if (beeType == EnumBeeType.NONE)
continue;
String beeTypeIconPath = iconPath + beeType.toString().toLowerCase(Locale.ENGLISH);
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)];
}
}
+10 -10
View File
@@ -47,13 +47,13 @@ public class BeeManager
beeRoot.setResearchSuitability(Config.drops.getStackForType(DropType.INTELLECT), 0.5f);
}
public static ItemStack getDefaultItemStackForSpecies(IAlleleBeeSpecies species, EnumBeeType type) {
IBee bee = getBeeFromSpecies(species, false);
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 species, boolean applyRainResist) {
IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(species.getUID());
public static IBee getBeeFromSpecies(IAlleleBeeSpecies beeSpecies, boolean applyRainResist) {
IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(beeSpecies.getUID());
if (applyRainResist) {
speciesTemplate = BeeGenomeManager.addRainResist(speciesTemplate);
@@ -98,12 +98,12 @@ public class BeeManager
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(Allele.getExtraSpecies("Basalt"), 10.0));
}
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.MYSTICAL, 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.UNUSUAL, 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.SORCEROUS, 13.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.ATTUNED, 6.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.INFERNAL, 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.OBLIVION, 1.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.MYSTICAL.getSpecies(), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.UNUSUAL.getSpecies(), 20.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.SORCEROUS.getSpecies(), 13.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.ATTUNED.getSpecies(), 6.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.INFERNAL.getSpecies(), 10.0));
worldgenSpeciesWeights.add(new Tuple<IAlleleBeeSpecies, Double>(BeeSpecies.OBLIVION.getSpecies(), 1.0));
for (Tuple<IAlleleBeeSpecies, Double> t : worldgenSpeciesWeights) {
worldgenSpeciesWeightsTotal += t.right.doubleValue();
+213 -503
View File
@@ -1,9 +1,5 @@
package magicbees.bees;
import java.util.ArrayList;
import java.util.Collection;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.LogHelper;
import magicbees.main.utils.MoonPhase;
import magicbees.main.utils.compat.AppliedEnergisticsHelper;
@@ -16,28 +12,22 @@ 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 net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
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.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeModifier;
import forestry.api.apiculture.IBeeMutation;
import forestry.api.apiculture.IBeeRoot;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.apiculture.IBeeMutationCustom;
import forestry.api.apiculture.IBeeMutationFactory;
public class BeeMutation {
private static IBeeMutationFactory beeMutationFactory = forestry.api.apiculture.BeeManager.beeMutationFactory;
public class BeeMutation implements IBeeMutation {
public static void setupMutations() {
IAlleleBeeSpecies baseA, baseB;
BeeMutation mutation;
IBeeMutationCustom mutation;
// Forestry + These -> Common
@@ -47,631 +37,351 @@ public class BeeMutation implements IBeeMutation {
for (BeeSpecies species : magicMundane) {
for (String str : forestryMundane) {
new BeeMutation(species, Allele.getBaseSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
beeMutationFactory.createMutation(species.getSpecies(), Allele.getBaseSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
}
if (ExtraBeesHelper.isActive()) {
for (String str : binnieMundane) {
LogHelper.info("Registering " + str);
try {
new BeeMutation(species, Allele.getExtraSpecies(str), ForestryHelper.getTemplateForestryForSpecies("Common"), 15);
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.");
}
}
}
new BeeMutation(species, Allele.getBaseSpecies("Common"), ForestryHelper.getTemplateForestryForSpecies("Cultivated"), 12);
new BeeMutation(species, Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, 12);
beeMutationFactory.createMutation(species.getSpecies(), Allele.getBaseSpecies("Common"), ForestryHelper.getTemplateForestryForSpecies("Cultivated"), 12);
beeMutationFactory.createMutation(species.getSpecies(), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH.getGenome(), 12);
}
new BeeMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, BeeSpecies.ESOTERIC, 10);
new BeeMutation(BeeSpecies.ELDRITCH, BeeSpecies.ESOTERIC, BeeSpecies.MYSTERIOUS, 8);
new BeeMutation(BeeSpecies.ESOTERIC, BeeSpecies.MYSTERIOUS, BeeSpecies.ARCANE, 8)
.setMoonPhaseBonus(MoonPhase.WAXING_CRESCENT, MoonPhase.WAXING_GIBBOUS, 1.2f);
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));
new BeeMutation(Allele.getBaseSpecies("Cultivated"), BeeSpecies.ELDRITCH, BeeSpecies.CHARMED, 10);
new BeeMutation(BeeSpecies.ELDRITCH, BeeSpecies.CHARMED, BeeSpecies.ENCHANTED, 8);
new BeeMutation(BeeSpecies.CHARMED, BeeSpecies.ENCHANTED, BeeSpecies.SUPERNATURAL, 8)
.setMoonPhaseBonus(MoonPhase.WANING_GIBBOUS, MoonPhase.WANING_CRESCENT, 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));
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, 7);
beeMutationFactory.createMutation(BeeSpecies.ARCANE.getSpecies(), BeeSpecies.SUPERNATURAL.getSpecies(), BeeSpecies.ETHEREAL.getGenome(), 7);
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.WINDY, 14)
.setBlockRequired(Blocks.leaves);
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.WATERY, 14)
.setBlockRequired(Blocks.water);
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.EARTHY, 14)
.setBlockRequired(Blocks.brick_block);
new BeeMutation(BeeSpecies.SUPERNATURAL, BeeSpecies.ETHEREAL, BeeSpecies.FIREY, 14)
.setBlockRequired(Blocks.lava);
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);
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.ATTUNED, BeeSpecies.AWARE, 10);
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.AWARE, BeeSpecies.SPIRIT, 8);
new BeeMutation(BeeSpecies.ATTUNED, BeeSpecies.AWARE, BeeSpecies.SPIRIT, 8);
new BeeMutation(BeeSpecies.AWARE, BeeSpecies.SPIRIT, BeeSpecies.SOUL, 7);
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);
new BeeMutation(Allele.getBaseSpecies("Monastic"), BeeSpecies.ARCANE, BeeSpecies.PUPIL, 10);
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.PUPIL, BeeSpecies.SCHOLARLY, 8);
new BeeMutation(BeeSpecies.PUPIL, BeeSpecies.SCHOLARLY, BeeSpecies.SAVANT, 6);
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);
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ETHEREAL, BeeSpecies.TIMELY, 8);
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.TIMELY, BeeSpecies.LORDLY, 8);
new BeeMutation(BeeSpecies.TIMELY, BeeSpecies.LORDLY, BeeSpecies.DOCTORAL, 7);
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);
new BeeMutation(BeeSpecies.INFERNAL, BeeSpecies.ELDRITCH, BeeSpecies.HATEFUL, 9)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
new BeeMutation(BeeSpecies.INFERNAL, BeeSpecies.HATEFUL, BeeSpecies.SPITEFUL, 7)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
new BeeMutation(Allele.getBaseSpecies("Demonic"), BeeSpecies.SPITEFUL, BeeSpecies.WITHERING, 6)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
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);
new BeeMutation(Allele.getBaseSpecies("Modest"), BeeSpecies.ELDRITCH, BeeSpecies.SKULKING, 12);
new BeeMutation(Allele.getBaseSpecies("Tropical"), BeeSpecies.SKULKING, BeeSpecies.SPIDERY, 10);
new BeeMutation(BeeSpecies.BATTY, BeeSpecies.ETHEREAL, BeeSpecies.GHASTLY, 9);
new BeeMutation(BeeSpecies.GHASTLY, BeeSpecies.HATEFUL, BeeSpecies.SMOULDERING, 7)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.MYSTERIOUS, BeeSpecies.BIGBAD, 7)
.setMoonPhaseRestricted(MoonPhase.FULL);
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.CHICKEN, 12)
.setBiomeRequired(Type.FOREST);
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.BEEF, 12)
.setBiomeRequired(Type.PLAINS);
new BeeMutation(Allele.getBaseSpecies("Common"), BeeSpecies.SKULKING, BeeSpecies.PORK, 12)
.setBiomeRequired(Type.MOUNTAIN);
new BeeMutation(BeeSpecies.PORK, BeeSpecies.SKULKING, BeeSpecies.SHEEPISH, 13)
.setBiomeRequired(Type.PLAINS);
new BeeMutation(BeeSpecies.BEEF, BeeSpecies.SHEEPISH, BeeSpecies.HORSE, 12)
.setBiomeRequired(Type.PLAINS);
new BeeMutation(BeeSpecies.CHICKEN, BeeSpecies.SPIDERY, BeeSpecies.CATTY, 15)
.setBiomeRequired(Type.JUNGLE);
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.WINDY, BeeSpecies.BATTY, 9);
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()) {
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.PUPIL, BeeSpecies.BRAINY, 9);
beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.PUPIL.getSpecies(), BeeSpecies.BRAINY.getGenome(), 9);
}
else {
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.MUTABLE, BeeSpecies.BRAINY, 14);
beeMutationFactory.createMutation(BeeSpecies.SKULKING.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.BRAINY.getGenome(), 14);
}
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.OBLIVION, BeeSpecies.NAMELESS, 10);
new BeeMutation(BeeSpecies.OBLIVION, BeeSpecies.NAMELESS, BeeSpecies.ABANDONED, 8);
new BeeMutation(BeeSpecies.NAMELESS, BeeSpecies.ABANDONED, BeeSpecies.FORLORN, 6);
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.ABANDONED, BeeSpecies.DRACONIC, 6)
.setBiomeRequired(BiomeDictionary.Type.END);
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);
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.ELDRITCH, BeeSpecies.MUTABLE, 12);
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.TRANSMUTING, 9);
new BeeMutation(BeeSpecies.UNUSUAL, BeeSpecies.MUTABLE, BeeSpecies.CRUMBLING, 9);
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);
new BeeMutation(BeeSpecies.MYSTICAL, BeeSpecies.MUTABLE, BeeSpecies.INVISIBLE, 15);
beeMutationFactory.createMutation(BeeSpecies.MYSTICAL.getSpecies(), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.INVISIBLE.getGenome(), 15);
if (BeeSpecies.COPPER.isActive()) {
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Meadows"), BeeSpecies.COPPER, 12)
.setBlockRequired("blockCopper");
beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Meadows"), BeeSpecies.COPPER.getGenome(), 12)
.requireResource("blockCopper");
}
if (BeeSpecies.TIN.isActive()) {
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Forest"), BeeSpecies.TIN, 12)
.setBlockRequired("blockTin");
beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Forest"), BeeSpecies.TIN.getGenome(), 12)
.requireResource("blockTin");
}
new BeeMutation(Allele.getBaseSpecies("Common"), Allele.getBaseSpecies("Industrious"), BeeSpecies.IRON, 12)
.setBlockRequired(Blocks.iron_block);
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 : (BeeSpecies.COPPER.isActive()) ? BeeSpecies.COPPER : BeeSpecies.IRON;
mutation = new BeeMutation(baseA, Allele.getBaseSpecies("Common"), BeeSpecies.LEAD, 10);
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.setBlockRequired("blockLead");
mutation.requireResource("blockLead");
}
}
if (BeeSpecies.SILVER.isActive()) {
mutation = new BeeMutation(Allele.getBaseSpecies("Imperial"), Allele.getBaseSpecies("Modest"), BeeSpecies.SILVER, 8);
mutation = beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), Allele.getBaseSpecies("Modest"), BeeSpecies.SILVER.getGenome(), 8);
if (OreDictionary.getOres("blockSilver").size() > 0) {
mutation.setBlockRequired("blockSilver");
mutation.requireResource("blockSilver");
}
}
baseA = (BeeSpecies.EE_MINIUM.isActive()) ? BeeSpecies.EE_MINIUM : Allele.getBaseSpecies("Imperial");
baseB = (BeeSpecies.LEAD.isActive()) ? BeeSpecies.LEAD : BeeSpecies.IRON;
new BeeMutation(baseA, baseB, BeeSpecies.GOLD, 8)
.setBlockRequired(Blocks.gold_block);
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()) {
new BeeMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ALUMINUM, 10)
.setBlockRequired("blockAluminum");
beeMutationFactory.createMutation(Allele.getBaseSpecies("Industrious"), Allele.getBaseSpecies("Cultivated"), BeeSpecies.ALUMINUM.getGenome(), 10)
.requireResource("blockAluminum");
}
if (BeeSpecies.ARDITE.isActive()) {
new BeeMutation(Allele.getBaseSpecies("Industrious"), BeeSpecies.INFERNAL, BeeSpecies.ARDITE, 9)
.setBlockRequired("blockArdite");
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) {
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL, BeeSpecies.COBALT, 11)
.setBlockRequired("blockCobalt");
beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.COBALT.getGenome(), 11)
.requireResource("blockCobalt");
}
if (hasNaturalCobalt) {
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL, BeeSpecies.COBALT, 11)
.setBlockRequired("blockNaturalCobalt");
beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.COBALT.getGenome(), 11)
.requireResource("blockNaturalCobalt");
}
if (!(hasTConCobalt || hasNaturalCobalt)) {
new BeeMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL, BeeSpecies.COBALT, 7);
beeMutationFactory.createMutation(Allele.getBaseSpecies("Imperial"), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.COBALT.getGenome(), 7);
}
}
if (BeeSpecies.MANYULLYN.isActive()) {
new BeeMutation(BeeSpecies.ARDITE, BeeSpecies.COBALT, BeeSpecies.MANYULLYN, 9)
.setBlockRequired("blockManyullyn");
beeMutationFactory.createMutation(BeeSpecies.ARDITE.getSpecies(), BeeSpecies.COBALT.getSpecies(), BeeSpecies.MANYULLYN.getGenome(), 9)
.requireResource("blockManyullyn");
}
if (BeeSpecies.OSMIUM.isActive()) {
baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER : Allele.getBaseSpecies("Imperial");
baseB = (BeeSpecies.COBALT.isActive()) ? BeeSpecies.COBALT : BeeSpecies.INFERNAL;
mutation = new BeeMutation(baseA, baseB, BeeSpecies.OSMIUM, 11);
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.setBlockRequired("blockOsmium");
mutation.requireResource("blockOsmium");
}
}
new BeeMutation(Allele.getBaseSpecies("Austere"), BeeSpecies.GOLD, BeeSpecies.DIAMOND, 7)
.setBlockRequired(Blocks.diamond_block);
baseA = (BeeSpecies.SILVER.isActive()) ? BeeSpecies.SILVER : Allele.getBaseSpecies("Imperial");
new BeeMutation(Allele.getBaseSpecies("Austere"), baseA, BeeSpecies.EMERALD, 6)
.setBlockRequired(Blocks.emerald_block);
new BeeMutation(Allele.getBaseSpecies("Rural"), BeeSpecies.COPPER, BeeSpecies.APATITE, 12)
.setBlockRequired("blockApatite");
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 : BeeSpecies.EARTHY;
new BeeMutation(baseA, BeeSpecies.IRON, BeeSpecies.SILICON, 17);
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 : BeeSpecies.IRON;
baseB = (BeeSpecies.AE_SKYSTONE.isActive()) ? BeeSpecies.AE_SKYSTONE : BeeSpecies.EARTHY;
new BeeMutation(baseA, baseB, BeeSpecies.CERTUS, 13);
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;
baseA = BeeSpecies.CERTUS.getSpecies();
}
else if (BeeSpecies.SILICON.isActive()) {
baseA = BeeSpecies.SILICON;
baseA = BeeSpecies.SILICON.getSpecies();
}
else {
baseA = BeeSpecies.IRON;
baseA = BeeSpecies.IRON.getSpecies();
}
baseB = (BeeSpecies.AE_SKYSTONE.isActive()) ? BeeSpecies.AE_SKYSTONE : BeeSpecies.EARTHY;
new BeeMutation(baseA, baseB, BeeSpecies.FLUIX, 17);
baseB = (BeeSpecies.AE_SKYSTONE.isActive()) ? BeeSpecies.AE_SKYSTONE.getSpecies() : BeeSpecies.EARTHY.getSpecies();
beeMutationFactory.createMutation(baseA, baseB, BeeSpecies.FLUIX.getGenome(), 17);
}
if (ThaumcraftHelper.isActive()) {
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.WINDY, BeeSpecies.TC_AIR, 8)
.setBlockAndMetaRequired(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.AIR.ordinal());
new BeeMutation(BeeSpecies.FIREY, BeeSpecies.FIREY, BeeSpecies.TC_FIRE, 8)
.setBlockAndMetaRequired(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.FIRE.ordinal());
new BeeMutation(BeeSpecies.WATERY, BeeSpecies.WATERY, BeeSpecies.TC_WATER, 8)
.setBlockAndMetaRequired(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.WATER.ordinal());
new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.EARTHY, BeeSpecies.TC_EARTH, 8)
.setBlockAndMetaRequired(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.EARTH.ordinal());
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.ARCANE, BeeSpecies.TC_ORDER, 8)
.setBlockAndMetaRequired(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.ORDER.ordinal());
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.SUPERNATURAL, BeeSpecies.TC_CHAOS, 8)
.setBlockAndMetaRequired(ThaumcraftHelper.crystal, ThaumcraftHelper.ShardType.CHAOS.ordinal());
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());
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.INFERNAL, BeeSpecies.TC_VIS, 9)
.setMoonPhaseRestricted(MoonPhase.WAXING_HALF, MoonPhase.WANING_HALF);
new BeeMutation(BeeSpecies.ATTUNED, BeeSpecies.TC_VIS, BeeSpecies.TC_REJUVENATING, 8);
new BeeMutation(BeeSpecies.TC_VIS, BeeSpecies.TC_REJUVENATING, BeeSpecies.TC_EMPOWERING, 6)
.setMoonPhaseBonus(MoonPhase.FULL, MoonPhase.FULL, 1.322f);
new BeeMutation(BeeSpecies.TC_REJUVENATING, BeeSpecies.TC_EMPOWERING, BeeSpecies.TC_NEXUS, 10)
.setBiomeRequired(Type.MAGICAL)
.setBlockAndMetaRequired(ThaumcraftHelper.airy, ThaumcraftHelper.AiryBlockType.NODE.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());
new BeeMutation(BeeSpecies.TRANSMUTING, BeeSpecies.TC_EMPOWERING, BeeSpecies.TC_TAINT, 11)
.setMoonPhaseRestricted(MoonPhase.NEW);
new BeeMutation(BeeSpecies.TRANSMUTING, BeeSpecies.TC_REJUVENATING, BeeSpecies.TC_PURE, 8)
.setBiomeRequired(Type.MAGICAL)
.setMoonPhaseRestricted(MoonPhase.NEW);
new BeeMutation(BeeSpecies.BIGBAD, BeeSpecies.TC_VIS, BeeSpecies.TC_HUNGRY, 20);
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);
new BeeMutation(BeeSpecies.ETHEREAL, BeeSpecies.GHASTLY, BeeSpecies.TC_WISPY, 9)
.setMoonPhaseRestricted(MoonPhase.WANING_CRESCENT, MoonPhase.WAXING_CRESCENT);
beeMutationFactory.createMutation(BeeSpecies.ETHEREAL.getSpecies(), BeeSpecies.GHASTLY.getSpecies(), BeeSpecies.TC_WISPY.getGenome(), 9)
.addMutationCondition(new MoonPhaseMutationRestriction(MoonPhase.WANING_CRESCENT, MoonPhase.WAXING_CRESCENT));
new BeeMutation(BeeSpecies.IRON, BeeSpecies.TC_TAINT, BeeSpecies.TC_VOID, 5)
.setBiomeRequired(Type.MAGICAL)
.setRequiresNight();
beeMutationFactory.createMutation(BeeSpecies.IRON.getSpecies(), BeeSpecies.TC_TAINT.getSpecies(), BeeSpecies.TC_VOID.getGenome(), 5)
.restrictBiomeType(Type.MAGICAL)
.requireNight();
}
if (ArsMagicaHelper.isActive()) {
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.ETHEREAL, BeeSpecies.AM_ESSENCE, 10);
new BeeMutation(BeeSpecies.ARCANE, BeeSpecies.AM_ESSENCE, BeeSpecies.AM_QUINTESSENCE, 7);
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);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.WINDY, BeeSpecies.AM_AIR, 10);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.EARTHY, BeeSpecies.AM_EARTH, 10);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.FIREY, BeeSpecies.AM_FIRE, 10);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.WATERY, BeeSpecies.AM_WATER, 10);
new BeeMutation(BeeSpecies.AM_ESSENCE, BeeSpecies.ETHEREAL, BeeSpecies.AM_ARCANE, 10);
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);
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.AM_AIR, BeeSpecies.AM_LIGHTNING, 8);
new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.AM_EARTH, BeeSpecies.AM_PLANT, 8);
new BeeMutation(BeeSpecies.WATERY, BeeSpecies.AM_WATER, BeeSpecies.AM_ICE, 8);
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);
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.AM_ESSENCE, BeeSpecies.AM_VORTEX, 8);
new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.GHASTLY, BeeSpecies.AM_WIGHT, 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()) {
new BeeMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE, BeeSpecies.EE_MINIUM, 8);
beeMutationFactory.createMutation(Allele.getBaseSpecies("Frugal"), BeeSpecies.MUTABLE.getSpecies(), BeeSpecies.EE_MINIUM.getGenome(), 8);
}
if (BloodMagicHelper.isActive()) {
new BeeMutation(BeeSpecies.ELDRITCH, BeeSpecies.EARTHY, BeeSpecies.BM_BLOODY, 13)
.setMoonPhaseBonus(MoonPhase.WANING_CRESCENT, MoonPhase.WAXING_CRESCENT, 0.85f)
.setBlockRequired(BloodMagicHelper.bloodStoneBrick);
beeMutationFactory.createMutation(BeeSpecies.ELDRITCH.getSpecies(), BeeSpecies.EARTHY.getSpecies(), BeeSpecies.BM_BLOODY.getGenome(), 13)
.addMutationCondition(new MoonPhaseMutationBonus(MoonPhase.WANING_CRESCENT, 0.85f))
.requireResource(BloodMagicHelper.bloodStoneBrick, 0);
new BeeMutation(BeeSpecies.BM_BLOODY, BeeSpecies.ARCANE, BeeSpecies.BM_BOUND, 8);
beeMutationFactory.createMutation(BeeSpecies.BM_BLOODY.getSpecies(), BeeSpecies.ARCANE.getSpecies(), BeeSpecies.BM_BOUND.getGenome(), 8);
}
if (RedstoneArsenalHelper.isActive()) {
new BeeMutation(BeeSpecies.TE_ELECTRUM, BeeSpecies.TE_DESTABILIZED, BeeSpecies.RSA_FLUXED, 10)
.setBlockRequired("blockElectrumFlux");
beeMutationFactory.createMutation(BeeSpecies.TE_ELECTRUM.getSpecies(), BeeSpecies.TE_DESTABILIZED.getSpecies(), BeeSpecies.RSA_FLUXED.getGenome(), 10)
.requireResource("blockElectrumFlux");
}
if (ThermalModsHelper.isActive()) {
new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12)
.setBlockRequired("blockBronze");
beeMutationFactory.createMutation(BeeSpecies.TIN.getSpecies(), BeeSpecies.COPPER.getSpecies(), BeeSpecies.TE_BRONZE.getGenome(), 12)
.requireResource("blockBronze");
new BeeMutation(BeeSpecies.GOLD, BeeSpecies.SILVER, BeeSpecies.TE_ELECTRUM, 10)
.setBlockRequired("blockElectrum");
beeMutationFactory.createMutation(BeeSpecies.GOLD.getSpecies(), BeeSpecies.SILVER.getSpecies(), BeeSpecies.TE_ELECTRUM.getGenome(), 10)
.requireResource("blockElectrum");
new BeeMutation(BeeSpecies.IRON, BeeSpecies.ESOTERIC, BeeSpecies.TE_NICKEL, 14)
.setBlockRequired("blockNickel");
beeMutationFactory.createMutation(BeeSpecies.IRON.getSpecies(), BeeSpecies.ESOTERIC.getSpecies(), BeeSpecies.TE_NICKEL.getGenome(), 14)
.requireResource("blockNickel");
new BeeMutation(BeeSpecies.IRON, BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, 14)
.setBlockRequired("blockInvar");
beeMutationFactory.createMutation(BeeSpecies.IRON.getSpecies(), BeeSpecies.TE_NICKEL.getSpecies(), BeeSpecies.TE_INVAR.getGenome(), 14)
.requireResource("blockInvar");
new BeeMutation(BeeSpecies.TE_NICKEL, BeeSpecies.TE_INVAR, BeeSpecies.TE_PLATINUM, 10)
.setBlockRequired("blockPlatinum");
beeMutationFactory.createMutation(BeeSpecies.TE_NICKEL.getSpecies(), BeeSpecies.TE_INVAR.getSpecies(), BeeSpecies.TE_PLATINUM.getGenome(), 10)
.requireResource("blockPlatinum");
new BeeMutation(BeeSpecies.TIN, BeeSpecies.COPPER, BeeSpecies.TE_BRONZE, 12)
.setBlockRequired("blockBronze");
beeMutationFactory.createMutation(BeeSpecies.TIN.getSpecies(), BeeSpecies.COPPER.getSpecies(), BeeSpecies.TE_BRONZE.getGenome(), 12)
.requireResource("blockBronze");
new BeeMutation(BeeSpecies.SPITEFUL, BeeSpecies.TIN, BeeSpecies.TE_COAL, 12)
.setBlockRequired(Blocks.coal_ore);
beeMutationFactory.createMutation(BeeSpecies.SPITEFUL.getSpecies(), BeeSpecies.TIN.getSpecies(), BeeSpecies.TE_COAL.getGenome(), 12)
.requireResource(Blocks.coal_ore, 0);
new BeeMutation(BeeSpecies.SPITEFUL, Allele.getBaseSpecies("Industrious"), BeeSpecies.TE_DESTABILIZED, 12)
.setBlockRequired(Blocks.redstone_ore);
beeMutationFactory.createMutation(BeeSpecies.SPITEFUL.getSpecies(), Allele.getBaseSpecies("Industrious"), BeeSpecies.TE_DESTABILIZED.getGenome(), 12)
.requireResource(Blocks.redstone_ore, 0);
new BeeMutation(BeeSpecies.SMOULDERING, BeeSpecies.INFERNAL, BeeSpecies.TE_LUX, 12)
.setBlockRequired(Blocks.glowstone);
beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), BeeSpecies.INFERNAL.getSpecies(), BeeSpecies.TE_LUX.getGenome(), 12)
.requireResource(Blocks.glowstone, 0);
new BeeMutation(BeeSpecies.SMOULDERING, Allele.getBaseSpecies("Austere"), BeeSpecies.TE_DANTE, 12)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
beeMutationFactory.createMutation(BeeSpecies.SMOULDERING.getSpecies(), Allele.getBaseSpecies("Austere"), BeeSpecies.TE_DANTE.getGenome(), 12)
.restrictBiomeType(BiomeDictionary.Type.NETHER);
new BeeMutation(BeeSpecies.TE_DANTE, BeeSpecies.TE_COAL, BeeSpecies.TE_PYRO, 8)
.setBiomeRequired(BiomeDictionary.Type.NETHER);
beeMutationFactory.createMutation(BeeSpecies.TE_DANTE.getSpecies(), BeeSpecies.TE_COAL.getSpecies(), BeeSpecies.TE_PYRO.getGenome(), 8)
.restrictBiomeType(BiomeDictionary.Type.NETHER);
new BeeMutation(BeeSpecies.SKULKING, Allele.getBaseSpecies("Wintry"), BeeSpecies.TE_BLIZZY, 12);
new BeeMutation(BeeSpecies.TE_BLIZZY, Allele.getBaseSpecies("Icy"), BeeSpecies.TE_GELID, 8);
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);
new BeeMutation(BeeSpecies.SMOULDERING, BeeSpecies.WINDY, BeeSpecies.TE_SHOCKING, 13);
new BeeMutation(BeeSpecies.TE_SHOCKING, BeeSpecies.WINDY, BeeSpecies.TE_AMPED, 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);
new BeeMutation(BeeSpecies.SMOULDERING, BeeSpecies.EARTHY, BeeSpecies.TE_GROUNDED, 12);
new BeeMutation(BeeSpecies.TE_GROUNDED, BeeSpecies.EARTHY, BeeSpecies.TE_ROCKING, 9);
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);
new BeeMutation(BeeSpecies.TE_PLATINUM, BeeSpecies.OBLIVION, BeeSpecies.TE_WINSOME, 12);
beeMutationFactory.createMutation(BeeSpecies.TE_PLATINUM.getSpecies(), BeeSpecies.OBLIVION.getSpecies(), BeeSpecies.TE_WINSOME.getGenome(), 12);
new BeeMutation(BeeSpecies.TE_WINSOME, BeeSpecies.TE_COAL, BeeSpecies.TE_ENDEARING, 8)
.setBlockRequired("blockEnderium");
beeMutationFactory.createMutation(BeeSpecies.TE_WINSOME.getSpecies(), BeeSpecies.TE_COAL.getSpecies(), BeeSpecies.TE_ENDEARING.getGenome(), 8)
.requireResource("blockEnderium");
}
if (BotaniaHelper.isActive()) {
new BeeMutation(BeeSpecies.ELDRITCH, Allele.getBaseSpecies("Forest"), BeeSpecies.BOT_ROOTED, 15)
.setBlockRequired(BotaniaHelper.blockLivingWood);
beeMutationFactory.createMutation(BeeSpecies.ELDRITCH.getSpecies(), Allele.getBaseSpecies("Forest"), BeeSpecies.BOT_ROOTED.getGenome(), 15)
.requireResource(BotaniaHelper.blockLivingWood, 0);
new BeeMutation(BeeSpecies.BOT_ROOTED, BeeSpecies.WATERY, BeeSpecies.BOT_SOMNOLENT, 16)
.setRequiresNight();
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.BOT_SOMNOLENT, BeeSpecies.BOT_DREAMING, 8)
.setRequiresNight();
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();
new BeeMutation(BeeSpecies.BOT_BOTANIC, BeeSpecies.EARTHY, BeeSpecies.BOT_BLOSSOM, 12);
new BeeMutation(BeeSpecies.BOT_BOTANIC, BeeSpecies.BOT_BLOSSOM, BeeSpecies.BOT_FLORAL, 8);
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()) {
new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.WINDY, BeeSpecies.AE_SKYSTONE, 20)
.setBlockRequired(AppliedEnergisticsHelper.skystone);
beeMutationFactory.createMutation(BeeSpecies.EARTHY.getSpecies(), BeeSpecies.WINDY.getSpecies(), BeeSpecies.AE_SKYSTONE.getGenome(), 20)
.requireResource(AppliedEnergisticsHelper.skystone, 0);
}
}
}
private IAlleleSpecies parent1;
private IAlleleSpecies parent2;
private IAllele mutationTemplate[];
private int baseChance;
private boolean isSecret;
private boolean isMoonRestricted;
private MoonPhase moonPhaseStart;
private MoonPhase moonPhaseEnd;
private float moonPhaseMutationBonus;
private boolean requiresNight;
private boolean requiresBlock;
private Block requiredBlock;
private int requiredBlockMeta;
private String requiredBlockOreDictEntry;
private String requiredBlockName;
private BiomeDictionary.Type requiredBiomeType;
public BeeMutation(IAlleleBeeSpecies species0, IAlleleBeeSpecies species1, BeeSpecies resultSpecies, int percentChance) {
this(species0, species1, resultSpecies.getGenome(), percentChance);
}
public BeeMutation(IAlleleBeeSpecies species0, IAlleleBeeSpecies species1, IAllele[] resultSpeciesGenome, int percentChance) {
this.parent1 = species0;
this.parent2 = species1;
this.mutationTemplate = resultSpeciesGenome;
this.baseChance = percentChance;
this.isSecret = false;
this.isMoonRestricted = false;
this.moonPhaseMutationBonus = -1f;
this.requiresNight = false;
this.requiresBlock = false;
this.requiredBlockMeta = OreDictionary.WILDCARD_VALUE;
this.requiredBlockOreDictEntry = null;
this.requiredBiomeType = null;
this.requiredBlockName = null;
BeeManager.beeRoot.registerMutation(this);
}
@Override
public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1) {
float finalChance = 0f;
float chance = this.baseChance * 1f;
ChunkCoordinates housingCoords = housing.getCoordinates();
if (this.arePartners(allele0, allele1)) {
// This mutation applies. Continue calculation.
if (this.moonPhaseStart != null && this.moonPhaseEnd != null) {
// Only occurs during the phases.
if (this.isMoonRestricted && !MoonPhase.getMoonPhase(housing.getWorld()).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) {
chance = 0;
}
else if (this.moonPhaseMutationBonus != -1f) {
// There is a bonus to this mutation during moon phases...
if (MoonPhase.getMoonPhase(housing.getWorld()).isBetween(this.moonPhaseStart, this.moonPhaseEnd)) {
chance = (int)(chance * this.moonPhaseMutationBonus);
}
}
}
if (this.requiresBlock) {
Block blockBelow;
int blockMeta;
int i = 1;
do {
blockBelow = housing.getWorld().getBlock(housingCoords.posX, housingCoords.posY - i, housingCoords.posZ);
blockMeta = housing.getWorld().getBlockMetadata(housingCoords.posX, housingCoords.posY - i, housingCoords.posZ);
++i;
}
while (blockBelow != null && (blockBelow instanceof IBeeHousing || blockBelow == ForestryHelper.alvearyBlock));
if (this.requiredBlockOreDictEntry != null) {
int[] dicId = OreDictionary.getOreIDs(new ItemStack(blockBelow, 1, blockMeta));
if (dicId.length != 0) {
if (!OreDictionary.getOreName(dicId[0]).equals(this.requiredBlockOreDictEntry)) {
chance = 0;
}
}
else {
chance = 0;
}
}
else if (this.requiredBlock != blockBelow ||
(this.requiredBlockMeta != OreDictionary.WILDCARD_VALUE && this.requiredBlockMeta != blockMeta)) {
chance = 0;
}
}
if (this.requiredBiomeType != null) {
BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(housing.getWorld().getBiomeGenForCoords(housingCoords.posX, housingCoords.posZ));
boolean found = false;
for (Type type : types) {
if (this.requiredBiomeType == type) {
found = true;
break;
}
}
if (!found) {
chance = 0;
}
}
if (this.requiresNight) {
if (!housing.getWorld().isDaytime()) {
chance = 0;
}
}
IBeeModifier housingBeeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
IBeeModifier modeBeeModifier = BeeManager.beeRoot.getBeekeepingMode(housing.getWorld()).getBeeModifier();
finalChance = Math.round(chance
* housingBeeModifier.getMutationModifier(genome0, genome1, chance)
* modeBeeModifier.getMutationModifier(genome0, genome1, chance));
}
return finalChance;
}
@Override
public IAlleleSpecies getAllele0() {
return parent1;
}
@Override
public IAlleleSpecies getAllele1() {
return parent2;
}
@Override
public IAllele[] getTemplate() {
return mutationTemplate;
}
@Override
public float getBaseChance() {
return baseChance;
}
@Override
public boolean isPartner(IAllele allele) {
return parent1.getUID().equals(allele.getUID()) || parent2.getUID().equals(allele.getUID());
}
@Override
public IAllele getPartner(IAllele allele) {
IAllele val = parent1;
if (val.getUID().equals(allele.getUID()))
val = parent2;
return val;
}
@Override
public Collection<String> getSpecialConditions() {
ArrayList<String> conditions = new ArrayList<String>();
if (this.isMoonRestricted && moonPhaseStart != null && moonPhaseEnd != null) {
if (moonPhaseStart != moonPhaseEnd) {
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresPhase"),
moonPhaseStart.getLocalizedNameAlt(), moonPhaseEnd.getLocalizedNameAlt()));
}
else {
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresPhaseSingle"),
moonPhaseStart.getLocalizedName()));
}
}
if (this.requiresBlock) {
if (this.requiredBlockName != null) {
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"),
LocalizationManager.getLocalizedString(this.requiredBlockName)));
}
else if (this.requiredBlockOreDictEntry != null) {
ArrayList<ItemStack> ores = OreDictionary.getOres(this.requiredBlockOreDictEntry);
if (ores != null && 0 < ores.size()) {
String displayName = ores.get(0).getDisplayName();
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"), displayName));
}
}
else if (this.requiredBlock != null) {
int meta = OreDictionary.WILDCARD_VALUE;
if (this.requiredBlockMeta != OreDictionary.WILDCARD_VALUE) {
meta = this.requiredBlockMeta;
}
String displayName = new ItemStack(this.requiredBlock, 1, meta).getDisplayName();
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBlock"), displayName));
}
}
if (this.requiredBiomeType != null) {
String biomeName = this.requiredBiomeType.name().substring(0, 1) + this.requiredBiomeType.name().substring(1).toLowerCase();
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBiome"), biomeName));
}
if (this.requiresNight) {
conditions.add(LocalizationManager.getLocalizedString("research.requiresNight"));
}
return conditions;
}
@Override
public IBeeRoot getRoot() {
return BeeManager.beeRoot;
}
public boolean arePartners(IAllele alleleA, IAllele alleleB) {
return (this.parent1.getUID().equals(alleleA.getUID())) && this.parent2.getUID().equals(alleleB.getUID()) ||
this.parent1.getUID().equals(alleleB.getUID()) && this.parent2.getUID().equals(alleleA.getUID());
}
public BeeMutation setSecret() {
this.isSecret = true;
return this;
}
public boolean isSecret() {
return isSecret;
}
public BeeMutation setBlockRequired(Block block) {
this.requiresBlock = true;
this.requiredBlock = block;
return this;
}
public BeeMutation setBlockAndMetaRequired(Block block, int meta) {
this.requiresBlock = true;
this.requiredBlock = block;
this.requiredBlockMeta = meta;
return this;
}
public BeeMutation setBlockRequired(String oreDictEntry) {
this.requiresBlock = true;
this.requiredBlockOreDictEntry = oreDictEntry;
return this;
}
public BeeMutation setBlockRequiredNameOverride(String blockName) {
this.requiredBlockName = blockName;
return this;
}
public BeeMutation setMoonPhaseRestricted(MoonPhase phase) {
setMoonPhaseRestricted(phase, phase);
return this;
}
public BeeMutation setMoonPhaseRestricted(MoonPhase begin, MoonPhase end) {
this.isMoonRestricted = true;
this.moonPhaseStart = begin;
this.moonPhaseEnd = end;
return this;
}
public BeeMutation setMoonPhaseBonus(MoonPhase begin, MoonPhase end, float mutationBonus) {
this.moonPhaseMutationBonus = mutationBonus;
this.moonPhaseStart = begin;
this.moonPhaseEnd = end;
return this;
}
public BeeMutation setBiomeRequired(BiomeDictionary.Type biomeType) {
this.requiredBiomeType = biomeType;
return this;
}
public BeeMutation setRequiresNight() {
this.requiresNight = true;
return this;
}
}
@@ -192,7 +192,7 @@ public class BeeProductHelper {
if (OreDictionary.getOres("nuggetNaturalCobalt").size() > 0) {
COBALT.addSpecialty(OreDictionary.getOres("nuggetNaturalCobalt").get(0), 0.24f);
}
if (COBALT.getSpecialtyChances().size() <= 0) {
if (COBALT.getSpecies().getSpecialtyChances().size() <= 0) {
COBALT.setInactive();
}
+111 -361
View File
@@ -1,52 +1,32 @@
package magicbees.bees;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import magicbees.main.CommonProxy;
import magicbees.main.Config;
import magicbees.main.utils.LocalizationManager;
import magicbees.main.utils.compat.AppliedEnergisticsHelper;
import magicbees.main.utils.compat.ArsMagicaHelper;
import magicbees.main.utils.compat.BloodMagicHelper;
import magicbees.main.utils.compat.BotaniaHelper;
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 net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import com.mojang.authlib.GameProfile;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeRoot;
import forestry.api.apiculture.IAlleleBeeSpeciesCustom;
import forestry.api.apiculture.IBeeFactory;
import forestry.api.apiculture.IBeeIconColourProvider;
import forestry.api.apiculture.IBeeIconProvider;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.core.IIconProvider;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.EnumTolerance;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IAlleleTolerance;
import forestry.api.genetics.IClassification;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.IMutation;
public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
import magicbees.main.utils.compat.AppliedEnergisticsHelper;
import magicbees.main.utils.compat.ArsMagicaHelper;
import magicbees.main.utils.compat.BloodMagicHelper;
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;
public enum BeeSpecies
{
MYSTICAL("Mystical", "mysticum", BeeClassification.VEILED,
0xAFFFB7, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false, true),
@@ -573,87 +553,94 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
if (!AppliedEnergisticsHelper.isActive()) {
AE_SKYSTONE.setInactive();
}
for (BeeSpecies beeSpecies : BeeSpecies.values()) {
if (beeSpecies.isActive()) {
beeSpecies.setupCustomIconProvider();
}
}
}
private String binomial;
private String authority;
private int primaryColour;
private int secondaryColour;
private EnumTemperature temperature;
private EnumHumidity humidity;
private boolean hasEffect;
private boolean isSecret;
private boolean isCounted;
private boolean isActive;
private boolean isNocturnal;
private IClassification branch;
private HashMap<ItemStack, Float> products;
private HashMap<ItemStack, Float> specialties;
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[];
private String uid;
private boolean dominant;
@SideOnly(Side.CLIENT)
private IIcon[][] icons;
private BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour,
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);
}
private BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, int secondColour,
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);
}
private BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, int secondColour,
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);
}
private BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour,
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);
}
private BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, int secondColour,
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) {
this.uid = "magicbees.species" + speciesName;
this.dominant = isSpeciesDominant;
AlleleManager.alleleRegistry.registerAllele(this);
binomial = genusName;
authority = "MysteriousAges";
primaryColour = firstColour;
secondaryColour = secondColour;
temperature = preferredTemp;
humidity = preferredHumidity;
hasEffect = hasGlowEffect;
isSecret = isSpeciesSecret;
isCounted = isSpeciesCounted;
products = new HashMap<ItemStack, Float>();
specialties = new HashMap<ItemStack, Float>();
this.branch = classification;
this.branch.addMemberSpecies(this);
this.isNocturnal = isSpeciesNocturnal;
this.isActive = true;
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) {
products.put(produce, chance);
species.addProduct(produce, chance);
return this;
}
public BeeSpecies addSpecialty(ItemStack produce, float chance) {
specialties.put(produce, chance);
species.addSpecialty(produce, chance);
return this;
}
@@ -661,301 +648,72 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
return BeeManager.beeRoot.getMemberStack(BeeManager.beeRoot.getBee(null, BeeManager.beeRoot.templateAsGenome(genomeTemplate)), beeType.ordinal());
}
@Override
public String getName() {
return LocalizationManager.getLocalizedString(getUID());
}
@Override
public String getDescription() {
return LocalizationManager.getLocalizedString(getUID() + ".description");
}
@Override
public String getUnlocalizedName() {
return getUID();
}
@Override
public EnumTemperature getTemperature() {
return temperature;
}
@Override
public EnumHumidity getHumidity() {
return humidity;
}
@Override
public boolean hasEffect() {
return hasEffect;
}
public BeeSpecies setInactive() {
this.isActive = false;
AlleleManager.alleleRegistry.blacklistAllele(this.getUID());
this.active = false;
AlleleManager.alleleRegistry.blacklistAllele(species.getUID());
return this;
}
public boolean isActive() {
return this.isActive;
return active;
}
@Override
public boolean isSecret() {
return isSecret;
}
@Override
public boolean isCounted() {
return isCounted;
}
@Override
public String getBinomial() {
return binomial;
}
@Override
public String getAuthority() {
return authority;
}
@Override
public IClassification getBranch() {
return this.branch;
}
@Override
public Map<ItemStack, Float> getProductChances() {
return products;
}
@Override
public Map<ItemStack, Float> getSpecialtyChances() {
return specialties;
}
@Override
public String getUID() {
return this.uid;
}
@Override
public boolean isDominant() {
return this.dominant;
}
@Override
public IBeeRoot getRoot() {
return BeeManager.beeRoot;
}
@Override
public boolean isNocturnal() {
return this.isNocturnal;
}
@Override
public boolean isJubilant(IBeeGenome genome, IBeeHousing housing) {
return true;
}
public void registerGenomeTemplate(IAllele[] genome) {
genomeTemplate = genome;
BeeManager.beeRoot.registerTemplate(getUID(), genome);
BeeManager.beeRoot.registerTemplate(species.getUID(), genome);
}
@Override
public int getIconColour(int renderPass) {
int value = 0xffffff;
if (renderPass == 0) {
if (this.primaryColour == -1) {
int hue = (int) (System.currentTimeMillis() >> 2) % 360;
value = Color.getHSBColor(hue / 360f, 0.75f, 0.80f).getRGB();
} else {
value = this.primaryColour;
}
} else if (renderPass == 1) {
if (this.secondaryColour == -1) {
int hue = (int) (System.currentTimeMillis() >> 3) % 360;
hue += 60;
hue = hue % 360;
value = Color.getHSBColor(hue / 360f, 0.5f, 0.6f).getRGB();
} else {
value = this.secondaryColour;
}
}
return value;
}
@Override
@SideOnly(Side.CLIENT)
public IIconProvider getIconProvider() {
return this;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(EnumBeeType type, int renderPass) {
return icons[type.ordinal()][Math.min(renderPass, 2)];
}
@Override
public int getComplexity() {
return 1 + getMutationPathLength(this, new ArrayList<IAllele>());
}
private int getMutationPathLength(IAllele species, ArrayList<IAllele> excludeSpecies) {
int own = 1;
int highest = 0;
excludeSpecies.add(species);
for (IMutation mutation : getRoot().getPaths(species, EnumBeeChromosome.SPECIES)) {
if (!excludeSpecies.contains(mutation.getAllele0())) {
int otherAdvance = getMutationPathLength(mutation.getAllele0(), excludeSpecies);
if (otherAdvance > highest)
highest = otherAdvance;
}
if (!excludeSpecies.contains(mutation.getAllele1())) {
int otherAdvance = getMutationPathLength(mutation.getAllele1(), excludeSpecies);
if (otherAdvance > highest)
highest = otherAdvance;
}
private void setupCustomIconProvider() {
IBeeIconProvider iconProvider = getCustomIconProvider();
if (iconProvider != null) {
this.species.setCustomBeeIconProvider(iconProvider);
}
return own + (highest > 0 ? highest : 0);
}
@Override
public float getResearchSuitability(ItemStack itemStack) {
if (itemStack == null) {
return 0f;
}
for (ItemStack product : this.products.keySet()) {
if (itemStack.isItemEqual(product)) {
return 1f;
}
}
for (ItemStack specialty : this.specialties.keySet()) {
if (specialty.isItemEqual(itemStack)) {
return 1f;
}
}
if (itemStack.getItem() == ForestryHelper.honeyDrop) {
return 0.5f;
} else if (itemStack.getItem() == ForestryHelper.honeydew) {
return 0.7f;
} else if (itemStack.getItem() == ForestryHelper.beeComb || itemStack.getItem() == Config.combs) {
return 0.4f;
} else if (getRoot().isMember(itemStack)) {
return 1.0f;
} else {
for (Map.Entry<ItemStack, Float> catalyst : BeeManager.beeRoot.getResearchCatalysts().entrySet()) {
if (OreDictionary.itemMatches(itemStack, catalyst.getKey(), false)) {
return catalyst.getValue();
}
}
}
return 0f;
}
@Override
public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
System.out.println("Bounty level: " + bountyLevel);
ArrayList<ItemStack> bounty = new ArrayList<ItemStack>();
if (world.rand.nextFloat() < ((10f / bountyLevel))) {
Collection<? extends IMutation> resultantMutations = getRoot().getCombinations(this);
if (resultantMutations.size() > 0) {
IMutation[] candidates = resultantMutations.toArray(new IMutation[resultantMutations.size()]);
bounty.add(AlleleManager.alleleRegistry.getMutationNoteStack(researcher, candidates[world.rand.nextInt(candidates.length)]));
}
}
for (ItemStack product : this.products.keySet()) {
ItemStack copy = product.copy();
copy.stackSize = 1 + world.rand.nextInt(bountyLevel / 2);
bounty.add(copy);
}
for (ItemStack specialty : this.specialties.keySet()) {
ItemStack copy = specialty.copy();
copy.stackSize = world.rand.nextInt(bountyLevel / 3);
if (copy.stackSize > 0) {
bounty.add(copy);
}
}
return bounty.toArray(new ItemStack[bounty.size()]);
}
@Override
public String getEntityTexture() {
return "/gfx/forestry/entities/bees/honeyBee.png";
}
@Override
public void registerIcons(IIconRegister itemMap) {
this.icons = new IIcon[EnumBeeType.values().length][3];
String root = this.getIconPath();
IIcon body1 = itemMap.registerIcon(root + "body1");
for (int i = 0; i < EnumBeeType.values().length; i++) {
if (EnumBeeType.values()[i] == EnumBeeType.NONE)
continue;
icons[i][0] = itemMap.registerIcon(root + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".outline");
icons[i][1] = (EnumBeeType.values()[i] != EnumBeeType.LARVAE) ? body1 : itemMap.registerIcon(root
+ EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".body");
icons[i][2] = itemMap.registerIcon(root + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".body2");
IBeeIconColourProvider iconColourProvider = getCustomIconColourProvider();
if (iconColourProvider != null) {
this.species.setCustomBeeIconColourProvider(iconColourProvider);
}
}
private String getIconPath() {
String value;
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:
value = CommonProxy.DOMAIN + ":bees/skulking/";
break;
case DOCTORAL:
value = CommonProxy.DOMAIN + ":bees/doctoral/";
break;
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;
default:
value = ForestryHelper.Name.toLowerCase() + ":bees/default/";
break;
case DOCTORAL:
return BeeIconProvider.DOCTORAL;
default:
return null;
}
}
return value;
private IBeeIconColourProvider getCustomIconColourProvider() {
switch (this) {
case BOT_ALFHEIM:
return BeeIconColourProvider.RAINBOW;
}
return null;
}
public boolean canWorkInTemperature(EnumTemperature temp) {
@@ -969,12 +727,4 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
return AlleleManager.climateHelper.isWithinLimits(EnumTemperature.NORMAL, humid, EnumTemperature.NORMAL, EnumTolerance.NONE, humidity,
tolerance.getValue());
}
// --------- Unused Functions ---------------------------------------------
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(short texUID) {
return icons[0][0];
}
}
@@ -0,0 +1,48 @@
package magicbees.bees;
import net.minecraft.world.World;
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;
// 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;
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;
}
@Override
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
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());
}
}
}
@@ -0,0 +1,45 @@
package magicbees.bees;
import net.minecraft.world.World;
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;
public class MoonPhaseMutationRestriction implements IMutationCondition {
private final MoonPhase moonPhaseStart;
private final MoonPhase moonPhaseEnd;
public MoonPhaseMutationRestriction(MoonPhase phase) {
this.moonPhaseStart = phase;
this.moonPhaseEnd = phase;
}
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) {
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());
}
}
}
@@ -4,6 +4,7 @@ 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;
@@ -27,13 +28,10 @@ public class AlleleEffectCure extends AlleleEffect {
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
List<EntityPlayer> entityList = this.getEntitiesWithinRange(genome, housing, EntityPlayer.class);
for (Entity e : entityList) {
if (e instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) e;
player.curePotionEffects(new ItemStack(Items.milk_bucket));
}
for (EntityPlayer player : entityList) {
player.curePotionEffects(new ItemStack(Items.milk_bucket));
}
storedData.setInteger(0, 0);
@@ -3,11 +3,13 @@ package magicbees.bees.allele.effect;
import java.util.List;
import magicbees.bees.AlleleEffect;
import magicbees.item.ItemArmorApiarist;
import net.minecraft.entity.Entity;
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;
@@ -40,19 +42,18 @@ public class AlleleEffectPotion extends AlleleEffect {
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
List<EntityLivingBase> entityList = this.getEntitiesWithinRange(genome, housing, EntityLivingBase.class);
for (Entity e : entityList) {
if (e instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) e;
if (this.isMalicious) {
int armorPieces = ItemArmorApiarist.getNumberPiecesWorn(player);
int finalDuration = this.duration / 4 * (4 - armorPieces);
if (finalDuration > 0) {
player.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0));
}
} else {
player.addPotionEffect(new PotionEffect(this.potionId, this.duration, 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));
}
}
}
@@ -4,10 +4,10 @@ import java.util.List;
import magicbees.bees.AlleleEffect;
import magicbees.bees.BeeManager;
import magicbees.item.ItemArmorApiarist;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
@@ -102,21 +102,15 @@ public class AlleleEffectSpawnMob extends AlleleEffect {
}
private EntityPlayer findPlayerTarget(IBeeGenome genome, IBeeHousing housing) {
List<Entity> entities = getEntitiesWithinRange(genome, housing);
EntityPlayer target = null;
for (Entity e : entities) {
if (e instanceof EntityPlayer) {
target = (EntityPlayer) e;
// Check for wearing armor & cancel
if (ItemArmorApiarist.getNumberPiecesWorn(target) >= 4) {
// Full armor suit is treated as "invisible."
target = null;
} else {
break;
}
List<EntityPlayer> 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 target;
return null;
}
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) {
@@ -142,7 +136,7 @@ public class AlleleEffectSpawnMob extends AlleleEffect {
if (entitiesCount < maxMobsInArea && mob.getCanSpawnHere()) {
spawnedFlag = world.spawnEntityInWorld(mob);
if (aggosOnPlayer && player != null) {
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4) {
if (forestry.api.apiculture.BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) {
// Protect fully suited player from initial murder intent.
mob.setAttackTarget(player);
}
@@ -2,13 +2,15 @@ package magicbees.bees.allele.effect;
import java.lang.reflect.Field;
import magicbees.item.ItemArmorApiarist;
import magicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
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;
@@ -61,7 +63,7 @@ public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob {
spawnedFlag = world.spawnEntityInWorld(mob);
if (this.aggosOnPlayer && player != null) {
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4) {
if (BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true) < 4) {
// Protect fully suited player from initial murder
// intent.
mob.setAttackTarget(player);
@@ -1,69 +0,0 @@
package magicbees.item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import forestry.api.apiculture.IArmorApiarist;
public class ItemArmorApiarist extends Item implements IArmorApiarist
{
public ItemArmorApiarist()
{
super();
}
public static int getNumberPiecesWorn(EntityPlayer player)
{
int count = 0;
if (wearsHelmet(player))
{
count++;
}
if (wearsChest(player))
{
count++;
}
if (wearsLegs(player))
{
count++;
}
if (wearsBoots(player))
{
count++;
}
return count;
}
public static boolean wearsHelmet(EntityPlayer player)
{
ItemStack armorItem = player.inventory.armorInventory[3];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static boolean wearsChest(EntityPlayer player)
{
ItemStack armorItem = player.inventory.armorInventory[2];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static boolean wearsLegs(EntityPlayer player)
{
ItemStack armorItem = player.inventory.armorInventory[1];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static boolean wearsBoots(EntityPlayer player)
{
ItemStack armorItem = player.inventory.armorInventory[0];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
@Override
public boolean protectPlayer(EntityPlayer player, ItemStack armor, String cause, boolean doProtect)
{
return false;
}
}
@@ -1,5 +1,6 @@
package magicbees.main.utils;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
/**
@@ -11,7 +12,7 @@ public enum MoonPhase {
WANING_HALF("halfWaning"),
WANING_CRESCENT("crescentWaning"),
NEW("new"),
WAXING_CRESCENT("crecentWaxing"),
WAXING_CRESCENT("crescentWaxing"),
WAXING_HALF("halfWaxing"),
WAXING_GIBBOUS("gibbousWaxing");
@@ -42,11 +43,10 @@ public enum MoonPhase {
}
public String getLocalizedNameAlt() {
String response = LocalizationManager.getLocalizedString("moon.alt." + this.phaseName);
if (response.isEmpty()) {
return getLocalizedName();
if (StatCollector.canTranslate("moon.alt." + this.phaseName)) {
return LocalizationManager.getLocalizedString("moon.alt." + this.phaseName);
}
return response;
return getLocalizedName();
}
public static MoonPhase getMoonPhase(World w) {
@@ -25,7 +25,7 @@ public class VersionInfo
public static final String Logo = "/gfx/magicbees/logo.png";
public static final String Depends = "required-after:Forestry@[4.0.8,);after:Thaumcraft;after:ExtraBees;after:EE3;after:ArsMagica;after:TConstruct;after:Railcraft;after:ThermalFoundation;after:ThermalExpansion;after:RedstoneArsenal;after:AWWayofTime;after:Botania;after:appliedenergistics2";
public static final String Depends = "required-after:Forestry@[4.2.1,);after:Thaumcraft;after:ExtraBees;after:EE3;after:ArsMagica;after:TConstruct;after:Railcraft;after:ThermalFoundation;after:ThermalExpansion;after:RedstoneArsenal;after:AWWayofTime;after:Botania;after:appliedenergistics2";
boolean criticalUpdate;
boolean newVersion;
@@ -5,6 +5,8 @@ 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;
@@ -14,10 +16,10 @@ public class SpeciesRecipeElvenTrade extends RecipeElvenTrade {
private IAlleleBeeSpecies inputSpecies;
public SpeciesRecipeElvenTrade(IAlleleBeeSpecies inSpecies, IAlleleBeeSpecies outSpecies) {
super(BeeManager.getDefaultItemStackForSpecies(outSpecies, EnumBeeType.DRONE),
BeeManager.getDefaultItemStackForSpecies(inSpecies, EnumBeeType.DRONE));
inputSpecies = inSpecies;
public SpeciesRecipeElvenTrade(BeeSpecies inSpecies, BeeSpecies outSpecies) {
super(BeeManager.getDefaultItemStackForSpecies(outSpecies.getSpecies(), EnumBeeType.DRONE),
BeeManager.getDefaultItemStackForSpecies(inSpecies.getSpecies(), EnumBeeType.DRONE));
inputSpecies = inSpecies.getSpecies();
}
@Override
@@ -1,6 +1,7 @@
package magicbees.main.utils.compat.botania;
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;
@@ -16,10 +17,10 @@ public class SpeciesRecipeManaInfusion extends RecipeManaInfusion {
private ItemStack outputCache;
public SpeciesRecipeManaInfusion(IAlleleBeeSpecies outSpecies, IAlleleBeeSpecies inSpecies, int mana, EnumBeeType type) {
super(BeeManager.getDefaultItemStackForSpecies(outSpecies, type), BeeManager.getDefaultItemStackForSpecies(inSpecies, type), mana);
outputSpecies = outSpecies;
inputSpecies = inSpecies;
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();
}
@@ -8,6 +8,7 @@ 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;
@@ -91,6 +92,11 @@ public class EffectJarHousing implements IBeeHousing {
return jarEntity.getOwner();
}
@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;
@@ -129,6 +129,11 @@ public class TileEntityMagicApiary extends TileEntity implements ISidedInventory
return new ChunkCoordinates(xCoord, yCoord, zCoord);
}
@Override
public Vec3 getBeeFXCoordinates() {
return Vec3.createVectorHelper(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
}
@Override
public BiomeGenBase getBiome() {
if (biome == null) {
@@ -213,6 +213,8 @@ tile.botania:flower.hibeescus.lore=The puns may sting a bit
research.requiresBlock=Requires a foundation of %s
research.requiresPhase=Occurs between the %s and %s
research.requiresPhaseSingle=During the %s
research.bonusPhase=Better success between the %s and %s.
research.bonusPhaseSingle=Better success during the %s.
research.requiresNode=Only occurs when a node is near
research.requiresNodeSpecific=Only occurs within influence of a %s node
research.requiresBiome=Occurs within a %s biome