port to forestry 4.2

This commit is contained in:
marcin212 committed 2016-10-20 02:56:31 +02:00
1 parent dbc5c1a564
commit f969f63b66
3697 files changed
+78372

No files matched your search

@@ -0,0 +1,351 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.apiculture.IBeeRoot;
import java.util.ArrayList;
import java.util.Collection;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.World;
import forestry.api.genetics.IGenome;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.IMutation;
import binnie.Binnie;
import net.minecraftforge.common.BiomeDictionary;
import binnie.core.genetics.ForestryAllele;
import forestry.api.genetics.IAllele;
import forestry.api.apiculture.IAlleleBeeSpecies;
import java.util.List;
import forestry.api.apiculture.IBeeMutation;
public class ExtraBeeMutation implements IBeeMutation
{
public static List<IBeeMutation> mutations;
MutationRequirement req;
IAlleleBeeSpecies species0;
IAlleleBeeSpecies species1;
IAllele[] template;
int chance;
public static void doInit() {
final IAlleleBeeSpecies[] vanilla = new IAlleleBeeSpecies[0];
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.ARID, 10);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.ARID, 10);
new ExtraBeeMutation(ExtraBeesSpecies.ARID, ForestryAllele.BeeSpecies.Common.getAllele(), ExtraBeesSpecies.BARREN, 8);
new ExtraBeeMutation(ExtraBeesSpecies.ARID, ExtraBeesSpecies.BARREN, ExtraBeesSpecies.DESOLATE, 8);
new ExtraBeeMutation(ExtraBeesSpecies.BARREN, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.GNAWING, 15);
new ExtraBeeMutation(ExtraBeesSpecies.DESOLATE, ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.ROTTEN, 15);
new ExtraBeeMutation(ExtraBeesSpecies.DESOLATE, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.BONE, 15);
new ExtraBeeMutation(ExtraBeesSpecies.DESOLATE, ForestryAllele.BeeSpecies.Modest.getAllele(), ExtraBeesSpecies.CREEPER, 15);
new ExtraBeeMutation(ExtraBeesSpecies.BARREN, ForestryAllele.BeeSpecies.Marshy.getAllele(), ExtraBeesSpecies.DECOMPOSING, 15);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.STONE, 12);
new ExtraBeeMutation(ExtraBeesSpecies.STONE, ForestryAllele.BeeSpecies.Unweary.getAllele(), ExtraBeesSpecies.GRANITE, 10);
new ExtraBeeMutation(ExtraBeesSpecies.GRANITE, ForestryAllele.BeeSpecies.Industrious.getAllele(), ExtraBeesSpecies.MINERAL, 6);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.IRON, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.IRON, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Wintry.getAllele(), ExtraBeesSpecies.COPPER, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Modest.getAllele(), ExtraBeesSpecies.COPPER, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Marshy.getAllele(), ExtraBeesSpecies.TIN, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.TIN, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.LEAD, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Modest.getAllele(), ExtraBeesSpecies.LEAD, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Wintry.getAllele(), ExtraBeesSpecies.ZINC, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.ZINC, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.NICKEL, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Marshy.getAllele(), ExtraBeesSpecies.NICKEL, 5);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Cultivated.getAllele(), ExtraBeesSpecies.TITANIUM, 3);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Common.getAllele(), ExtraBeesSpecies.TUNGSTATE, 3);
new ExtraBeeMutation(ExtraBeesSpecies.ZINC, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.SILVER, 2);
new ExtraBeeMutation(ExtraBeesSpecies.TIN, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.SILVER, 2);
new ExtraBeeMutation(ExtraBeesSpecies.LEAD, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.SILVER, 2);
new ExtraBeeMutation(ExtraBeesSpecies.TITANIUM, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.SILVER, 3);
new ExtraBeeMutation(ExtraBeesSpecies.IRON, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.GOLD, 2);
new ExtraBeeMutation(ExtraBeesSpecies.COPPER, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.GOLD, 2);
new ExtraBeeMutation(ExtraBeesSpecies.NICKEL, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.GOLD, 2);
new ExtraBeeMutation(ExtraBeesSpecies.TUNGSTATE, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.GOLD, 3);
new ExtraBeeMutation(ExtraBeesSpecies.GOLD, ExtraBeesSpecies.SILVER, ExtraBeesSpecies.PLATINUM, 2);
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Imperial.getAllele(), ExtraBeesSpecies.LAPIS, 5);
new ExtraBeeMutation(ExtraBeesSpecies.LAPIS, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.EMERALD, 5);
new ExtraBeeMutation(ExtraBeesSpecies.LAPIS, ForestryAllele.BeeSpecies.Modest.getAllele(), ExtraBeesSpecies.RUBY, 5);
new ExtraBeeMutation(ExtraBeesSpecies.LAPIS, ExtraBeesSpecies.WATER, ExtraBeesSpecies.SAPPHIRE, 5);
new ExtraBeeMutation(ExtraBeesSpecies.LAPIS, ForestryAllele.BeeSpecies.Cultivated.getAllele(), ExtraBeesSpecies.DIAMOND, 5);
new ExtraBeeMutation(ExtraBeesSpecies.PREHISTORIC, ExtraBeesSpecies.MINERAL, ExtraBeesSpecies.UNSTABLE, 5);
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.IRON, ExtraBeesSpecies.NUCLEAR, 5);
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.COPPER, ExtraBeesSpecies.NUCLEAR, 5);
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.TIN, ExtraBeesSpecies.NUCLEAR, 5);
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.ZINC, ExtraBeesSpecies.NUCLEAR, 5);
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.NICKEL, ExtraBeesSpecies.NUCLEAR, 5);
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.LEAD, ExtraBeesSpecies.NUCLEAR, 5);
new ExtraBeeMutation(ExtraBeesSpecies.NUCLEAR, ExtraBeesSpecies.GOLD, ExtraBeesSpecies.RADIOACTIVE, 5);
new ExtraBeeMutation(ExtraBeesSpecies.NUCLEAR, ExtraBeesSpecies.SILVER, ExtraBeesSpecies.RADIOACTIVE, 5);
new ExtraBeeMutation(ExtraBeesSpecies.NUCLEAR, ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.YELLORIUM, 5);
new ExtraBeeMutation(ExtraBeesSpecies.NUCLEAR, ExtraBeesSpecies.YELLORIUM, ExtraBeesSpecies.CYANITE, 5);
new ExtraBeeMutation(ExtraBeesSpecies.YELLORIUM, ExtraBeesSpecies.CYANITE, ExtraBeesSpecies.BLUTONIUM, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Noble.getAllele(), ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.ANCIENT, 10);
new ExtraBeeMutation(ExtraBeesSpecies.ANCIENT, ForestryAllele.BeeSpecies.Secluded.getAllele(), ExtraBeesSpecies.PRIMEVAL, 8);
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ExtraBeesSpecies.ANCIENT, ExtraBeesSpecies.PREHISTORIC, 8);
new ExtraBeeMutation(ExtraBeesSpecies.PREHISTORIC, ForestryAllele.BeeSpecies.Imperial.getAllele(), ExtraBeesSpecies.RELIC, 8);
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ExtraBeesSpecies.GROWING, ExtraBeesSpecies.COAL, 8);
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ForestryAllele.BeeSpecies.Rural.getAllele(), ExtraBeesSpecies.COAL, 8);
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ForestryAllele.BeeSpecies.Miry.getAllele(), ExtraBeesSpecies.RESIN, 8);
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ExtraBeesSpecies.OCEAN, ExtraBeesSpecies.OIL, 8);
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.OIL, 8);
new ExtraBeeMutation(ExtraBeesSpecies.OIL, ForestryAllele.BeeSpecies.Industrious.getAllele(), ExtraBeesSpecies.DISTILLED, 8);
new ExtraBeeMutation(ExtraBeesSpecies.DISTILLED, ExtraBeesSpecies.OIL, ExtraBeesSpecies.FUEL, 8);
new ExtraBeeMutation(ExtraBeesSpecies.DISTILLED, ExtraBeesSpecies.COAL, ExtraBeesSpecies.CREOSOTE, 8);
new ExtraBeeMutation(ExtraBeesSpecies.DISTILLED, ExtraBeesSpecies.RESIN, ExtraBeesSpecies.LATEX, 8);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.RIVER, 10, new RequirementBiomeType(BiomeDictionary.Type.RIVER));
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.OCEAN, 10, new RequirementBiomeType(BiomeDictionary.Type.OCEAN));
new ExtraBeeMutation(ExtraBeesSpecies.BLACK, ExtraBeesSpecies.OCEAN, ExtraBeesSpecies.INK, 8);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.GROWING, 10);
new ExtraBeeMutation(ExtraBeesSpecies.GROWING, ForestryAllele.BeeSpecies.Unweary.getAllele(), ExtraBeesSpecies.THRIVING, 10);
new ExtraBeeMutation(ExtraBeesSpecies.THRIVING, ForestryAllele.BeeSpecies.Industrious.getAllele(), ExtraBeesSpecies.BLOOMING, 8);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Valiant.getAllele(), ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.SWEET, 15);
new ExtraBeeMutation(ExtraBeesSpecies.SWEET, ForestryAllele.BeeSpecies.Rural.getAllele(), ExtraBeesSpecies.SUGAR, 15);
new ExtraBeeMutation(ExtraBeesSpecies.SWEET, ExtraBeesSpecies.GROWING, ExtraBeesSpecies.RIPENING, 5);
new ExtraBeeMutation(ExtraBeesSpecies.SWEET, ExtraBeesSpecies.THRIVING, ExtraBeesSpecies.FRUIT, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Farmerly.getAllele(), ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.ALCOHOL, 10);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Farmerly.getAllele(), ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.FARM, 10);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Farmerly.getAllele(), ExtraBeesSpecies.WATER, ExtraBeesSpecies.MILK, 10);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Farmerly.getAllele(), ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.COFFEE, 10);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Miry.getAllele(), ExtraBeesSpecies.SWAMP, 10);
new ExtraBeeMutation(ExtraBeesSpecies.SWAMP, ForestryAllele.BeeSpecies.Boggy.getAllele(), ExtraBeesSpecies.BOGGY, 8);
new ExtraBeeMutation(ExtraBeesSpecies.BOGGY, ExtraBeesSpecies.SWAMP, ExtraBeesSpecies.FUNGAL, 8);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Boggy.getAllele(), ForestryAllele.BeeSpecies.Miry.getAllele(), ExtraBeesSpecies.FUNGAL, 8);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Modest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Tropical.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Marshy.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Modest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Tropical.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Marshy.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Modest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Tropical.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Marshy.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Common.getAllele(), ForestryAllele.BeeSpecies.Cultivated.getTemplate(), 12);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Common.getAllele(), ForestryAllele.BeeSpecies.Cultivated.getTemplate(), 12);
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Common.getAllele(), ForestryAllele.BeeSpecies.Cultivated.getTemplate(), 12);
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Fiendish.getAllele(), ExtraBeesSpecies.TEMPERED, 30, new RequirementBiomeType(BiomeDictionary.Type.NETHER));
new ExtraBeeMutation(ExtraBeesSpecies.TEMPERED, ForestryAllele.BeeSpecies.Demonic.getAllele(), ExtraBeesSpecies.VOLCANIC, 20, new RequirementBiomeType(BiomeDictionary.Type.NETHER));
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Cultivated.getAllele(), ForestryAllele.BeeSpecies.Sinister.getTemplate(), 60, new RequirementBiomeType(BiomeDictionary.Type.NETHER));
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Sinister.getAllele(), ForestryAllele.BeeSpecies.Fiendish.getTemplate(), 40, new RequirementBiomeType(BiomeDictionary.Type.NETHER));
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Sinister.getAllele(), ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.MALICIOUS, 10);
new ExtraBeeMutation(ExtraBeesSpecies.MALICIOUS, ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.INFECTIOUS, 8);
new ExtraBeeMutation(ExtraBeesSpecies.MALICIOUS, ExtraBeesSpecies.INFECTIOUS, ExtraBeesSpecies.VIRULENT, 8);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Exotic.getAllele(), ExtraBeesSpecies.VISCOUS, 10);
new ExtraBeeMutation(ExtraBeesSpecies.VISCOUS, ForestryAllele.BeeSpecies.Exotic.getAllele(), ExtraBeesSpecies.GLUTINOUS, 8);
new ExtraBeeMutation(ExtraBeesSpecies.VISCOUS, ExtraBeesSpecies.GLUTINOUS, ExtraBeesSpecies.STICKY, 8);
new ExtraBeeMutation(ExtraBeesSpecies.MALICIOUS, ExtraBeesSpecies.VISCOUS, ExtraBeesSpecies.CORROSIVE, 10);
new ExtraBeeMutation(ExtraBeesSpecies.CORROSIVE, ForestryAllele.BeeSpecies.Fiendish.getAllele(), ExtraBeesSpecies.CAUSTIC, 8);
new ExtraBeeMutation(ExtraBeesSpecies.CORROSIVE, ExtraBeesSpecies.CAUSTIC, ExtraBeesSpecies.ACIDIC, 4);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Cultivated.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.EXCITED, 10);
new ExtraBeeMutation(ExtraBeesSpecies.EXCITED, ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.ENERGETIC, 8);
new ExtraBeeMutation(ExtraBeesSpecies.EXCITED, ExtraBeesSpecies.ENERGETIC, ExtraBeesSpecies.ECSTATIC, 8);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.ARTIC, 10);
new ExtraBeeMutation(ExtraBeesSpecies.OCEAN, ExtraBeesSpecies.ARTIC, ExtraBeesSpecies.FREEZING, 10);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Sinister.getAllele(), ExtraBeesSpecies.SHADOW, 10);
new ExtraBeeMutation(ExtraBeesSpecies.SHADOW, ExtraBeesSpecies.ROCK, ExtraBeesSpecies.DARKENED, 8);
new ExtraBeeMutation(ExtraBeesSpecies.SHADOW, ExtraBeesSpecies.DARKENED, ExtraBeesSpecies.ABYSS, 8);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.RED, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.YELLOW, 5);
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.BLUE, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Tropical.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.GREEN, 5);
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.BLACK, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.WHITE, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Marshy.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.BROWN, 5);
new ExtraBeeMutation(ExtraBeesSpecies.RED, ExtraBeesSpecies.YELLOW, ExtraBeesSpecies.ORANGE, 5);
new ExtraBeeMutation(ExtraBeesSpecies.GREEN, ExtraBeesSpecies.BLUE, ExtraBeesSpecies.CYAN, 5);
new ExtraBeeMutation(ExtraBeesSpecies.RED, ExtraBeesSpecies.BLUE, ExtraBeesSpecies.PURPLE, 5);
new ExtraBeeMutation(ExtraBeesSpecies.BLACK, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.GRAY, 5);
new ExtraBeeMutation(ExtraBeesSpecies.BLUE, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.LIGHTBLUE, 5);
new ExtraBeeMutation(ExtraBeesSpecies.RED, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.PINK, 5);
new ExtraBeeMutation(ExtraBeesSpecies.GREEN, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.LIMEGREEN, 5);
new ExtraBeeMutation(ExtraBeesSpecies.PURPLE, ExtraBeesSpecies.PINK, ExtraBeesSpecies.MAGENTA, 5);
new ExtraBeeMutation(ExtraBeesSpecies.GRAY, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.LIGHTGRAY, 5);
new ExtraBeeMutation(ExtraBeesSpecies.TEMPERED, ExtraBeesSpecies.EXCITED, ExtraBeesSpecies.GLOWSTONE, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Austere.getAllele(), ExtraBeesSpecies.DESOLATE, ExtraBeesSpecies.HAZARDOUS, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Ended.getAllele(), ExtraBeesSpecies.RELIC, ExtraBeesSpecies.JADED, 2, new RequirementPerson("jadedcat"));
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Austere.getAllele(), ExtraBeesSpecies.EXCITED, ExtraBeesSpecies.CELEBRATORY, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Secluded.getAllele(), ForestryAllele.BeeSpecies.Ended.getAllele(), ExtraBeesSpecies.UNUSUAL, 5);
new ExtraBeeMutation(ExtraBeesSpecies.UNUSUAL, ForestryAllele.BeeSpecies.Hermitic.getAllele(), ExtraBeesSpecies.SPATIAL, 5);
new ExtraBeeMutation(ExtraBeesSpecies.SPATIAL, ForestryAllele.BeeSpecies.Spectral.getAllele(), ExtraBeesSpecies.QUANTUM, 5);
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Noble.getAllele(), ForestryAllele.BeeSpecies.Monastic.getAllele(), ExtraBeesSpecies.MYSTICAL, 5);
for (final IBeeMutation mutation : ExtraBeeMutation.mutations) {
Binnie.Genetics.getBeeRoot().registerMutation(mutation);
}
}
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final ExtraBeesSpecies mutation, final int chance) {
this(allele0, allele1, mutation.getTemplate(), chance, null);
}
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final ExtraBeesSpecies mutation, final int chance, final MutationRequirement req) {
this(allele0, allele1, mutation.getTemplate(), chance, req);
}
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IAllele[] mutation, final int chance) {
this(allele0, allele1, mutation, chance, null);
}
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IAllele[] mutation, final int chance, final MutationRequirement req) {
this.species0 = null;
this.species1 = null;
this.template = new IAllele[0];
this.chance = 80;
this.chance = chance;
this.req = req;
this.species0 = allele0;
this.species1 = allele1;
this.template = mutation;
if (this.species0 != null && this.species1 != null && this.template != null) {
ExtraBeeMutation.mutations.add(this);
}
}
@Override
public IAlleleSpecies getAllele0() {
return this.species0;
}
@Override
public IAlleleSpecies getAllele1() {
return this.species1;
}
@Override
public IAllele[] getTemplate() {
return this.template;
}
@Override
public float getBaseChance() {
return this.chance;
}
@Override
public boolean isPartner(final IAllele allele) {
return allele.getUID().equals(this.species0.getUID()) || allele.getUID().equals(this.species1.getUID());
}
@Override
public IAllele getPartner(final IAllele allele) {
return allele.getUID().equals(this.species0.getUID()) ? this.species1 : this.species0;
}
@Override
public boolean isSecret() {
return false;
}
@Override
public float getChance(final IBeeHousing housing, final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IBeeGenome genome0, final IBeeGenome genome1) {
if (this.species0 == null || this.species1 == null || allele0 == null || allele1 == null) {
return 0.0f;
}
final World world = housing.getWorld();
final BiomeGenBase biome = housing.getBiome();
if (this.req != null && !this.req.fufilled(housing, allele0, allele1, genome0, genome1)) {
return 0.0f;
}
final int processedChance = Math.round(this.chance * BeeManager.beeRoot.createBeeHousingModifier(housing).getMutationModifier(genome0, genome1, 1.0f)
* Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getBeeModifier().getMutationModifier(genome0, genome1, 1.0f));
if (this.species0.getUID().equals(allele0.getUID()) && this.species1.getUID().equals(allele1.getUID())) {
return processedChance;
}
if (this.species1.getUID().equals(allele0.getUID()) && this.species0.getUID().equals(allele1.getUID())) {
return processedChance;
}
return 0.0f;
}
@Override
public Collection<String> getSpecialConditions() {
final List<String> conditions = new ArrayList<String>();
if (this.req != null) {
for (final String s : this.req.tooltip()) {
conditions.add(s);
}
}
return conditions;
}
@Override
public IBeeRoot getRoot() {
return Binnie.Genetics.getBeeRoot();
}
static {
ExtraBeeMutation.mutations = new ArrayList<IBeeMutation>();
}
abstract static class MutationRequirement
{
public abstract String[] tooltip();
public abstract boolean fufilled(final IBeeHousing p0, final IAllele p1, final IAllele p2, final IGenome p3, final IGenome p4);
}
static class RequirementBiomeType extends MutationRequirement
{
BiomeDictionary.Type type;
public RequirementBiomeType(final BiomeDictionary.Type type) {
this.type = type;
}
@Override
public String[] tooltip() {
return new String[] { "Is restricted to " + this.type + "-like biomes." };
}
@Override
public boolean fufilled(final IBeeHousing housing, final IAllele allele0, final IAllele allele1, final IGenome genome0, final IGenome genome1) {
return BiomeDictionary.isBiomeOfType(housing.getBiome(), this.type);
}
}
static class RequirementPerson extends MutationRequirement
{
String name;
public RequirementPerson(final String name) {
this.name = name;
}
@Override
public String[] tooltip() {
return new String[] { "Can only be bred by " + this.name };
}
@Override
public boolean fufilled(final IBeeHousing housing, final IAllele allele0, final IAllele allele1, final IGenome genome0, final IGenome genome1) {
return housing.getOwner().getName() != null && housing.getOwner().getName().equals(this.name);
}
}
}
@@ -0,0 +1,308 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.AlleleManager;
import java.util.LinkedHashSet;
import binnie.extrabees.ExtraBees;
import forestry.api.apiculture.IAlleleBeeSpecies;
import java.util.Set;
import forestry.api.genetics.IClassification;
public enum ExtraBeesBranch implements IClassification
{
BARREN("Vacapis"),
HOSTILE("Infenapis"),
ROCKY("Monapis"),
METALLIC("Lamminapis"),
METALLIC2("Metalapis"),
ALLOY("Allapis"),
PRECIOUS("Pluriapis"),
MINERAL("Niphapis"),
GEMSTONE("Gemmapis"),
NUCLEAR("Levapis"),
HISTORIC("Priscapis"),
FOSSILIZED("Fosiapis"),
REFINED("Petrapis"),
AQUATIC("Aquapis"),
SACCHARINE("Sacchapis"),
CLASSICAL("Grecapis"),
VOLCANIC("Irrapis"),
VIRULENT("Virapis"),
VISCOUS("Viscapis"),
CAUSTIC("Morbapis"),
ENERGETIC("Incitapis"),
FARMING("Agriapis"),
SHADOW("Pullapis"),
PRIMARY("Primapis"),
SECONDARY("Secapis"),
TERTIARY("Tertiapis"),
FTB("Eftebeapis"),
QUANTUM("Quantapis"),
BOTANIA("Botaniapis");
private String uid;
private String scientific;
private Set<IAlleleBeeSpecies> speciesSet;
IClassification parent;
@Override
public String getUID() {
return "extrabees.genus." + this.uid;
}
@Override
public String getName() {
return ExtraBees.proxy.localise("branch." + this.toString().toLowerCase() + ".name");
}
@Override
public String getScientific() {
return this.scientific;
}
@Override
public String getDescription() {
return ExtraBees.proxy.localiseOrBlank("branch." + this.toString().toLowerCase() + ".desc");
}
private ExtraBeesBranch(final String scientific) {
this.uid = "";
this.scientific = "";
this.speciesSet = new LinkedHashSet<IAlleleBeeSpecies>();
this.scientific = scientific;
this.uid = this.toString().toLowerCase();
}
public void register() {
if (!this.speciesSet.isEmpty()) {
AlleleManager.alleleRegistry.registerClassification(this);
final IClassification parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
if (parent != null) {
parent.addMemberGroup(this);
this.setParent(parent);
}
}
}
public static void doInit() {
final IClassification frozenBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.frozen");
if (frozenBranch != null) {
frozenBranch.addMemberSpecies(ExtraBeesSpecies.ARTIC);
ExtraBeesSpecies.ARTIC.setBranch(frozenBranch);
frozenBranch.addMemberSpecies(ExtraBeesSpecies.FREEZING);
ExtraBeesSpecies.FREEZING.setBranch(frozenBranch);
}
final IClassification agrarianBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.agrarian");
if (agrarianBranch != null) {
agrarianBranch.addMemberSpecies(ExtraBeesSpecies.FARM);
ExtraBeesSpecies.FARM.setBranch(agrarianBranch);
ExtraBeesSpecies.GROWING.setBranch(agrarianBranch);
ExtraBeesSpecies.THRIVING.setBranch(agrarianBranch);
ExtraBeesSpecies.BLOOMING.setBranch(agrarianBranch);
}
final IClassification boggyBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.boggy");
if (boggyBranch != null) {
boggyBranch.addMemberSpecies(ExtraBeesSpecies.SWAMP);
boggyBranch.addMemberSpecies(ExtraBeesSpecies.BOGGY);
boggyBranch.addMemberSpecies(ExtraBeesSpecies.FUNGAL);
ExtraBeesSpecies.SWAMP.setBranch(boggyBranch);
ExtraBeesSpecies.BOGGY.setBranch(boggyBranch);
ExtraBeesSpecies.FUNGAL.setBranch(boggyBranch);
}
final IClassification festiveBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.festive");
if (festiveBranch != null) {
festiveBranch.addMemberSpecies(ExtraBeesSpecies.CELEBRATORY);
ExtraBeesSpecies.CELEBRATORY.setBranch(festiveBranch);
}
final IClassification austereBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.austere");
if (austereBranch != null) {
austereBranch.addMemberSpecies(ExtraBeesSpecies.HAZARDOUS);
ExtraBeesSpecies.HAZARDOUS.setBranch(austereBranch);
}
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.ALCOHOL);
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.MILK);
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.COFFEE);
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.CITRUS);
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.MINT);
ExtraBeesBranch.FARMING.register();
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.ARID);
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.BARREN);
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.DESOLATE);
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.DECOMPOSING);
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.GNAWING);
ExtraBeesBranch.BARREN.register();
ExtraBeesBranch.HOSTILE.addMemberSpecies(ExtraBeesSpecies.ROTTEN);
ExtraBeesBranch.HOSTILE.addMemberSpecies(ExtraBeesSpecies.BONE);
ExtraBeesBranch.HOSTILE.addMemberSpecies(ExtraBeesSpecies.CREEPER);
ExtraBeesBranch.HOSTILE.register();
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.ROCK);
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.STONE);
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.GRANITE);
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.MINERAL);
ExtraBeesBranch.ROCKY.register();
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.IRON);
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.COPPER);
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.TIN);
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.LEAD);
ExtraBeesBranch.METALLIC.register();
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.NICKEL);
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.ZINC);
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.TUNGSTATE);
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.TITANIUM);
ExtraBeesBranch.METALLIC2.register();
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.BRONZE);
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.BRASS);
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.STEEL);
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.INVAR);
ExtraBeesBranch.ALLOY.register();
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.SILVER);
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.GOLD);
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.ELECTRUM);
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.PLATINUM);
ExtraBeesBranch.PRECIOUS.register();
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.LAPIS);
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.SODALITE);
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.PYRITE);
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.BAUXITE);
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.CINNABAR);
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.SPHALERITE);
ExtraBeesBranch.MINERAL.register();
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.EMERALD);
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.RUBY);
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.SAPPHIRE);
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.OLIVINE);
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.DIAMOND);
ExtraBeesBranch.GEMSTONE.register();
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.UNSTABLE);
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.NUCLEAR);
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.RADIOACTIVE);
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.YELLORIUM);
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.CYANITE);
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.BLUTONIUM);
ExtraBeesBranch.NUCLEAR.register();
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.ANCIENT);
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.PRIMEVAL);
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.PREHISTORIC);
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.RELIC);
ExtraBeesBranch.HISTORIC.register();
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.COAL);
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.RESIN);
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.OIL);
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.PEAT);
ExtraBeesBranch.FOSSILIZED.register();
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.DISTILLED);
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.FUEL);
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.CREOSOTE);
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.LATEX);
ExtraBeesBranch.REFINED.register();
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.WATER);
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.RIVER);
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.OCEAN);
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.INK);
ExtraBeesBranch.AQUATIC.register();
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.SWEET);
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.SUGAR);
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.FRUIT);
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.RIPENING);
ExtraBeesBranch.SACCHARINE.register();
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.MARBLE);
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.ROMAN);
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.GREEK);
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.CLASSICAL);
ExtraBeesBranch.CLASSICAL.register();
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.BASALT);
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.TEMPERED);
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.ANGRY);
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.VOLCANIC);
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.GLOWSTONE);
ExtraBeesBranch.VOLCANIC.register();
ExtraBeesBranch.VISCOUS.addMemberSpecies(ExtraBeesSpecies.VISCOUS);
ExtraBeesBranch.VISCOUS.addMemberSpecies(ExtraBeesSpecies.GLUTINOUS);
ExtraBeesBranch.VISCOUS.addMemberSpecies(ExtraBeesSpecies.STICKY);
ExtraBeesBranch.VISCOUS.register();
ExtraBeesBranch.VIRULENT.addMemberSpecies(ExtraBeesSpecies.MALICIOUS);
ExtraBeesBranch.VIRULENT.addMemberSpecies(ExtraBeesSpecies.INFECTIOUS);
ExtraBeesBranch.VIRULENT.addMemberSpecies(ExtraBeesSpecies.VIRULENT);
ExtraBeesBranch.VIRULENT.register();
ExtraBeesBranch.CAUSTIC.addMemberSpecies(ExtraBeesSpecies.CORROSIVE);
ExtraBeesBranch.CAUSTIC.addMemberSpecies(ExtraBeesSpecies.CAUSTIC);
ExtraBeesBranch.CAUSTIC.addMemberSpecies(ExtraBeesSpecies.ACIDIC);
ExtraBeesBranch.CAUSTIC.register();
ExtraBeesBranch.ENERGETIC.addMemberSpecies(ExtraBeesSpecies.EXCITED);
ExtraBeesBranch.ENERGETIC.addMemberSpecies(ExtraBeesSpecies.ENERGETIC);
ExtraBeesBranch.ENERGETIC.addMemberSpecies(ExtraBeesSpecies.ECSTATIC);
ExtraBeesBranch.ENERGETIC.register();
ExtraBeesBranch.SHADOW.addMemberSpecies(ExtraBeesSpecies.SHADOW);
ExtraBeesBranch.SHADOW.addMemberSpecies(ExtraBeesSpecies.DARKENED);
ExtraBeesBranch.SHADOW.addMemberSpecies(ExtraBeesSpecies.ABYSS);
ExtraBeesBranch.SHADOW.register();
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.RED);
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.YELLOW);
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.BLUE);
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.GREEN);
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.BLACK);
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.WHITE);
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.BROWN);
ExtraBeesBranch.PRIMARY.register();
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.ORANGE);
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.CYAN);
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.PURPLE);
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.GRAY);
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.LIGHTBLUE);
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.PINK);
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.LIMEGREEN);
ExtraBeesBranch.SECONDARY.register();
ExtraBeesBranch.TERTIARY.addMemberSpecies(ExtraBeesSpecies.MAGENTA);
ExtraBeesBranch.TERTIARY.addMemberSpecies(ExtraBeesSpecies.LIGHTGRAY);
ExtraBeesBranch.TERTIARY.register();
ExtraBeesBranch.FTB.addMemberSpecies(ExtraBeesSpecies.JADED);
ExtraBeesBranch.FTB.register();
ExtraBeesBranch.QUANTUM.addMemberSpecies(ExtraBeesSpecies.UNUSUAL);
ExtraBeesBranch.QUANTUM.addMemberSpecies(ExtraBeesSpecies.SPATIAL);
ExtraBeesBranch.QUANTUM.addMemberSpecies(ExtraBeesSpecies.QUANTUM);
ExtraBeesBranch.QUANTUM.register();
ExtraBeesBranch.BOTANIA.addMemberSpecies(ExtraBeesSpecies.MYSTICAL);
ExtraBeesBranch.BOTANIA.register();
}
@Override
public IClassification.EnumClassLevel getLevel() {
return IClassification.EnumClassLevel.GENUS;
}
@Override
public IClassification[] getMemberGroups() {
return null;
}
@Override
public void addMemberGroup(final IClassification group) {
}
@Override
public IAlleleSpecies[] getMemberSpecies() {
return this.speciesSet.toArray(new IAlleleSpecies[0]);
}
@Override
public void addMemberSpecies(final IAlleleSpecies species) {
this.speciesSet.add((IAlleleBeeSpecies) species);
if (species instanceof ExtraBeesSpecies) {
((ExtraBeesSpecies) species).setBranch(this);
}
}
@Override
public IClassification getParent() {
return this.parent;
}
@Override
public void setParent(final IClassification parent) {
this.parent = parent;
}
}
@@ -0,0 +1,264 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics;
import forestry.api.apiculture.FlowerManager;
import forestry.api.genetics.IFlower;
import net.minecraft.item.Item;
import java.util.HashSet;
import java.util.List;
import java.util.ArrayList;
import java.util.Set;
import binnie.core.Mods;
import forestry.api.genetics.IFruitBearer;
import net.minecraft.world.IBlockAccess;
import net.minecraft.block.material.Material;
import forestry.api.genetics.IIndividual;
import java.util.EnumSet;
import net.minecraftforge.common.EnumPlantType;
import forestry.api.genetics.IPollinatable;
import net.minecraft.world.World;
import net.minecraft.init.Items;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IChromosomeType;
import forestry.api.genetics.ISpeciesRoot;
import binnie.extrabees.ExtraBees;
import forestry.api.genetics.IAlleleFlowers;
import forestry.api.genetics.IFlowerProvider;
public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromosomeType
{
WATER,
SUGAR,
ROCK,
BOOK,
DEAD,
REDSTONE,
WOOD,
LEAVES,
Sapling,
Fruit,
Mystical;
boolean dominant;
private ExtraBeesFlowers() {
this.dominant = true;
}
@Override
public String getUID() {
return "extrabees.flower." + this.toString().toLowerCase();
}
@Override
public boolean isDominant() {
return this.dominant;
}
@Override
public IFlowerProvider getProvider() {
return this;
}
@Override
public String getDescription() {
return ExtraBees.proxy.localise("flowers." + this.name().toString().toLowerCase() + ".name");
}
public void register() {
// AlleleManager.alleleRegistry.registerAllele((IAllele)this);
for (ItemStack stack : getItemStacks()) {
FlowerManager.flowerRegistry.registerAcceptableFlower(Block.getBlockFromItem(stack.getItem()), getUID());
}
AlleleManager.alleleRegistry.registerAllele(this, this);
}
public static void doInit() {
for (final ExtraBeesFlowers effect : values()) {
effect.register();
}
}
public ItemStack[] getItemStacks() {
switch (this) {
case WATER: {
return new ItemStack[] { new ItemStack(Blocks.waterlily) };
}
case SUGAR: {
return new ItemStack[] { new ItemStack(Blocks.reeds) };
}
case ROCK: {
return new ItemStack[] { new ItemStack(Blocks.cobblestone) };
}
case BOOK: {
return new ItemStack[] { new ItemStack(Blocks.bookshelf) };
}
case REDSTONE: {
return new ItemStack[] { new ItemStack(Blocks.redstone_torch) };
}
case DEAD: {
return new ItemStack[] { new ItemStack(Blocks.deadbush) };
}
case Fruit: {
return new ItemStack[] { new ItemStack(Items.apple) };
}
case LEAVES: {
return new ItemStack[] { new ItemStack(Blocks.leaves) };
}
case Sapling: {
return new ItemStack[] { new ItemStack(Blocks.sapling) };
}
case WOOD: {
return new ItemStack[] { new ItemStack(Blocks.log) };
}
default: {
return new ItemStack[0];
}
}
}
@Override
public boolean isAcceptedPollinatable(final World world, final IPollinatable pollinatable) {
final EnumSet<EnumPlantType> types = pollinatable.getPlantType();
return types.size() > 1 || !types.contains(EnumPlantType.Nether);
}
public boolean isAcceptedFlower(final World world, final IIndividual individual, final int x, final int y, final int z) {
final Block block = world.getBlock(x, y, z);
if (block == null) {
return false;
}
switch (this) {
case WATER: {
return block == Blocks.waterlily;
}
case ROCK: {
return block.getMaterial() == Material.rock;
}
case SUGAR: {
return block == Blocks.reeds;
}
case BOOK: {
return block == Blocks.bookshelf;
}
case REDSTONE: {
return block == Blocks.redstone_torch;
}
case DEAD: {
return block == Blocks.deadbush;
}
case WOOD: {
return block.isWood(world, x, y, z);
}
case Fruit: {
return world.getTileEntity(x, y, z) instanceof IFruitBearer;
}
case LEAVES: {
return block.isLeaves(world, x, y, z);
}
case Sapling: {
return block.getClass().getName().toLowerCase().contains("sapling");
}
case Mystical: {
return block == Mods.Botania.block("flower");
}
default: {
return false;
}
}
}
@Override
public boolean growFlower(final World world, final IIndividual individual, final int x, final int y, final int z) {
switch (this) {
case WATER: {
return world.isAirBlock(x, y, z) && world.getBlock(x, y - 1, z) == Blocks.water && world.setBlock(x, y, z, Blocks.waterlily, 0, 2);
}
case SUGAR: {
return world.getBlock(x, y - 1, z) == Blocks.reeds && world.isAirBlock(x, y, z) && world.setBlock(x, y, z, Blocks.reeds, 0, 0);
}
default: {
return false;
}
}
}
@Override
public ItemStack[] affectProducts(final World world, final IIndividual individual, final int x, final int y, final int z, final ItemStack[] products) {
if (this == ExtraBeesFlowers.Mystical) {
final List<ItemStack> prods = new ArrayList<ItemStack>();
for (final ItemStack stack : products) {
prods.add(stack);
}
for (int k = 0; k < 50; ++k) {
final int tX = 7;
final int tY = 7;
final int tZ = 3;
final int x2 = x - tX + world.rand.nextInt(1 + 2 * tX);
final int y2 = y - tY + world.rand.nextInt(1 + 2 * tY);
final int z2 = z - tZ + world.rand.nextInt(1 + 2 * tZ);
final Block block = world.getBlock(x2, y2, z2);
if (block != null) {
if (block == Mods.Botania.block("flower")) {
final int meta = world.getBlockMetadata(x2, y2, z2);
final Item item = Mods.Botania.item("petal");
if (item != null) {
prods.add(new ItemStack(item, 1, meta));
}
}
}
}
return prods.toArray(new ItemStack[0]);
}
return products;
}
@Override
public String getName() {
return this.getDescription();
}
@Override
public String getUnlocalizedName() {
return this.getUID();
}
@Override
public String getFlowerType() {
return this.getUID();
}
@Override
public Set<IFlower> getFlowers() {
return new HashSet<IFlower>();
}
@Override
public Class<? extends IAllele> getAlleleClass() {
return getClass();
}
@Override
public ISpeciesRoot getSpeciesRoot() {
return AlleleManager.alleleRegistry.getSpeciesRoot(getUID());
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,79 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics;
import net.minecraft.block.Block;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.genetics.IIndividual;
import forestry.api.apiculture.EnumBeeType;
import binnie.core.BinnieCore;
import forestry.api.genetics.IGenome;
import forestry.api.apiculture.IAlleleBeeSpecies;
import net.minecraft.init.Items;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import binnie.Binnie;
import forestry.api.recipes.RecipeManagers;
import binnie.extrabees.genetics.effect.ExtraBeesEffect;
import cpw.mods.fml.common.registry.GameRegistry;
import binnie.extrabees.genetics.effect.BlockEctoplasm;
import binnie.extrabees.ExtraBees;
import binnie.extrabees.genetics.items.ItemDictionary;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.AlleleManager;
import binnie.core.IInitializable;
public class ModuleGenetics implements IInitializable
{
@Override
public void preInit() {
for (final ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
AlleleManager.alleleRegistry.registerAllele(species);
}
ExtraBees.dictionary = new ItemDictionary();
GameRegistry.registerBlock(ExtraBees.ectoplasm = new BlockEctoplasm(), "ectoplasm");
}
@Override
public void init() {
ExtraBeesEffect.doInit();
ExtraBeesFlowers.doInit();
ExtraBeesSpecies.doInit();
ExtraBeeMutation.doInit();
ExtraBeesBranch.doInit();
}
@Override
public void postInit() {
int ebSpeciesCount = 0;
int ebTotalSpeciesCount = 0;
for (final ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
++ebTotalSpeciesCount;
if (!AlleleManager.alleleRegistry.isBlacklisted(species.getUID())) {
++ebSpeciesCount;
}
}
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), (ItemStack) null, new ItemStack(ExtraBees.dictionary), new Object[] { "X#X", "YEY", "RDR", '#', Blocks.glass_pane, 'X', Items.gold_ingot, 'Y', "ingotTin", 'R', Items.redstone, 'D', Items.diamond, 'E', Items.emerald });
}
public static IGenome getGenome(final IAlleleBeeSpecies allele0) {
return Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(allele0.getUID()));
}
public static ItemStack getBeeIcon(final IAlleleBeeSpecies species) {
if (species == null) {
return null;
}
final IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID());
if (template == null) {
return null;
}
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
final IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
final ItemStack item = Binnie.Genetics.getBeeRoot().getMemberStack(bee, EnumBeeType.PRINCESS.ordinal());
return item;
}
}
@@ -0,0 +1,43 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics.effect;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.extrabees.ExtraBees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.block.BlockWeb;
public class BlockEctoplasm extends BlockWeb
{
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(final IIconRegister register) {
this.blockIcon = ExtraBees.proxy.getIcon(register, "ectoplasm");
}
public BlockEctoplasm() {
this.setLightOpacity(1);
this.setHardness(0.5f);
}
@Override
public int quantityDropped(final Random rand) {
return (rand.nextInt(5) == 0) ? 1 : 0;
}
@Override
public Item getItemDropped(final int p_149650_1_, final Random p_149650_2_, final int p_149650_3_) {
return Items.slime_ball;
}
@Override
public String getUnlocalizedName() {
return "extrabees.block.ectoplasm";
}
}
@@ -0,0 +1,63 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics.effect;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.entity.effect.EntityLightningBolt;
public class EntityBeeLightning extends EntityLightningBolt
{
int lightningState;
int boltLivingTime;
public EntityBeeLightning(final World par1World, final double par2, final double par4, final double par6) {
super(par1World, par2, par4, par6);
this.lightningState = 2;
this.boltLivingTime = this.rand.nextInt(3) + 1;
}
@Override
public void onUpdate() {
this.onEntityUpdate();
--this.lightningState;
if (this.lightningState < 0) {
if (this.boltLivingTime == 0) {
this.setDead();
}
else if (this.lightningState < -this.rand.nextInt(10)) {
--this.boltLivingTime;
this.lightningState = 1;
this.boltVertex = this.rand.nextLong();
if (!this.worldObj.isRemote && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) {
final int i = MathHelper.floor_double(this.posX);
final int j = MathHelper.floor_double(this.posY);
final int k = MathHelper.floor_double(this.posZ);
if (this.worldObj.getBlock(i, j, k) == null && Blocks.fire.canPlaceBlockAt(this.worldObj, i, j, k)) {
this.worldObj.setBlock(i, j, k, Blocks.fire);
}
}
}
}
if (this.lightningState >= 0) {
if (this.worldObj.isRemote) {
this.worldObj.lastLightningBolt = 2;
}
else {
final double d0 = 3.0;
final List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0 + d0, this.posZ + d0));
for (int l = 0; l < list.size(); ++l) {
final Entity entity = (Entity) list.get(l);
entity.onStruckByLightning(this);
}
}
}
}
}
@@ -0,0 +1,589 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics.effect;
import java.util.Calendar;
import java.util.ArrayList;
import forestry.api.apiculture.IArmorApiarist;
import net.minecraft.tileentity.TileEntity;
import cofh.api.energy.IEnergyReceiver;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import binnie.extrabees.genetics.ExtraBeesFlowers;
import binnie.Binnie;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraft.entity.item.EntityFireworkRocket;
import net.minecraft.potion.PotionEffect;
import net.minecraft.potion.Potion;
import net.minecraft.util.DamageSource;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.world.WorldServer;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeeGenome;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.world.World;
import binnie.extrabees.ExtraBees;
import forestry.api.genetics.IEffectData;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.AlleleManager;
import java.util.List;
import forestry.api.apiculture.IAlleleBeeEffect;
import forestry.core.proxy.Proxies;
public enum ExtraBeesEffect implements IAlleleBeeEffect
{
ECTOPLASM,
ACID,
SPAWN_ZOMBIE,
SPAWN_SKELETON,
SPAWN_CREEPER,
LIGHTNING,
RADIOACTIVE,
METEOR,
HUNGER,
FOOD,
BLINDNESS,
CONFUSION,
FIREWORKS,
FESTIVAL,
BIRTHDAY,
TELEPORT,
GRAVITY,
THIEF,
WITHER,
WATER,
SLOW,
BonemealSapling,
BonemealFruit,
BonemealMushroom,
Power;
String fx;
public boolean combinable;
public boolean dominant;
public int id;
private String uid;
static List<Birthday> birthdays;
private ExtraBeesEffect() {
this.fx = "";
this.uid = this.toString().toLowerCase();
this.combinable = false;
this.dominant = true;
}
public static void doInit() {
ExtraBeesEffect.BLINDNESS.setFX("blindness");
ExtraBeesEffect.FOOD.setFX("food");
ExtraBeesEffect.GRAVITY.setFX("gravity");
ExtraBeesEffect.THIEF.setFX("gravity");
ExtraBeesEffect.TELEPORT.setFX("gravity");
ExtraBeesEffect.LIGHTNING.setFX("lightning");
ExtraBeesEffect.METEOR.setFX("meteor");
ExtraBeesEffect.RADIOACTIVE.setFX("radioactive");
ExtraBeesEffect.WATER.setFX("water");
ExtraBeesEffect.WITHER.setFX("wither");
for (final ExtraBeesEffect effect : values()) {
effect.register();
}
}
private void setFX(final String string) {
this.fx = "particles/" + string;
}
public void register() {
AlleleManager.alleleRegistry.registerAllele(this);
}
@Override
public boolean isCombinable() {
return this.combinable;
}
@Override
public IEffectData validateStorage(final IEffectData storedData) {
return storedData;
}
@Override
public String getName() {
return ExtraBees.proxy.localise("effect." + this.name().toString().toLowerCase() + ".name");
}
@Override
public boolean isDominant() {
return this.dominant;
}
public void spawnMob(final World world, final int x, final int y, final int z, final String name) {
if (this.anyPlayerInRange(world, x, y, z, 16)) {
final double var1 = x + world.rand.nextFloat();
final double var2 = y + world.rand.nextFloat();
final double var3 = z + world.rand.nextFloat();
world.spawnParticle("smoke", var1, var2, var3, 0.0, 0.0, 0.0);
world.spawnParticle("flame", var1, var2, var3, 0.0, 0.0, 0.0);
final EntityLiving var4 = (EntityLiving) EntityList.createEntityByName(name, world);
if (var4 == null) {
return;
}
final int var5 = world.getEntitiesWithinAABB(var4.getClass(), AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(8.0, 4.0, 8.0)).size();
if (var5 >= 6) {
return;
}
if (var4 != null) {
final double var6 = x + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
final double var7 = y + world.rand.nextInt(3) - 1;
final double var8 = z + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
var4.setLocationAndAngles(var6, var7, var8, world.rand.nextFloat() * 360.0f, 0.0f);
if (var4.getCanSpawnHere()) {
world.spawnEntityInWorld(var4);
world.playAuxSFX(2004, x, y, z, 0);
var4.spawnExplosionParticle();
}
}
}
}
private boolean anyPlayerInRange(final World world, final int x, final int y, final int z, final int distance) {
return world.getClosestPlayer(x + 0.5, y + 0.5, z + 0.5, distance) != null;
}
public static void doAcid(final World world, final int x, final int y, final int z) {
final Block block = world.getBlock(x, y, z);
if (block == Blocks.cobblestone || block == Blocks.stone) {
world.setBlock(x, y, z, Blocks.gravel, 0, 0);
}
else if (block == Blocks.dirt | block == Blocks.grass) {
world.setBlock(x, y, z, Blocks.sand, 0, 0);
}
}
@Override
public String getUID() {
return "extrabees.effect." + this.uid;
}
@Override
public IEffectData doEffect(final IBeeGenome genome, final IEffectData storedData, final IBeeHousing housing) {
final World world = housing.getWorld();
final int xHouse = housing.getCoordinates().posX;
final int yHouse = housing.getCoordinates().posY;
final int zHouse = housing.getCoordinates().posZ;
final int[] area = this.getModifiedArea(genome, housing);
final int xd = 1 + area[0] / 2;
final int yd = 1 + area[1] / 2;
final int zd = 1 + area[2] / 2;
final int x1 = xHouse - xd + world.rand.nextInt(2 * xd + 1);
int y1 = yHouse - yd + world.rand.nextInt(2 * yd + 1);
final int z1 = zHouse - zd + world.rand.nextInt(2 * zd + 1);
switch (this) {
case ECTOPLASM: {
if (world.rand.nextInt(100) < 4) {
if (world.isAirBlock(x1, y1, z1) && (world.isBlockNormalCubeDefault(x1, y1 - 1, z1, false) || world.getBlock(x1, y1 - 1, z1) == ExtraBees.ectoplasm)) {
world.setBlock(x1, y1, z1, ExtraBees.ectoplasm, 0, 0);
}
return null;
}
break;
}
case ACID: {
if (world.rand.nextInt(100) < 6) {
doAcid(world, x1, y1, z1);
break;
}
break;
}
case SPAWN_ZOMBIE: {
if (world.rand.nextInt(200) < 2) {
this.spawnMob(world, x1, y1, z1, "Zombie");
break;
}
break;
}
case SPAWN_SKELETON: {
if (world.rand.nextInt(200) < 2) {
this.spawnMob(world, x1, y1, z1, "Skeleton");
break;
}
break;
}
case SPAWN_CREEPER: {
if (world.rand.nextInt(200) < 2) {
this.spawnMob(world, x1, y1, z1, "Creeper");
break;
}
break;
}
case LIGHTNING: {
if (world.rand.nextInt(100) < 1 && world.canBlockSeeTheSky(x1, y1, z1) && world instanceof WorldServer) {
((WorldServer) world).addWeatherEffect(new EntityBeeLightning(world, x1, y1, z1));
break;
}
break;
}
case METEOR: {
if (world.rand.nextInt(100) < 1 && world.canBlockSeeTheSky(x1, y1, z1)) {
((WorldServer) world).spawnEntityInWorld(new EntitySmallFireball(world, x1, y1 + 64, z1, 0.0, -0.6, 0.0));
break;
}
break;
}
case RADIOACTIVE: {
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
int damage = 4;
if (entity instanceof EntityPlayer) {
final int count = wearsItems((EntityPlayer) entity);
if (count > 3) {
continue;
}
if (count > 2) {
damage = 1;
}
else if (count > 1) {
damage = 2;
}
else if (count > 0) {
damage = 3;
}
}
entity.attackEntityFrom(DamageSource.generic, damage);
}
break;
}
case FOOD: {
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
if (entity instanceof EntityPlayer) {
final EntityPlayer player = (EntityPlayer) entity;
player.getFoodStats().addStats(2, 0.2f);
}
}
break;
}
case HUNGER: {
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
if (entity instanceof EntityPlayer) {
final EntityPlayer player = (EntityPlayer) entity;
if (world.rand.nextInt(4) < wearsItems(player)) {
continue;
}
player.getFoodStats().addExhaustion(4.0f);
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 100));
}
}
break;
}
case BLINDNESS: {
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
if (entity instanceof EntityPlayer) {
final EntityPlayer player = (EntityPlayer) entity;
if (world.rand.nextInt(4) < wearsItems(player)) {
continue;
}
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 200));
}
}
break;
}
case SLOW: {
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
if (entity instanceof EntityPlayer) {
final EntityPlayer player = (EntityPlayer) entity;
if (world.rand.nextInt(4) < wearsItems(player)) {
continue;
}
player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200));
}
}
break;
}
case CONFUSION: {
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
if (entity instanceof EntityPlayer) {
final EntityPlayer player = (EntityPlayer) entity;
if (world.rand.nextInt(4) < wearsItems(player)) {
continue;
}
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200));
}
}
break;
}
case BIRTHDAY:
case FESTIVAL:
case FIREWORKS: {
if (world.rand.nextInt((this == ExtraBeesEffect.FIREWORKS) ? 8 : 12) < 1) {
final FireworkCreator.Firework firework = new FireworkCreator.Firework();
switch (this) {
case BIRTHDAY: {
firework.setShape(FireworkCreator.Shape.Star);
firework.addColor(16768256);
for (final Birthday birthday : ExtraBeesEffect.birthdays) {
if (birthday.isToday()) {
firework.addColor(16711680);
firework.addColor(65280);
firework.addColor(255);
firework.setTrail();
break;
}
}
}
case FIREWORKS: {
firework.setShape(FireworkCreator.Shape.Ball);
firework.addColor(genome.getPrimary().getIconColour(0));
firework.addColor(genome.getPrimary().getIconColour(0));
firework.addColor(genome.getPrimary().getIconColour(1));
firework.addColor(genome.getSecondary().getIconColour(0));
firework.addColor(genome.getSecondary().getIconColour(0));
firework.addColor(genome.getPrimary().getIconColour(1));
firework.setTrail();
break;
}
}
final EntityFireworkRocket var11 = new EntityFireworkRocket(world, x1, y1, z1, firework.getFirework());
if (world.canBlockSeeTheSky(x1, y1, z1)) {
((WorldServer) world).spawnEntityInWorld(var11);
}
break;
}
break;
}
case GRAVITY: {
final List<Entity> entities2 = this.getEntities(Entity.class, genome, housing);
for (final Entity entity2 : entities2) {
float entityStrength = 1.0f;
if (entity2 instanceof EntityPlayer) {
entityStrength *= 100.0f;
}
final double dx = x1 - entity2.posX;
final double dy = y1 - entity2.posY;
final double dz = z1 - entity2.posZ;
if (dx * dx + dy * dy + dz * dz < 2.0) {
return null;
}
final double strength = 0.5 / (dx * dx + dy * dy + dz * dz) * entityStrength;
entity2.addVelocity(dx * strength, dy * strength, dz * strength);
}
break;
}
case THIEF: {
final List<EntityPlayer> entities3 = this.getEntities(EntityPlayer.class, genome, housing);
for (final EntityPlayer entity3 : entities3) {
final double dx = x1 - entity3.posX;
final double dy = y1 - entity3.posY;
final double dz = z1 - entity3.posZ;
if (dx * dx + dy * dy + dz * dz < 2.0) {
return null;
}
final double strength = 0.5 / (dx * dx + dy * dy + dz * dz);
entity3.addVelocity(-dx * strength, -dy * strength, -dz * strength);
}
break;
}
case TELEPORT: {
if (world.rand.nextInt(80) > 1) {
return null;
}
final List<Entity> entities4 = this.getEntities(Entity.class, genome, housing);
if (entities4.size() == 0) {
return null;
}
final Entity entity4 = entities4.get(world.rand.nextInt(entities4.size()));
if (!(entity4 instanceof EntityLiving)) {
return null;
}
final float jumpDist = 5.0f;
if (y1 < 4) {
y1 = 4;
}
if (!world.isAirBlock(x1, y1, z1) || !world.isAirBlock(x1, y1 + 1, z1)) {
return null;
}
((EntityLiving) entity4).setPositionAndUpdate(x1, y1, z1);
((EntityLiving) entity4).addPotionEffect(new PotionEffect(Potion.confusion.id, 160, 10));
break;
}
case WATER: {
if (world.rand.nextInt(120) > 1) {
return null;
}
final TileEntity tile = world.getTileEntity(x1, y1, z1);
if (tile instanceof IFluidHandler) {
((IFluidHandler) tile).fill(ForgeDirection.UP, Binnie.Liquid.getLiquidStack("water", 100), true);
break;
}
break;
}
case BonemealSapling: {
if (world.rand.nextInt(20) > 1) {
return null;
}
if (ExtraBeesFlowers.Sapling.isAcceptedFlower(world, null, x1, y1, z1)) {
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x1, y1, z1, (EntityPlayer) null);
break;
}
break;
}
case BonemealFruit: {
if (world.rand.nextInt(20) > 1) {
return null;
}
if (ExtraBeesFlowers.Fruit.isAcceptedFlower(world, null, x1, y1, z1)) {
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x1, y1, z1, (EntityPlayer) null);
break;
}
break;
}
case BonemealMushroom: {
if (world.rand.nextInt(20) > 1) {
return null;
}
if (world.getBlock(x1, y1, z1) == Blocks.brown_mushroom || world.getBlock(x1, y1, z1) == Blocks.red_mushroom) {
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x1, y1, z1, (EntityPlayer) null);
break;
}
break;
}
case Power: {
final TileEntity tile2 = world.getTileEntity(x1, y1, z1);
if (tile2 instanceof IEnergyReceiver) {
((IEnergyReceiver) tile2).receiveEnergy(ForgeDirection.getOrientation(0), 5, true);
break;
}
break;
}
}
return null;
}
protected int[] getModifiedArea(final IBeeGenome genome, final IBeeHousing housing) {
final int[] territory;
final int[] area = territory = genome.getTerritory();
final int n = 0;
territory[n] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f);
final int[] array = area;
final int n2 = 1;
array[n2] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f);
final int[] array2 = area;
final int n3 = 2;
array2[n3] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f);
if (area[0] < 1) {
area[0] = 1;
}
if (area[1] < 1) {
area[1] = 1;
}
if (area[2] < 1) {
area[2] = 1;
}
return area;
}
@Override
public IEffectData doFX(final IBeeGenome genome, final IEffectData storedData, final IBeeHousing housing) {
Proxies.render.addBeeHiveFX("particles/swarm_bee", housing.getWorld(), housing.getBeeFXCoordinates().xCoord, housing.getBeeFXCoordinates().yCoord, housing.getBeeFXCoordinates().zCoord, genome.getPrimary().getIconColour(0));
return storedData;
}
public String getFX() {
return this.fx;
}
public <T extends Entity> List<T> getEntities(final Class<T> eClass, final IBeeGenome genome, final IBeeHousing housing) {
final int[] area = genome.getTerritory();
final int[] offset = { -Math.round(area[0] / 2), -Math.round(area[1] / 2), -Math.round(area[2] / 2) };
final int[] min = { housing.getCoordinates().posX + offset[0], housing.getCoordinates().posY + offset[1], housing.getCoordinates().posZ + offset[2] };
final int[] max = { housing.getCoordinates().posX + offset[0] + area[0], housing.getCoordinates().posY + offset[1] + area[1], housing.getCoordinates().posZ + offset[2] + area[2] };
final AxisAlignedBB box = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]);
return housing.getWorld().getEntitiesWithinAABB(eClass, box);
}
public static boolean wearsHelmet(final EntityPlayer player) {
final ItemStack armorItem = player.inventory.armorInventory[3];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static boolean wearsChest(final EntityPlayer player) {
final ItemStack armorItem = player.inventory.armorInventory[2];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static boolean wearsLegs(final EntityPlayer player) {
final ItemStack armorItem = player.inventory.armorInventory[1];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static boolean wearsBoots(final EntityPlayer player) {
final ItemStack armorItem = player.inventory.armorInventory[0];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static int wearsItems(final EntityPlayer player) {
int count = 0;
if (wearsHelmet(player)) {
++count;
}
if (wearsChest(player)) {
++count;
}
if (wearsLegs(player)) {
++count;
}
if (wearsBoots(player)) {
++count;
}
return count;
}
@Override
public String getUnlocalizedName() {
return this.getUID();
}
static {
(ExtraBeesEffect.birthdays = new ArrayList<Birthday>()).add(new Birthday(3, 10, "Binnie"));
}
public static class Birthday
{
int day;
int month;
String name;
public boolean isToday() {
return Calendar.getInstance().get(5) == this.month && Calendar.getInstance().get(2) == this.day;
}
public String getName() {
return this.name;
}
private Birthday(final int day, final int month, final String name) {
this.day = day;
this.month = month + 1;
this.name = name;
}
}
}
@@ -0,0 +1,88 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics.effect;
import net.minecraft.init.Items;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import java.util.ArrayList;
public class FireworkCreator
{
public enum Shape
{
Ball,
LargeBall,
Star,
Creeper,
Burst;
}
public static class Firework
{
boolean flicker;
boolean trail;
ArrayList<Integer> colors;
byte shape;
public Firework() {
this.flicker = false;
this.trail = false;
this.colors = new ArrayList<Integer>();
this.shape = 0;
}
public void setFlicker() {
this.flicker = true;
}
public void setTrail() {
this.trail = true;
}
public void setShape(final Shape shape) {
this.shape = (byte) shape.ordinal();
}
public void addColor(final int color) {
this.colors.add(color);
}
NBTTagCompound getNBT() {
final NBTTagCompound nbt = new NBTTagCompound();
if (this.flicker) {
nbt.setBoolean("Flicker", true);
}
if (this.trail) {
nbt.setBoolean("Trail", true);
}
if (this.colors.size() == 0) {
this.addColor(16777215);
}
final int[] array = new int[this.colors.size()];
for (int i = 0; i < this.colors.size(); ++i) {
array[i] = this.colors.get(i);
}
nbt.setIntArray("Colors", array);
nbt.setByte("Type", this.shape);
return nbt;
}
public ItemStack getFirework() {
final NBTTagCompound var15 = new NBTTagCompound();
final NBTTagCompound var16 = new NBTTagCompound();
final NBTTagList var17 = new NBTTagList();
var17.appendTag(this.getNBT());
var16.setTag("Explosions", var17);
var16.setByte("Flight", (byte) 0);
var15.setTag("Fireworks", var16);
final ItemStack item = new ItemStack(Items.fireworks);
item.setTagCompound(var15);
return item;
}
}
}
@@ -0,0 +1,75 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics.items;
import binnie.extrabees.core.ExtraBeeGUID;
import net.minecraft.world.World;
import forestry.api.core.Tabs;
import net.minecraft.creativetab.CreativeTabs;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.extrabees.ExtraBees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.item.Item;
public class ItemDictionary extends Item
{
IIcon iconMaster;
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(final IIconRegister register) {
this.itemIcon = ExtraBees.proxy.getIcon(register, "apiaristDatabase");
this.iconMaster = ExtraBees.proxy.getIcon(register, "masterApiaristDatabase");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(final int par1) {
return (par1 == 0) ? this.itemIcon : this.iconMaster;
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final List par3List, final boolean par4) {
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
if (par1ItemStack.getItemDamage() > 0) {
par3List.add("Flora-in-a-box");
}
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
super.getSubItems(par1, par2CreativeTabs, par3List);
par3List.add(new ItemStack(par1, 1, 1));
}
public ItemDictionary() {
this.setCreativeTab(Tabs.tabApiculture);
this.setUnlocalizedName("dictionary");
this.setMaxStackSize(1);
}
@Override
public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
if (itemstack.getItemDamage() == 0) {
ExtraBees.proxy.openGui(ExtraBeeGUID.Database, player, (int) player.posX, (int) player.posY, (int) player.posZ);
}
else {
ExtraBees.proxy.openGui(ExtraBeeGUID.DatabaseNEI, player, (int) player.posX, (int) player.posY, (int) player.posZ);
}
return itemstack;
}
@Override
public String getItemStackDisplayName(final ItemStack i) {
return (i.getItemDamage() == 0) ? "Apiarist Database" : "Master Apiarist Database";
}
}
@@ -0,0 +1,41 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.extrabees.genetics.items;
import binnie.extrabees.core.ExtraBeeGUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraft.item.ItemStack;
import net.minecraft.creativetab.CreativeTabs;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import binnie.extrabees.ExtraBees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
public class ItemPunnettSquare extends Item
{
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(final IIconRegister register) {
this.itemIcon = ExtraBees.proxy.getIcon(register, "");
}
public ItemPunnettSquare() {
this.setCreativeTab(CreativeTabs.tabTools);
this.setMaxStackSize(1);
}
@Override
public String getItemStackDisplayName(final ItemStack itemstack) {
return "Punnett Square";
}
@Override
public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
ExtraBees.proxy.openGui(ExtraBeeGUID.PunnettSquare, player, (int) player.posX, (int) player.posY, (int) player.posZ);
return itemstack;
}
}