Updated Forestry API
This commit is contained in:
parent
6984125bee
commit
3779ed7a14
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<ITreeMutation> getMutations(boolean shuffle);
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<ITreeMutation> treeMutations = new ArrayList<ITreeMutation>();
|
||||
|
||||
}
|
||||
|
|
|
@ -48,6 +48,11 @@ public enum EnumTemperature {
|
|||
return this.name;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon() {
|
||||
return ForestryAPI.textureManager.getDefault(iconIndex);
|
||||
}
|
||||
|
||||
public static ArrayList<Integer> getBiomeIds(EnumTemperature temperature) {
|
||||
|
||||
switch (temperature) {
|
||||
|
|
|
@ -9,4 +9,5 @@ public class ForestryAPI {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static ITextureManager textureManager;
|
||||
|
||||
}
|
||||
|
|
|
@ -11,4 +11,5 @@ public interface ITextureManager {
|
|||
|
||||
Icon getIcon(short texUID);
|
||||
|
||||
Icon getDefault(String ident);
|
||||
}
|
||||
|
|
|
@ -27,5 +27,7 @@ public interface IFarmLogic {
|
|||
@SideOnly(Side.CLIENT)
|
||||
Icon getIcon();
|
||||
|
||||
String getTextureSheet();
|
||||
|
||||
String getName();
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public interface IMutation {
|
|||
/**
|
||||
* @return Unmodified base chance for mutation to fire.
|
||||
*/
|
||||
int getBaseChance();
|
||||
float getBaseChance();
|
||||
|
||||
/**
|
||||
* @param allele
|
||||
|
|
Loading…
Reference in New Issue