diff --git a/src/minecraft/forestry/api/apiculture/IBeeMutation.java b/src/minecraft/forestry/api/apiculture/IBeeMutation.java index 970aeda73..271e728dd 100644 --- a/src/minecraft/forestry/api/apiculture/IBeeMutation.java +++ b/src/minecraft/forestry/api/apiculture/IBeeMutation.java @@ -5,5 +5,14 @@ import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutation; public interface IBeeMutation extends IMutation { - int getChance(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); + + /** + * @param housing + * @param allele0 + * @param allele1 + * @param genome0 + * @param genome1 + * @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an integer previously! + */ + float getChance(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); } diff --git a/src/minecraft/forestry/api/apiculture/IBeekeepingMode.java b/src/minecraft/forestry/api/apiculture/IBeekeepingMode.java index b3c86293e..4a3d72d1a 100644 --- a/src/minecraft/forestry/api/apiculture/IBeekeepingMode.java +++ b/src/minecraft/forestry/api/apiculture/IBeekeepingMode.java @@ -33,6 +33,22 @@ public interface IBeekeepingMode extends IBeeModifier { */ boolean isFatigued(IBee queen); + /** + * @param queen + * @param housing + * @return true if the queen is being overworked in the bee housing (with chance). will trigger a negative effect. + */ + boolean isOverworked(IBee queen, IBeeHousing housing); + + /** + * + * @param queen + * @param offspring + * @param housing + * @return true if the genetic structure of the queen is breaking down during spawning of the offspring (with chance). will trigger a negative effect. + */ + boolean isDegenerating(IBee queen, IBee offspring, IBeeHousing housing); + /** * @param queen * @return true if an offspring of this queen is considered a natural @@ -45,4 +61,5 @@ public interface IBeekeepingMode extends IBeeModifier { */ boolean mayMultiplyPrincess(IBee queen); + } diff --git a/src/minecraft/forestry/api/arboriculture/IToolGrafter.java b/src/minecraft/forestry/api/arboriculture/IToolGrafter.java index d5840a99d..97aea1adc 100644 --- a/src/minecraft/forestry/api/arboriculture/IToolGrafter.java +++ b/src/minecraft/forestry/api/arboriculture/IToolGrafter.java @@ -1,5 +1,6 @@ package forestry.api.arboriculture; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -14,5 +15,5 @@ public interface IToolGrafter { * @param z * @return */ - float getSaplingModifier(ItemStack stack, World world, int x, int y, int z); + float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z); } diff --git a/src/minecraft/forestry/api/arboriculture/ITreeBreedingManager.java b/src/minecraft/forestry/api/arboriculture/ITreeBreedingManager.java index af9e86552..76cf23422 100644 --- a/src/minecraft/forestry/api/arboriculture/ITreeBreedingManager.java +++ b/src/minecraft/forestry/api/arboriculture/ITreeBreedingManager.java @@ -1,6 +1,7 @@ package forestry.api.arboriculture; import java.util.ArrayList; +import java.util.Collection; import java.util.Random; import net.minecraft.world.World; @@ -34,4 +35,8 @@ public interface ITreeBreedingManager { IAllele[] getRandomTreeTemplate(Random rand); + void registerTreeMutation(ITreeMutation mutation); + + Collection getMutations(boolean shuffle); + } diff --git a/src/minecraft/forestry/api/arboriculture/ITreeMutation.java b/src/minecraft/forestry/api/arboriculture/ITreeMutation.java index efc46a814..2870c39a9 100644 --- a/src/minecraft/forestry/api/arboriculture/ITreeMutation.java +++ b/src/minecraft/forestry/api/arboriculture/ITreeMutation.java @@ -6,5 +6,17 @@ import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutation; public interface ITreeMutation extends IMutation { - int getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); + + /** + * @param world + * @param x + * @param y + * @param z + * @param allele0 + * @param allele1 + * @param genome0 + * @param genome1 + * @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an integer previously! + */ + float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1); } diff --git a/src/minecraft/forestry/api/arboriculture/TreeManager.java b/src/minecraft/forestry/api/arboriculture/TreeManager.java index e6f9faee3..dfd6d00ff 100644 --- a/src/minecraft/forestry/api/arboriculture/TreeManager.java +++ b/src/minecraft/forestry/api/arboriculture/TreeManager.java @@ -1,15 +1,7 @@ package forestry.api.arboriculture; -import java.util.ArrayList; - public class TreeManager { public static int treeSpeciesCount = 0; public static ITreeInterface treeInterface; public static ITreeBreedingManager breedingManager; - - /** - * List of possible mutations on fruit alleles. - */ - public static ArrayList treeMutations = new ArrayList(); - } diff --git a/src/minecraft/forestry/api/core/EnumTemperature.java b/src/minecraft/forestry/api/core/EnumTemperature.java index 8722cb044..4051c3a12 100644 --- a/src/minecraft/forestry/api/core/EnumTemperature.java +++ b/src/minecraft/forestry/api/core/EnumTemperature.java @@ -48,6 +48,11 @@ public enum EnumTemperature { return this.name; } + @SideOnly(Side.CLIENT) + public Icon getIcon() { + return ForestryAPI.textureManager.getDefault(iconIndex); + } + public static ArrayList getBiomeIds(EnumTemperature temperature) { switch (temperature) { diff --git a/src/minecraft/forestry/api/core/ForestryAPI.java b/src/minecraft/forestry/api/core/ForestryAPI.java index d673ac6e6..8d807b051 100644 --- a/src/minecraft/forestry/api/core/ForestryAPI.java +++ b/src/minecraft/forestry/api/core/ForestryAPI.java @@ -9,4 +9,5 @@ public class ForestryAPI { @SideOnly(Side.CLIENT) public static ITextureManager textureManager; + } diff --git a/src/minecraft/forestry/api/core/ITextureManager.java b/src/minecraft/forestry/api/core/ITextureManager.java index 7fc324e7c..1849d1b13 100644 --- a/src/minecraft/forestry/api/core/ITextureManager.java +++ b/src/minecraft/forestry/api/core/ITextureManager.java @@ -11,4 +11,5 @@ public interface ITextureManager { Icon getIcon(short texUID); + Icon getDefault(String ident); } diff --git a/src/minecraft/forestry/api/farming/IFarmLogic.java b/src/minecraft/forestry/api/farming/IFarmLogic.java index f8c2b00d4..ef2d48519 100644 --- a/src/minecraft/forestry/api/farming/IFarmLogic.java +++ b/src/minecraft/forestry/api/farming/IFarmLogic.java @@ -27,5 +27,7 @@ public interface IFarmLogic { @SideOnly(Side.CLIENT) Icon getIcon(); + String getTextureSheet(); + String getName(); } diff --git a/src/minecraft/forestry/api/genetics/IMutation.java b/src/minecraft/forestry/api/genetics/IMutation.java index d6d6c7068..290f68627 100644 --- a/src/minecraft/forestry/api/genetics/IMutation.java +++ b/src/minecraft/forestry/api/genetics/IMutation.java @@ -40,7 +40,7 @@ public interface IMutation { /** * @return Unmodified base chance for mutation to fire. */ - int getBaseChance(); + float getBaseChance(); /** * @param allele