mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-17 11:05:02 +00:00
Adding Mutations.
Adding a species' primary or secondary colour to be -1, and if so, shifting it based on client time. (might make it world time later...)
This commit is contained in:
1 parent
30509d4180
commit
99c40a99a9
6 files changed
+94
-5
No files matched your search
@@ -1362,6 +1362,14 @@ public class BeeGenomeManager {
|
||||
return genome;
|
||||
}
|
||||
|
||||
public static IAllele[] getTemplateBotAelfheim() {
|
||||
IAllele[] genome = getTemplateBotDreaming();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_AELFHEIM;
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
/*--------------------- Other Stuff ---------------------------------- */
|
||||
|
||||
public static ItemStack getBeeNBTForSpecies(BeeSpecies species, EnumBeeType beeType) {
|
||||
|
||||
@@ -298,7 +298,7 @@ public class BeeMutation implements IBeeMutation
|
||||
|
||||
new BeeMutation(BeeSpecies.BOT_ROOTED, BeeSpecies.WATERY, BeeSpecies.BOT_SOMNOLENT, 16)
|
||||
.setRequiresNight();
|
||||
new BeeMutation(BeeSpecies.BOT_ROOTED, BeeSpecies.BOT_SOMNOLENT, BeeSpecies.BOT_DREAMING, 8)
|
||||
new BeeMutation(BeeSpecies.WINDY, BeeSpecies.BOT_SOMNOLENT, BeeSpecies.BOT_DREAMING, 8)
|
||||
.setRequiresNight();
|
||||
|
||||
new BeeMutation(BeeSpecies.BOT_BOTANIC, BeeSpecies.EARTHY, BeeSpecies.BOT_BLOSSOM, 12);
|
||||
@@ -535,6 +535,10 @@ public class BeeMutation implements IBeeMutation
|
||||
conditions.add(String.format(LocalizationManager.getLocalizedString("research.requiresBiome"), biomeName));
|
||||
}
|
||||
|
||||
if (this.requiresNight) {
|
||||
conditions.add(LocalizationManager.getLocalizedString("research.requiresNight"));
|
||||
}
|
||||
|
||||
return conditions;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@@ -320,7 +321,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
BeeClassification.BOTANICAL, 0x123456, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
|
||||
|
||||
BOT_AELFHEIM("BotAelfheim", "aelfheimis",
|
||||
BeeClassification.BOTANICAL, 0x987654, 0xFFB2BB, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
|
||||
BeeClassification.BOTANICAL, -1/*0x987654*/, -1/*0xFFB2BB*/, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
|
||||
|
||||
;
|
||||
|
||||
@@ -1053,6 +1054,10 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
.setGenome(BeeGenomeManager.getTemplateBotDreaming())
|
||||
.register();
|
||||
|
||||
BOT_AELFHEIM
|
||||
.setGenome(BeeGenomeManager.getTemplateBotAelfheim())
|
||||
.register();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1293,11 +1298,25 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
int value = 0xffffff;
|
||||
if (renderPass == 0)
|
||||
{
|
||||
value = this.primaryColour;
|
||||
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)
|
||||
{
|
||||
value = this.secondaryColour;
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package magicbees.main.utils.compat.botania;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import magicbees.bees.BeeSpecies;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import magicbees.main.utils.compat.BotaniaHelper.ManaResource;
|
||||
@@ -8,8 +7,10 @@ import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
|
||||
/**
|
||||
* Subordinate helper to the Botania Helper that has references to Botania API stuff that will cause
|
||||
@@ -23,6 +24,8 @@ public class BotaniaAPIDistanceHelper {
|
||||
public static RecipeManaInfusion infusionBeeBotanical;
|
||||
public static RecipeManaInfusion infusionBeeVazbee;
|
||||
|
||||
public static RecipeElvenTrade tradeBeeAelfheim;
|
||||
|
||||
public static void registerSubtiles() {
|
||||
BotaniaAPI.registerSubTile(SubTileBeegonia.NAME, SubTileBeegonia.class);
|
||||
BotaniaAPI.registerSubTileSignature(SubTileBeegonia.class, new BotaniaSignature(SubTileBeegonia.NAME));
|
||||
@@ -38,8 +41,11 @@ public class BotaniaAPIDistanceHelper {
|
||||
BotaniaAPI.manaInfusionRecipes.add(infusionBeeBotanical);
|
||||
|
||||
infusionBeeVazbee = new SpeciesRecipeManaInfusion(BeeSpecies.BOT_VAZBEE, BeeSpecies.BOT_VAZBEE, 167392, EnumBeeType.PRINCESS);
|
||||
infusionBeeVazbee.setAlchemy(true);
|
||||
BotaniaAPI.manaInfusionRecipes.add(infusionBeeVazbee);
|
||||
|
||||
tradeBeeAelfheim = new SpeciesRecipeElvenTrade(BeeSpecies.BOT_DREAMING, BeeSpecies.BOT_AELFHEIM);
|
||||
|
||||
LexiconEntry manasteelEntry = getLexiconEntryForName(BotaniaHelper.LEXICON_ENTRY_MANA_GEAR);
|
||||
manasteelEntry.addPage(BotaniaAPI.internalHandler.craftingRecipePage("magicbees.botania.lexicon.manasteelScoop", BotaniaHelper.manasteelScoopRecipe));
|
||||
manasteelEntry.addPage(BotaniaAPI.internalHandler.craftingRecipePage("magicbees.botania.lexicon.manasteelGrafter", BotaniaHelper.manasteelGrafterRecipe));
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package magicbees.main.utils.compat.botania;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.BeeManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBee;
|
||||
|
||||
public class SpeciesRecipeElvenTrade extends RecipeElvenTrade {
|
||||
|
||||
private IAlleleBeeSpecies inputSpecies;
|
||||
|
||||
public SpeciesRecipeElvenTrade(IAlleleBeeSpecies inSpecies, IAlleleBeeSpecies outSpecies) {
|
||||
super(BeeManager.getDefaultItemStackForSpecies(inSpecies, EnumBeeType.DRONE),
|
||||
BeeManager.getDefaultItemStackForSpecies(outSpecies, EnumBeeType.DRONE));
|
||||
inputSpecies = inSpecies;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(List<ItemStack> stacks, boolean removeMatched) {
|
||||
List<ItemStack> matchedStacks = new LinkedList<ItemStack>();
|
||||
boolean found = false;
|
||||
|
||||
for (ItemStack inStack : stacks) {
|
||||
if (inStack == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (BeeManager.beeRoot.isMember(inStack, EnumBeeType.DRONE.ordinal())) {
|
||||
IBee bee = BeeManager.beeRoot.getMember(inStack);
|
||||
if (bee.getGenome().getPrimary().equals(inputSpecies)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (removeMatched) {
|
||||
for (ItemStack stack : matchedStacks) {
|
||||
stacks.remove(stack);
|
||||
}
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user