mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-25 06:24:54 +00:00
New Mutations.
Also, I'm an asshole. =D
This commit is contained in:
1 parent
e14a3c6a62
commit
fe8c118f7f
10 files changed
+232
-64
No files matched your search
@@ -1293,9 +1293,17 @@ public class BeeGenomeManager {
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateBotBotanic() {
|
||||
public static IAllele[] getTemplateBotRooted() {
|
||||
IAllele[] genome = getTemplateBotaniaBase();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_ROOTED;
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateBotBotanic() {
|
||||
IAllele[] genome = getTemplateBotRooted();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_BOTANIC;
|
||||
genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerBotania;
|
||||
|
||||
@@ -1323,9 +1331,33 @@ public class BeeGenomeManager {
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateBotVazbee() {
|
||||
IAllele[] genome = getTemplateBotaniaBase();
|
||||
IAllele[] genome = getTemplateBotFloral();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_VAZBEE;
|
||||
genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityLow");
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateBotSomnolent() {
|
||||
IAllele[] genome = getTemplateBotaniaBase();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_SOMNOLENT;
|
||||
genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerBotania;
|
||||
genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceUp2");
|
||||
genome[EnumBeeChromosome.NOCTURNAL.ordinal()] = Allele.getBaseAllele("boolTrue");
|
||||
genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue");
|
||||
genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedSlowest");
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateBotDreaming() {
|
||||
IAllele[] genome = getTemplateBotSomnolent();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_DREAMING;
|
||||
genome[EnumBeeChromosome.SPEED.ordinal()] = Allele.getBaseAllele("speedNormal");
|
||||
genome[EnumBeeChromosome.TERRITORY.ordinal()] = Allele.getBaseAllele("territoryLarger");
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
@@ -10,9 +10,15 @@ import magicbees.item.types.DropType;
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.Tuple;
|
||||
import magicbees.main.utils.compat.ExtraBeesHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
public class BeeManager
|
||||
{
|
||||
@@ -35,6 +41,22 @@ 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);
|
||||
return BeeManager.beeRoot.getMemberStack(bee, type.ordinal());
|
||||
}
|
||||
|
||||
public static IBee getBeeFromSpecies(IAlleleBeeSpecies species, boolean applyRainResist) {
|
||||
IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(species.getUID());
|
||||
|
||||
if (applyRainResist) {
|
||||
speciesTemplate = BeeGenomeManager.addRainResist(speciesTemplate);
|
||||
}
|
||||
|
||||
IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(speciesTemplate);
|
||||
return BeeManager.beeRoot.getBee(null, genome);
|
||||
}
|
||||
|
||||
public static IAlleleBeeSpecies getRandomWorldgenSpecies(Random r) {
|
||||
Collections.shuffle(worldgenSpeciesWeights);
|
||||
double value = r.nextDouble() * worldgenSpeciesWeightsTotal;
|
||||
|
||||
@@ -8,6 +8,7 @@ import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.LogHelper;
|
||||
import magicbees.main.utils.MoonPhase;
|
||||
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import magicbees.main.utils.compat.EquivalentExchangeHelper;
|
||||
import magicbees.main.utils.compat.ExtraBeesHelper;
|
||||
import magicbees.main.utils.compat.ForestryHelper;
|
||||
@@ -290,8 +291,21 @@ public class BeeMutation implements IBeeMutation
|
||||
new BeeMutation(BeeSpecies.TE_WINSOME, BeeSpecies.TE_COAL, BeeSpecies.TE_ENDEARING, 8)
|
||||
.setBlockRequired("blockEnderium");
|
||||
}
|
||||
|
||||
if (BotaniaHelper.isActive()) {
|
||||
new BeeMutation(BeeSpecies.ELDRITCH, Allele.getBaseSpecies("Forest"), BeeSpecies.BOT_ROOTED, 15)
|
||||
.setBlockRequired(BotaniaHelper.blockLivingWood);
|
||||
|
||||
new BeeMutation(BeeSpecies.BOT_ROOTED, BeeSpecies.WATERY, BeeSpecies.BOT_SOMNOLENT, 16)
|
||||
.setRequiresNight();
|
||||
new BeeMutation(BeeSpecies.BOT_ROOTED, BeeSpecies.BOT_SOMNOLENT, BeeSpecies.BOT_DREAMING, 8)
|
||||
.setRequiresNight();
|
||||
|
||||
new BeeMutation(BeeSpecies.BOT_BOTANIC, BeeSpecies.EARTHY, BeeSpecies.BOT_BLOSSOM, 12);
|
||||
new BeeMutation(BeeSpecies.BOT_BOTANIC, BeeSpecies.BOT_BLOSSOM, BeeSpecies.BOT_FLORAL, 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private IAllele parent1;
|
||||
private IAllele parent2;
|
||||
private IAllele mutationTemplate[];
|
||||
@@ -301,6 +315,7 @@ public class BeeMutation implements IBeeMutation
|
||||
private MoonPhase moonPhaseStart;
|
||||
private MoonPhase moonPhaseEnd;
|
||||
private float moonPhaseMutationBonus;
|
||||
private boolean requiresNight;
|
||||
private boolean requiresBlock;
|
||||
private Block requiredBlock;
|
||||
private int requiredBlockMeta;
|
||||
@@ -322,7 +337,7 @@ public class BeeMutation implements IBeeMutation
|
||||
this.isSecret = false;
|
||||
this.isMoonRestricted = false;
|
||||
this.moonPhaseMutationBonus = -1f;
|
||||
//this.nodeType = null;
|
||||
this.requiresNight = false;
|
||||
this.requiresBlock = false;
|
||||
this.requiredBlockMeta = OreDictionary.WILDCARD_VALUE;
|
||||
this.requiredBlockOreDictEntry = null;
|
||||
@@ -412,6 +427,12 @@ public class BeeMutation implements IBeeMutation
|
||||
}
|
||||
}
|
||||
|
||||
if (this.requiresNight) {
|
||||
if (!housing.getWorld().isDaytime()) {
|
||||
chance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
finalChance = Math.round(chance
|
||||
* housing.getMutationModifier((IBeeGenome)genome0,
|
||||
(IBeeGenome)genome1, chance)
|
||||
@@ -597,4 +618,10 @@ public class BeeMutation implements IBeeMutation
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public BeeMutation setRequiresNight() {
|
||||
this.requiresNight = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -115,6 +115,8 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
BeeClassification.SKULKING, 0x0888888, 0x222222, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
SMOULDERING("Smouldering", "flagrantia",
|
||||
BeeClassification.SKULKING, 0xFFC747, 0xEA8344, EnumTemperature.HELLISH, EnumHumidity.NORMAL, false, false),
|
||||
BIGBAD("BigBad", "magnumalum",
|
||||
BeeClassification.SKULKING, 0x000000, 0x000000, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
|
||||
TIMELY("Timely", "gallifreis",
|
||||
BeeClassification.TIME, 0xC6AF86, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
@@ -299,15 +301,26 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
|
||||
|
||||
//----------------------Botania Bees---------------------------------------
|
||||
BOT_ROOTED("BotRooted", "truncus",
|
||||
BeeClassification.BOTANICAL, 0x00A800, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
|
||||
BOT_BOTANIC("BotBotanic", "botanica",
|
||||
BeeClassification.BOTANICAL, 0xffffff, 0x6666ff, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
BeeClassification.BOTANICAL, 0x94C661, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
BOT_BLOSSOM("BotBlossom", "viridis",
|
||||
BeeClassification.BOTANICAL, 0x00ffff, 0x6666ff, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
|
||||
BeeClassification.BOTANICAL, 0xA4C193, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
|
||||
BOT_FLORAL("BotFloral", "florens",
|
||||
BeeClassification.BOTANICAL, 0x0000ff, 0x6666ff, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
BeeClassification.BOTANICAL, 0x29D81A, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
|
||||
BOT_VAZBEE("BotVazbee", "vazbii",
|
||||
BeeClassification.BOTANICAL, 0x00ff00, 0x6666ff, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
|
||||
BeeClassification.BOTANICAL, 0xff6b9c, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
|
||||
|
||||
BOT_SOMNOLENT("BotSomnolent", "soporatus",
|
||||
BeeClassification.BOTANICAL, 0x2978C6, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
|
||||
BOT_DREAMING("BotDreaming", "somnior",
|
||||
BeeClassification.BOTANICAL, 0x123456, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
|
||||
|
||||
BOT_AELFHEIM("BotAelfheim", "aelfheimis",
|
||||
BeeClassification.BOTANICAL, 0x987654, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
|
||||
|
||||
;
|
||||
|
||||
@@ -351,7 +364,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
TC_BEEF.setInactive();
|
||||
TC_PORK.setInactive();
|
||||
}
|
||||
// TODO: Temporary always off. Maybe.
|
||||
|
||||
TC_WISPY.setInactive();
|
||||
TC_TAINT.setInactive();
|
||||
TC_ATTRACT.setInactive();
|
||||
@@ -444,7 +457,16 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
|
||||
if (BotaniaHelper.isActive())
|
||||
{
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
ItemStack petal = new ItemStack(BotaniaHelper.itemPetal, 1, i);
|
||||
BOT_BOTANIC.addSpecialty(petal, 1);
|
||||
BOT_BLOSSOM.addSpecialty(petal, 1);
|
||||
BOT_FLORAL.addSpecialty(petal, 1);
|
||||
}
|
||||
|
||||
for (PastureSeed type : PastureSeed.values()) {
|
||||
BOT_VAZBEE.addSpecialty(new ItemStack(BotaniaHelper.itemPastureSeed, 1, type.ordinal()), 4);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -994,34 +1016,43 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
.setGenome(BeeGenomeManager.getTemplateBMBound())
|
||||
.register();
|
||||
|
||||
BOT_ROOTED.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 10)
|
||||
.setGenome(BeeGenomeManager.getTemplateBotRooted())
|
||||
.register();
|
||||
|
||||
BOT_BOTANIC.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 10)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 5)
|
||||
.setGenome(BeeGenomeManager.getTemplateBotBotanic())
|
||||
.register();
|
||||
|
||||
BOT_BLOSSOM.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 20)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 5)
|
||||
.setGenome(BeeGenomeManager.getTemplateBotBlossom())
|
||||
.register();
|
||||
|
||||
BOT_FLORAL.addProduct(Config.combs.getStackForType(CombType.MUNDANE), 25)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 5)
|
||||
.setGenome(BeeGenomeManager.getTemplateBotFloral())
|
||||
.register();
|
||||
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
ItemStack petal = new ItemStack(BotaniaHelper.itemPetal, 1, i);
|
||||
BOT_BOTANIC.addSpecialty(petal, 1);
|
||||
BOT_BLOSSOM.addSpecialty(petal, 1);
|
||||
BOT_FLORAL.addSpecialty(petal, 1);
|
||||
}
|
||||
|
||||
|
||||
BOT_VAZBEE.addProduct(Config.combs.getStackForType(CombType.SOUL), 5)
|
||||
.addProduct(new ItemStack(Items.dye, 1, 9), 20)
|
||||
.addProduct(new ItemStack(Blocks.wool, 1, 9), 2)
|
||||
.addProduct(new ItemStack(Blocks.red_flower, 1, 7), 6)
|
||||
.addProduct(Config.combs.getStackForType(CombType.TRANSMUTED), 15)
|
||||
.setGenome(BeeGenomeManager.getTemplateBotVazbee())
|
||||
.register();
|
||||
|
||||
for (PastureSeed type : PastureSeed.values()) {
|
||||
BOT_VAZBEE.addSpecialty(new ItemStack(BotaniaHelper.itemPastureSeed, 1, type.ordinal()), 4);
|
||||
}
|
||||
BOT_SOMNOLENT.addProduct(Config.combs.getStackForType(CombType.WATERY), 8)
|
||||
.addProduct(Config.combs.getStackForType(CombType.SOUL), 15)
|
||||
.setGenome(BeeGenomeManager.getTemplateBotSomnolent())
|
||||
.register();
|
||||
|
||||
BOT_DREAMING.addProduct(Config.combs.getStackForType(CombType.WATERY), 16)
|
||||
.addProduct(Config.combs.getStackForType(CombType.SOUL), 33)
|
||||
.setGenome(BeeGenomeManager.getTemplateBotDreaming())
|
||||
.register();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1042,7 +1073,6 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
private IAllele genomeTemplate[];
|
||||
private String uid;
|
||||
private boolean dominant;
|
||||
private int complexity;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[][] icons;
|
||||
@@ -1092,8 +1122,8 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
hasEffect = hasGlowEffect;
|
||||
isSecret = isSpeciesSecret;
|
||||
isCounted = isSpeciesCounted;
|
||||
products = new HashMap();
|
||||
specialties = new HashMap();
|
||||
products = new HashMap<ItemStack, Integer>();
|
||||
specialties = new HashMap<ItemStack, Integer>();
|
||||
this.branch = classification;
|
||||
this.branch.addMemberSpecies(this);
|
||||
this.isActive = true;
|
||||
@@ -1206,13 +1236,13 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getProducts()
|
||||
public HashMap<ItemStack, Integer> getProducts()
|
||||
{
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getSpecialty()
|
||||
public HashMap<ItemStack, Integer> getSpecialty()
|
||||
{
|
||||
return specialties;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user