Merge branch 'master' of https://github.com/ted80/BiomesOPlenty
This commit is contained in:
commit
7e779edfbb
97 changed files with 0 additions and 3168 deletions
|
@ -108,12 +108,8 @@ public class BlockBOPAppleLeaves extends BlockLeavesBase implements IShearable
|
|||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (random.nextInt(10) == 0)
|
||||
if (meta > 0)
|
||||
{
|
||||
if ((meta & 3) < 3)
|
||||
{
|
||||
world.setBlock(x, y, z, blockID, ++meta, 3);
|
||||
}
|
||||
}
|
||||
|
||||
if ((meta & 8) != 0/* && (meta & 4) == 0*/)
|
||||
{
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.genetics.IMutation;
|
||||
|
||||
public class BeeManager {
|
||||
|
||||
@Deprecated
|
||||
public static IBeeRoot beeInterface;
|
||||
|
||||
/**
|
||||
* Species templates for bees that can drop from hives.
|
||||
*
|
||||
* 0 - Forest 1 - Meadows 2 - Desert 3 - Jungle 4 - End 5 - Snow 6 - Swamp
|
||||
*
|
||||
* see {@link IMutation} for template format
|
||||
*/
|
||||
public static ArrayList<IHiveDrop>[] hiveDrops;
|
||||
|
||||
/**
|
||||
* 0 - Common Village Bees 1 - Uncommon Village Bees (20 % of spawns)
|
||||
*/
|
||||
public static ArrayList<IBeeGenome>[] villageBees;
|
||||
|
||||
/**
|
||||
* List of items that can induce swarming. Integer denotes x in 1000 chance.
|
||||
*/
|
||||
public static HashMap<ItemStack, Integer> inducers = new HashMap<ItemStack, Integer>();
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
public enum EnumBeeChromosome {
|
||||
SPECIES, SPEED, LIFESPAN, FERTILITY, TEMPERATURE_TOLERANCE, NOCTURNAL, @Deprecated
|
||||
HUMIDITY, HUMIDITY_TOLERANCE, TOLERANT_FLYER, CAVE_DWELLING, FLOWER_PROVIDER, FLOWERING, TERRITORY, EFFECT
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum EnumBeeType {
|
||||
NONE, PRINCESS, QUEEN, DRONE;
|
||||
|
||||
public static final EnumBeeType[] VALUES = values();
|
||||
|
||||
String name;
|
||||
|
||||
private EnumBeeType() {
|
||||
this.name = "bees." + this.toString().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -2,8 +2,6 @@ package forestry.api.apiculture;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class FlowerManager {
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public interface IAlleleBeeEffect extends IAlleleEffect {
|
||||
|
||||
/**
|
||||
* Called by apiaries to cause an effect in the world.
|
||||
*
|
||||
* @param genome
|
||||
* Genome of the bee queen causing this effect
|
||||
* @param storedData
|
||||
* Object containing the stored effect data for the apiary/hive the bee is in.
|
||||
* @param world
|
||||
* @param biomeid
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return storedData, may have been manipulated.
|
||||
*/
|
||||
IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* Is called to produce bee effects.
|
||||
*
|
||||
* @param genome
|
||||
* @param storedData
|
||||
* Object containing the stored effect data for the apiary/hive the bee is in.
|
||||
* @param world
|
||||
* @param biomeid
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return storedData, may have been manipulated.
|
||||
*/
|
||||
IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
|
||||
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public interface IAlleleBeeSpecies extends IAlleleSpecies {
|
||||
|
||||
/**
|
||||
* @return the IBeeRoot
|
||||
*/
|
||||
IBeeRoot getRoot();
|
||||
|
||||
// / Products, Chance
|
||||
HashMap<ItemStack, Integer> getProducts();
|
||||
|
||||
// / Specialty, Chance
|
||||
HashMap<ItemStack, Integer> getSpecialty();
|
||||
|
||||
// / Only jubilant bees give their specialty product
|
||||
boolean isJubilant(IBeeGenome genome, IBeeHousing housing);
|
||||
|
||||
int getIconColour(int renderPass);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
Icon getIcon(EnumBeeType type, int renderPass);
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.core.ITileStructure;
|
||||
|
||||
/**
|
||||
* Needs to be implemented by TileEntities that want to be part of an alveary.
|
||||
*/
|
||||
public interface IAlvearyComponent extends ITileStructure {
|
||||
|
||||
void registerBeeModifier(IBeeModifier modifier);
|
||||
|
||||
void removeBeeModifier(IBeeModifier modifier);
|
||||
|
||||
void registerBeeListener(IBeeListener event);
|
||||
|
||||
void removeBeeListener(IBeeListener event);
|
||||
|
||||
void addTemperatureChange(float change, float boundaryDown, float boundaryUp);
|
||||
|
||||
void addHumidityChange(float change, float boundaryDown, float boundaryUp);
|
||||
|
||||
/**
|
||||
* @return true if this TE has a function other than a plain alveary block. Returning true prevents the TE from becoming master.
|
||||
*/
|
||||
boolean hasFunction();
|
||||
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.genetics.IBreedingTracker;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
/**
|
||||
* Can be used to garner information on bee breeding. See {@link IBreedingManager}
|
||||
*
|
||||
* @author SirSengir
|
||||
*/
|
||||
public interface IApiaristTracker extends IBreedingTracker {
|
||||
|
||||
/**
|
||||
* Register the birth of a queen. Will mark species as discovered.
|
||||
*
|
||||
* @param bee
|
||||
* Created queen.
|
||||
*/
|
||||
void registerQueen(IIndividual queen);
|
||||
|
||||
/**
|
||||
* @return Amount of queens bred with this tracker.
|
||||
*/
|
||||
int getQueenCount();
|
||||
|
||||
/**
|
||||
* Register the birth of a princess. Will mark species as discovered.
|
||||
*
|
||||
* @param bee
|
||||
* Created princess.
|
||||
*/
|
||||
void registerPrincess(IIndividual princess);
|
||||
|
||||
/**
|
||||
* @return Amount of princesses bred with this tracker.
|
||||
*/
|
||||
int getPrincessCount();
|
||||
|
||||
/**
|
||||
* Register the birth of a drone. Will mark species as discovered.
|
||||
*
|
||||
* @param bee
|
||||
* Created drone.
|
||||
*/
|
||||
void registerDrone(IIndividual drone);
|
||||
|
||||
/**
|
||||
* @return Amount of drones bred with this tracker.
|
||||
*/
|
||||
int getDroneCount();
|
||||
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* When implemented by armor piece items, allows them to act as apiarist's armor.
|
||||
*/
|
||||
public interface IArmorApiarist {
|
||||
/**
|
||||
* Called when the apiarist's armor acts as protection against an attack.
|
||||
*
|
||||
* @param player
|
||||
* Player being attacked
|
||||
* @param armor
|
||||
* Armor item
|
||||
* @param cause
|
||||
* Optional cause of attack, such as a bee effect identifier
|
||||
* @param doProtect
|
||||
* Whether or not to actually do the side effects of protection
|
||||
* @return Whether or not the armor should protect the player from that attack
|
||||
*/
|
||||
public boolean protectPlayer(EntityPlayer player, ItemStack armor, String cause, boolean doProtect);
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IIndividualLiving;
|
||||
|
||||
/**
|
||||
* Other implementations than Forestry's default one are not supported.
|
||||
*
|
||||
* @author SirSengir
|
||||
*/
|
||||
public interface IBee extends IIndividualLiving {
|
||||
|
||||
/**
|
||||
* @return Bee's genetic information.
|
||||
*/
|
||||
IBeeGenome getGenome();
|
||||
|
||||
/**
|
||||
* @return Genetic information of the bee's mate, null if unmated.
|
||||
*/
|
||||
IBeeGenome getMate();
|
||||
|
||||
/**
|
||||
* @return true if the individual is originally of natural origin.
|
||||
*/
|
||||
boolean isNatural();
|
||||
|
||||
/**
|
||||
* @return generation this individual is removed from the original individual.
|
||||
*/
|
||||
int getGeneration();
|
||||
|
||||
/**
|
||||
* Set the natural flag on this bee.
|
||||
* @param flag
|
||||
*/
|
||||
void setIsNatural(boolean flag);
|
||||
|
||||
/**
|
||||
* @return true if the bee is mated with another whose isNatural() doesn't match.
|
||||
*/
|
||||
boolean isIrregularMating();
|
||||
|
||||
IEffectData[] doEffect(IEffectData[] storedData, IBeeHousing housing);
|
||||
|
||||
IEffectData[] doFX(IEffectData[] storedData, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* @return true if the bee may spawn offspring
|
||||
*/
|
||||
boolean canSpawn();
|
||||
|
||||
/**
|
||||
* Determines whether the queen can work.
|
||||
*
|
||||
* @param world
|
||||
* @param isAlveary
|
||||
* @param biomeid
|
||||
* @param temperature
|
||||
* @param humidity
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return Ordinal of the error code encountered. 0 - EnumErrorCode.OK
|
||||
*/
|
||||
int isWorking(IBeeHousing housing);
|
||||
|
||||
boolean hasFlower(IBeeHousing housing);
|
||||
|
||||
ArrayList<Integer> getSuitableBiomeIds();
|
||||
|
||||
ItemStack[] getProduceList();
|
||||
|
||||
ItemStack[] getSpecialtyList();
|
||||
|
||||
ItemStack[] produceStacks(IBeeHousing housing);
|
||||
|
||||
IBee spawnPrincess(IBeeHousing housing);
|
||||
|
||||
IBee[] spawnDrones(IBeeHousing housing);
|
||||
|
||||
void plantFlowerRandom(IBeeHousing housing);
|
||||
|
||||
IIndividual retrievePollen(IBeeHousing housing);
|
||||
|
||||
boolean pollinateRandom(IBeeHousing housing, IIndividual pollen);
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IGenome;
|
||||
|
||||
/**
|
||||
* Only the default implementation is supported.
|
||||
*
|
||||
* @author SirSengir
|
||||
*
|
||||
*/
|
||||
public interface IBeeGenome extends IGenome {
|
||||
|
||||
IAlleleBeeSpecies getPrimary();
|
||||
|
||||
IAlleleBeeSpecies getSecondary();
|
||||
|
||||
float getSpeed();
|
||||
|
||||
int getLifespan();
|
||||
|
||||
int getFertility();
|
||||
|
||||
EnumTolerance getToleranceTemp();
|
||||
|
||||
EnumTolerance getToleranceHumid();
|
||||
|
||||
boolean getNocturnal();
|
||||
|
||||
boolean getTolerantFlyer();
|
||||
|
||||
boolean getCaveDwelling();
|
||||
|
||||
IFlowerProvider getFlowerProvider();
|
||||
|
||||
int getFlowering();
|
||||
|
||||
int[] getTerritory();
|
||||
|
||||
IAlleleBeeEffect getEffect();
|
||||
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
|
||||
public interface IBeeHousing extends IBeeModifier, IBeeListener {
|
||||
|
||||
int getXCoord();
|
||||
|
||||
int getYCoord();
|
||||
|
||||
int getZCoord();
|
||||
|
||||
ItemStack getQueen();
|
||||
|
||||
ItemStack getDrone();
|
||||
|
||||
void setQueen(ItemStack itemstack);
|
||||
|
||||
void setDrone(ItemStack itemstack);
|
||||
|
||||
int getBiomeId();
|
||||
|
||||
EnumTemperature getTemperature();
|
||||
|
||||
EnumHumidity getHumidity();
|
||||
|
||||
World getWorld();
|
||||
|
||||
/**
|
||||
* @return String containing the login of this housing's owner.
|
||||
*/
|
||||
String getOwnerName();
|
||||
|
||||
void setErrorState(int state);
|
||||
|
||||
int getErrorOrdinal();
|
||||
|
||||
/**
|
||||
* @return true if princesses and drones can (currently) mate in this housing to generate queens.
|
||||
*/
|
||||
boolean canBreed();
|
||||
|
||||
/**
|
||||
* Called by IBeekeepingLogic to add products to the housing's inventory.
|
||||
*
|
||||
* @param product
|
||||
* ItemStack with the product to add.
|
||||
* @param all
|
||||
* @return Boolean indicating success or failure.
|
||||
*/
|
||||
boolean addProduct(ItemStack product, boolean all);
|
||||
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
public interface IBeeListener {
|
||||
|
||||
/**
|
||||
* Called on queen update.
|
||||
*
|
||||
* @param queen
|
||||
*/
|
||||
void onQueenChange(ItemStack queen);
|
||||
|
||||
/**
|
||||
* Called when the bees wear out the housing's equipment.
|
||||
*
|
||||
* @param amount
|
||||
* Integer indicating the amount worn out.
|
||||
*/
|
||||
void wearOutEquipment(int amount);
|
||||
|
||||
/**
|
||||
* Called just before the children are generated, and the queen removed.
|
||||
*
|
||||
* @param queen
|
||||
*/
|
||||
void onQueenDeath(IBee queen);
|
||||
|
||||
/**
|
||||
* Called after the children have been spawned, but before the queen appears
|
||||
*
|
||||
* @param queen
|
||||
*/
|
||||
void onPostQueenDeath(IBee queen);
|
||||
|
||||
boolean onPollenRetrieved(IBee queen, IIndividual pollen, boolean isHandled);
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
public interface IBeeModifier {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param genome
|
||||
* @return Float used to modify the base territory.
|
||||
*/
|
||||
float getTerritoryModifier(IBeeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* @param mate
|
||||
* @return Float used to modify the base mutation chance.
|
||||
*/
|
||||
float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* @param mate
|
||||
* @return Float used to modify the life span of queens.
|
||||
*/
|
||||
float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* @param mate
|
||||
* @return Float modifying the production speed of queens.
|
||||
*/
|
||||
float getProductionModifier(IBeeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* @param mate
|
||||
* @return Float modifying the flowering of queens.
|
||||
*/
|
||||
float getFloweringModifier(IBeeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @return Boolean indicating if housing can ignore rain
|
||||
*/
|
||||
boolean isSealed();
|
||||
|
||||
/**
|
||||
* @return Boolean indicating if housing can ignore darkness/night
|
||||
*/
|
||||
boolean isSelfLighted();
|
||||
|
||||
/**
|
||||
* @return Boolean indicating if housing can ignore not seeing the sky
|
||||
*/
|
||||
boolean isSunlightSimulated();
|
||||
|
||||
/**
|
||||
* @return Boolean indicating whether this housing simulates the nether
|
||||
*/
|
||||
boolean isHellish();
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IMutation;
|
||||
|
||||
public interface IBeeMutation extends IMutation {
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
|
@ -1,108 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.core.IStructureLogic;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
public interface IBeeRoot extends ISpeciesRoot {
|
||||
|
||||
/**
|
||||
* @return true if passed item is a Forestry bee. Equal to getType(ItemStack stack) != EnumBeeType.NONE
|
||||
*/
|
||||
boolean isMember(ItemStack stack);
|
||||
|
||||
/**
|
||||
* @return {@link IBee} pattern parsed from the passed stack's nbt data.
|
||||
*/
|
||||
IBee getMember(ItemStack stack);
|
||||
|
||||
/* GENOME CONVERSION */
|
||||
IBee templateAsIndividual(IAllele[] template);
|
||||
|
||||
IBee templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
IBeeGenome templateAsGenome(IAllele[] template);
|
||||
|
||||
IBeeGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
/* BREEDING TRACKER */
|
||||
/**
|
||||
* @param world
|
||||
* @return {@link IApiaristTracker} associated with the passed world.
|
||||
*/
|
||||
IApiaristTracker getBreedingTracker(World world, String player);
|
||||
|
||||
/* BEE SPECIFIC */
|
||||
/**
|
||||
* @return type of bee encoded on the itemstack. EnumBeeType.NONE if it isn't a bee.
|
||||
*/
|
||||
EnumBeeType getType(ItemStack stack);
|
||||
|
||||
/**
|
||||
* @return true if passed item is a drone. Equal to getType(ItemStack stack) == EnumBeeType.DRONE
|
||||
*/
|
||||
boolean isDrone(ItemStack stack);
|
||||
|
||||
/**
|
||||
* @return true if passed item is mated (i.e. a queen)
|
||||
*/
|
||||
boolean isMated(ItemStack stack);
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* Valid {@link IBeeGenome}
|
||||
* @return {@link IBee} from the passed genome
|
||||
*/
|
||||
IBee getBee(World world, IBeeGenome genome);
|
||||
|
||||
/**
|
||||
* Creates an IBee suitable for a queen containing the necessary second genome for the mate.
|
||||
*
|
||||
* @param genome
|
||||
* Valid {@link IBeeGenome}
|
||||
* @param mate
|
||||
* Valid {@link IBee} representing the mate.
|
||||
* @return Mated {@link IBee} from the passed genomes.
|
||||
*/
|
||||
IBee getBee(World world, IBeeGenome genome, IBee mate);
|
||||
|
||||
/* TEMPLATES */
|
||||
ArrayList<IBee> getIndividualTemplates();
|
||||
|
||||
/* MUTATIONS */
|
||||
Collection<IBeeMutation> getMutations(boolean shuffle);
|
||||
|
||||
/* GAME MODE */
|
||||
void resetBeekeepingMode();
|
||||
|
||||
ArrayList<IBeekeepingMode> getBeekeepingModes();
|
||||
|
||||
IBeekeepingMode getBeekeepingMode(World world);
|
||||
|
||||
IBeekeepingMode getBeekeepingMode(String name);
|
||||
|
||||
void registerBeekeepingMode(IBeekeepingMode mode);
|
||||
|
||||
void setBeekeepingMode(World world, String name);
|
||||
|
||||
/* MISC */
|
||||
/**
|
||||
* @param housing
|
||||
* Object implementing IBeeHousing.
|
||||
* @return IBeekeepingLogic
|
||||
*/
|
||||
IBeekeepingLogic createBeekeepingLogic(IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* TileEntities wanting to function as alveary components need to implement structure logic for validation.
|
||||
*
|
||||
* @return IStructureLogic for alvearies.
|
||||
*/
|
||||
IStructureLogic createAlvearyStructureLogic(IAlvearyComponent structure);
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.core.INBTTagable;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public interface IBeekeepingLogic extends INBTTagable {
|
||||
|
||||
/* STATE INFORMATION */
|
||||
int getBreedingTime();
|
||||
|
||||
int getTotalBreedingTime();
|
||||
|
||||
IBee getQueen();
|
||||
|
||||
IBeeHousing getHousing();
|
||||
|
||||
IEffectData[] getEffectData();
|
||||
|
||||
/* UPDATING */
|
||||
void update();
|
||||
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IBeekeepingMode extends IBeeModifier {
|
||||
|
||||
/**
|
||||
* @return Localized name of this beekeeping mode.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* @return Localized list of strings outlining the behaviour of this beekeeping mode.
|
||||
*/
|
||||
ArrayList<String> getDescription();
|
||||
|
||||
/**
|
||||
* @return Float used to modify the wear on comb frames.
|
||||
*/
|
||||
float getWearModifier();
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return fertility taking into account the birthing queen and surroundings.
|
||||
*/
|
||||
int getFinalFertility(IBee queen, World world, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return true if the queen is genetically "fatigued" and should not be reproduced anymore.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
boolean isNaturalOffspring(IBee queen);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return true if this mode allows the passed queen or princess to be multiplied
|
||||
*/
|
||||
boolean mayMultiplyPrincess(IBee queen);
|
||||
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Bees can be seeded either as hive drops or as mutation results.
|
||||
*
|
||||
* Add IHiveDrops to BeeManager.hiveDrops
|
||||
*
|
||||
* @author SirSengir
|
||||
*/
|
||||
public interface IHiveDrop {
|
||||
|
||||
ItemStack getPrincess(World world, int x, int y, int z, int fortune);
|
||||
|
||||
Collection<ItemStack> getDrones(World world, int x, int y, int z, int fortune);
|
||||
|
||||
Collection<ItemStack> getAdditional(World world, int x, int y, int z, int fortune);
|
||||
|
||||
/**
|
||||
* Chance to drop. Default drops have 80 (= 80 %).
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return
|
||||
*/
|
||||
int getChance(World world, int x, int y, int z);
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IHiveFrame extends IBeeModifier {
|
||||
|
||||
/**
|
||||
* Wears out a frame.
|
||||
*
|
||||
* @param housing
|
||||
* IBeeHousing the frame is contained in.
|
||||
* @param frame
|
||||
* ItemStack containing the actual frame.
|
||||
* @param queen
|
||||
* Current queen in the caller.
|
||||
* @param wear
|
||||
* Integer denoting the amount worn out. {@link IBeekeepingMode.getWearModifier()} has already been taken into account.
|
||||
* @return ItemStack containing the actual frame with adjusted damage.
|
||||
*/
|
||||
ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear);
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
public enum EnumGermlingType {
|
||||
NONE("None"), SAPLING("Sapling"), BLOSSOM("Blossom"), POLLEN("Pollen"), GERMLING("Germling");
|
||||
|
||||
public static final EnumGermlingType[] VALUES = values();
|
||||
|
||||
String name;
|
||||
|
||||
private EnumGermlingType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
public enum EnumGrowthConditions {
|
||||
HOSTILE, PALTRY, NORMAL, GOOD, EXCELLENT
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
|
||||
public enum EnumTreeChromosome {
|
||||
|
||||
/**
|
||||
* Determines the following: - WorldGen, including the used wood blocks - {@link IFruitFamily}s supported. Limits which {@IFruitProvider}
|
||||
* will actually yield fruit with this species. - Native {@link EnumPlantType} for this tree. Combines with the PLANT chromosome.
|
||||
*/
|
||||
SPECIES,
|
||||
/**
|
||||
* {@link IGrowthProvider}, determines conditions required by the tree to grow.
|
||||
*/
|
||||
GROWTH,
|
||||
/**
|
||||
* A float modifying the height of the tree. Taken into account at worldgen.
|
||||
*/
|
||||
HEIGHT,
|
||||
/**
|
||||
* Chance for saplings.
|
||||
*/
|
||||
FERTILITY,
|
||||
/**
|
||||
* {@link IFruitProvider}, determines if and what fruits are grown on the tree. Limited by the {@link IFruitFamily}s the species supports.
|
||||
*/
|
||||
FRUITS,
|
||||
/**
|
||||
* Chance for fruit leaves and/or drops.
|
||||
*/
|
||||
YIELD,
|
||||
/**
|
||||
* May add additional tolerances for {@link EnumPlantTypes}.
|
||||
*/
|
||||
PLANT,
|
||||
/**
|
||||
* Determines the speed at which fruit will ripen on this tree.
|
||||
*/
|
||||
SAPPINESS,
|
||||
/**
|
||||
* Territory for leaf effects. Unused.
|
||||
*/
|
||||
TERRITORY,
|
||||
/**
|
||||
* Leaf effect. Unused.
|
||||
*/
|
||||
EFFECT,
|
||||
/**
|
||||
* Amount of random ticks which need to elapse before a sapling will grow into a tree.
|
||||
*/
|
||||
MATURATION,
|
||||
|
||||
GIRTH
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
/**
|
||||
* Simple allele encapsulating an {@link IFruitProvider}.
|
||||
*/
|
||||
public interface IAlleleFruit extends IAllele {
|
||||
|
||||
IFruitProvider getProvider();
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
/**
|
||||
* Simple allele encapsulating an {@link IGrowthProvider}.
|
||||
*/
|
||||
public interface IAlleleGrowth extends IAllele {
|
||||
|
||||
IGrowthProvider getProvider();
|
||||
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
/**
|
||||
* Simple allele encapsulating a leaf effect. (Not implemented)
|
||||
*/
|
||||
public interface IAlleleLeafEffect extends IAlleleEffect {
|
||||
|
||||
IEffectData doEffect(ITreeGenome genome, IEffectData storedData, World world, int x, int y, int z);
|
||||
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
|
||||
public interface IAlleleTreeSpecies extends IAlleleSpecies {
|
||||
|
||||
ITreeRoot getRoot();
|
||||
|
||||
/**
|
||||
* @return Native plant type of this species.
|
||||
*/
|
||||
EnumPlantType getPlantType();
|
||||
|
||||
/**
|
||||
* @return List of all {@link IFruitFamily}s which can grow on leaves generated by this species.
|
||||
*/
|
||||
Collection<IFruitFamily> getSuitableFruit();
|
||||
|
||||
/**
|
||||
* @return Trunk girth. 1 = 1x1, 2 = 2x2, etc.
|
||||
*/
|
||||
@Deprecated
|
||||
int getGirth();
|
||||
|
||||
/**
|
||||
* @param tree
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return Tree generator for the tree at the given location.
|
||||
*/
|
||||
WorldGenerator getGenerator(ITree tree, World world, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* @return All available generator classes for this species.
|
||||
*/
|
||||
Class<? extends WorldGenerator>[] getGeneratorClasses();
|
||||
|
||||
/* TEXTURES AND OVERRIDES */
|
||||
int getLeafColour(ITree tree);
|
||||
|
||||
short getLeafIconIndex(ITree tree, boolean fancy);
|
||||
|
||||
int getGermlingIconColour(int renderPass);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
Icon getGermlingIcon(EnumGermlingType type, int renderPass);
|
||||
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.genetics.IBreedingTracker;
|
||||
|
||||
public interface IArboristTracker extends IBreedingTracker {
|
||||
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
|
||||
public interface IFruitProvider {
|
||||
|
||||
IFruitFamily getFamily();
|
||||
|
||||
int getColour(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime);
|
||||
|
||||
boolean markAsFruitLeaf(ITreeGenome genome, World world, int x, int y, int z);
|
||||
|
||||
int getRipeningPeriod();
|
||||
|
||||
// / Products, Chance
|
||||
ItemStack[] getProducts();
|
||||
|
||||
// / Specialty, Chance
|
||||
ItemStack[] getSpecialty();
|
||||
|
||||
ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime);
|
||||
|
||||
/**
|
||||
* @return Short, human-readable identifier used in the treealyzer.
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/* TEXTURE OVERLAY */
|
||||
/**
|
||||
* @param genome
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param ripeningTime
|
||||
* Elapsed ripening time for the fruit.
|
||||
* @param fancy
|
||||
* @return Icon index of the texture to overlay on the leaf block.
|
||||
*/
|
||||
short getIconIndex(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy);
|
||||
|
||||
/**
|
||||
* @return true if this fruit provider requires fruit blocks to spawn, false otherwise.
|
||||
*/
|
||||
boolean requiresFruitBlocks();
|
||||
|
||||
/**
|
||||
* Tries to spawn a fruit block at the potential position when the tree generates.
|
||||
*
|
||||
* @param genome
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return true if a fruit block was spawned, false otherwise.
|
||||
*/
|
||||
boolean trySpawnFruitBlock(ITreeGenome genome, World world, int x, int y, int z);
|
||||
|
||||
void registerIcons();
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IGrowthProvider {
|
||||
|
||||
/**
|
||||
* Check to see whether a sapling at the given location with the given genome can grow into a tree.
|
||||
*
|
||||
* @param genome
|
||||
* @param world
|
||||
* @param xPos
|
||||
* @param yPos
|
||||
* @param zPos
|
||||
* @param expectedGirth
|
||||
* @param expectedHeight
|
||||
* @return
|
||||
*/
|
||||
boolean canGrow(ITreeGenome genome, World world, int xPos, int yPos, int zPos, int expectedGirth, int expectedHeight);
|
||||
|
||||
EnumGrowthConditions getGrowthConditions(ITreeGenome genome, World world, int xPos, int yPos, int zPos);
|
||||
|
||||
/**
|
||||
* @return Short, human-readable identifier used in the treealyzer.
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/**
|
||||
* @return Detailed description of growth behaviour used in the treealyzer.
|
||||
*/
|
||||
String[] getInfo();
|
||||
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ILeafTickHandler {
|
||||
boolean onRandomLeafTick(ITree tree, World world, int biomeId, int x, int y, int z);
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IToolGrafter {
|
||||
/**
|
||||
* Called by leaves to determine the increase in sapling droprate.
|
||||
*
|
||||
* @param stack
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return
|
||||
*/
|
||||
float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, int x, int y, int z);
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
public interface ITree extends IIndividual {
|
||||
|
||||
void mate(ITree other);
|
||||
|
||||
IEffectData[] doEffect(IEffectData[] storedData, World world, int biomeid, int x, int y, int z);
|
||||
|
||||
IEffectData[] doFX(IEffectData[] storedData, World world, int biomeid, int x, int y, int z);
|
||||
|
||||
ITreeGenome getGenome();
|
||||
|
||||
ITreeGenome getMate();
|
||||
|
||||
EnumSet<EnumPlantType> getPlantTypes();
|
||||
|
||||
ITree[] getSaplings(World world, int x, int y, int z, float modifier);
|
||||
|
||||
ItemStack[] getProduceList();
|
||||
|
||||
ItemStack[] getSpecialtyList();
|
||||
|
||||
ItemStack[] produceStacks(World world, int x, int y, int z, int ripeningTime);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return Boolean indicating whether a sapling can stay planted at the given position.
|
||||
*/
|
||||
boolean canStay(World world, int x, int y, int z);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return Boolean indicating whether a sapling at the given position can grow into a tree.
|
||||
*/
|
||||
boolean canGrow(World world, int x, int y, int z, int expectedGirth, int expectedHeight);
|
||||
|
||||
/**
|
||||
* @return Integer denoting the maturity (block ticks) required for a sapling to attempt to grow into a tree.
|
||||
*/
|
||||
int getRequiredMaturity();
|
||||
|
||||
int getGirth(World world, int x, int y, int z);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return Growth conditions at the given position.
|
||||
*/
|
||||
EnumGrowthConditions getGrowthCondition(World world, int x, int y, int z);
|
||||
|
||||
WorldGenerator getTreeGenerator(World world, int x, int y, int z, boolean wasBonemealed);
|
||||
|
||||
ITree copy();
|
||||
|
||||
boolean isPureBred(EnumTreeChromosome chromosome);
|
||||
|
||||
boolean canBearFruit();
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import forestry.api.genetics.IGenome;
|
||||
|
||||
public interface ITreeGenome extends IGenome {
|
||||
|
||||
IAlleleTreeSpecies getPrimary();
|
||||
|
||||
IAlleleTreeSpecies getSecondary();
|
||||
|
||||
IFruitProvider getFruitProvider();
|
||||
|
||||
IGrowthProvider getGrowthProvider();
|
||||
|
||||
float getHeight();
|
||||
|
||||
float getFertility();
|
||||
|
||||
/**
|
||||
* @return Determines either a) how many fruit leaves there are or b) the chance for any fruit leave to drop a sapling. Exact usage determined by the
|
||||
* IFruitProvider
|
||||
*/
|
||||
float getYield();
|
||||
|
||||
float getSappiness();
|
||||
|
||||
EnumSet<EnumPlantType> getPlantTypes();
|
||||
|
||||
/**
|
||||
* @return Amount of random block ticks required for a sapling to mature into a fully grown tree.
|
||||
*/
|
||||
int getMaturationTime();
|
||||
|
||||
int getGirth();
|
||||
|
||||
IAlleleLeafEffect getEffect();
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
public interface ITreeModifier {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param genome
|
||||
* @return Float used to modify the height.
|
||||
*/
|
||||
float getHeightModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param genome
|
||||
* @return Float used to modify the yield.
|
||||
*/
|
||||
float getYieldModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param genome
|
||||
* @return Float used to modify the sappiness.
|
||||
*/
|
||||
float getSappinessModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param genome
|
||||
* @return Float used to modify the maturation.
|
||||
*/
|
||||
float getMaturationModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome0
|
||||
* @param genome1
|
||||
* @return Float used to modify the base mutation chance.
|
||||
*/
|
||||
float getMutationModifier(ITreeGenome genome0, ITreeGenome genome1, float currentModifier);
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IMutation;
|
||||
|
||||
public interface ITreeMutation extends IMutation {
|
||||
|
||||
/**
|
||||
* @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,74 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosome;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
public interface ITreeRoot extends ISpeciesRoot {
|
||||
|
||||
boolean isMember(ItemStack itemstack);
|
||||
|
||||
ITree getMember(ItemStack itemstack);
|
||||
|
||||
ITreeGenome templateAsGenome(IAllele[] template);
|
||||
|
||||
ITreeGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @return {@link IArboristTracker} associated with the passed world.
|
||||
*/
|
||||
IArboristTracker getBreedingTracker(World world, String player);
|
||||
|
||||
/* TREE SPECIFIC */
|
||||
/**
|
||||
* Register a leaf tick handler.
|
||||
* @param handler the {@link ILeafTickHandler} to register.
|
||||
*/
|
||||
void registerLeafTickHandler(ILeafTickHandler handler);
|
||||
|
||||
Collection<ILeafTickHandler> getLeafTickHandlers();
|
||||
|
||||
/**
|
||||
* @return type of tree encoded on the itemstack. EnumBeeType.NONE if it isn't a tree.
|
||||
*/
|
||||
EnumGermlingType getType(ItemStack stack);
|
||||
|
||||
ITree getTree(World world, int x, int y, int z);
|
||||
|
||||
ITree getTree(World world, ITreeGenome genome);
|
||||
|
||||
boolean plantSapling(World world, ITree tree, String owner, int x, int y, int z);
|
||||
|
||||
boolean setLeaves(World world, IIndividual tree, String owner, int x, int y, int z);
|
||||
|
||||
IChromosome[] templateAsChromosomes(IAllele[] template);
|
||||
|
||||
IChromosome[] templateAsChromosomes(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
boolean setFruitBlock(World world, IAlleleFruit allele, float sappiness, short[] indices, int x, int y, int z);
|
||||
|
||||
/* GAME MODE */
|
||||
ArrayList<ITreekeepingMode> getTreekeepingModes();
|
||||
|
||||
ITreekeepingMode getTreekeepingMode(World world);
|
||||
|
||||
ITreekeepingMode getTreekeepingMode(String name);
|
||||
|
||||
void registerTreekeepingMode(ITreekeepingMode mode);
|
||||
|
||||
void setTreekeepingMode(World world, String name);
|
||||
|
||||
/* TEMPLATES */
|
||||
ArrayList<ITree> getIndividualTemplates();
|
||||
|
||||
/* MUTATIONS */
|
||||
Collection<ITreeMutation> getMutations(boolean shuffle);
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public interface ITreekeepingMode extends ITreeModifier {
|
||||
|
||||
/**
|
||||
* @return Localized name of this treekeeping mode.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* @return Localized list of strings outlining the behaviour of this treekeeping mode.
|
||||
*/
|
||||
ArrayList<String> getDescription();
|
||||
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package forestry.api.arboriculture;
|
||||
|
||||
public class TreeManager {
|
||||
public static int treeSpeciesCount = 0;
|
||||
|
||||
@Deprecated
|
||||
public static ITreeRoot treeInterface;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package forestry.api.circuits;
|
||||
|
||||
public class ChipsetManager {
|
||||
|
||||
public static ISolderManager solderManager;
|
||||
public static ICircuitRegistry circuitRegistry;
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package forestry.api.circuits;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public interface ICircuit {
|
||||
String getUID();
|
||||
|
||||
boolean requiresDiscovery();
|
||||
|
||||
int getLimit();
|
||||
|
||||
String getName();
|
||||
|
||||
boolean isCircuitable(TileEntity tile);
|
||||
|
||||
void onInsertion(int slot, TileEntity tile);
|
||||
|
||||
void onLoad(int slot, TileEntity tile);
|
||||
|
||||
void onRemoval(int slot, TileEntity tile);
|
||||
|
||||
void onTick(int slot, TileEntity tile);
|
||||
|
||||
void addTooltip(List<String> list);
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package forestry.api.circuits;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import forestry.api.core.INBTTagable;
|
||||
|
||||
public interface ICircuitBoard extends INBTTagable {
|
||||
|
||||
int getPrimaryColor();
|
||||
|
||||
int getSecondaryColor();
|
||||
|
||||
void addTooltip(List<String> list);
|
||||
|
||||
void onInsertion(TileEntity tile);
|
||||
|
||||
void onLoad(TileEntity tile);
|
||||
|
||||
void onRemoval(TileEntity tile);
|
||||
|
||||
void onTick(TileEntity tile);
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package forestry.api.circuits;
|
||||
|
||||
public interface ICircuitLayout {
|
||||
|
||||
String getUID();
|
||||
|
||||
String getName();
|
||||
|
||||
String getUsage();
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package forestry.api.circuits;
|
||||
|
||||
public interface ICircuitLibrary {
|
||||
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package forestry.api.circuits;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ICircuitRegistry {
|
||||
|
||||
/* CIRCUITS */
|
||||
HashMap<String, ICircuit> getRegisteredCircuits();
|
||||
|
||||
void registerCircuit(ICircuit circuit);
|
||||
|
||||
ICircuit getCircuit(String uid);
|
||||
|
||||
ICircuitLibrary getCircuitLibrary(World world, String playername);
|
||||
|
||||
void registerLegacyMapping(int id, String uid);
|
||||
|
||||
ICircuit getFromLegacyMap(int id);
|
||||
|
||||
/* LAYOUTS */
|
||||
HashMap<String, ICircuitLayout> getRegisteredLayouts();
|
||||
|
||||
void registerLayout(ICircuitLayout layout);
|
||||
|
||||
ICircuitLayout getLayout(String uid);
|
||||
|
||||
ICircuitLayout getDefaultLayout();
|
||||
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package forestry.api.circuits;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ISolderManager {
|
||||
|
||||
void addRecipe(ICircuitLayout layout, ItemStack resource, ICircuit circuit);
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package forestry.api.farming;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Farmables {
|
||||
/**
|
||||
* Can be used to add IFarmables to some of the vanilla farm logics.
|
||||
*
|
||||
* Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
|
||||
*/
|
||||
public static HashMap<String, Collection<IFarmable>> farmables = new HashMap<String, Collection<IFarmable>>();
|
||||
|
||||
public static IFarmInterface farmInterface;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package forestry.api.farming;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ICrop {
|
||||
|
||||
/**
|
||||
* Harvests this crop. Performs the necessary manipulations to set the crop into a "harvested" state.
|
||||
*
|
||||
* @return Products harvested.
|
||||
*/
|
||||
Collection<ItemStack> harvest();
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package forestry.api.farming;
|
||||
|
||||
import forestry.api.core.ITileStructure;
|
||||
|
||||
public interface IFarmComponent extends ITileStructure {
|
||||
|
||||
boolean hasFunction();
|
||||
|
||||
void registerListener(IFarmListener listener);
|
||||
|
||||
void removeListener(IFarmListener listener);
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
package forestry.api.farming;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
public interface IFarmHousing {
|
||||
|
||||
int[] getCoords();
|
||||
|
||||
int[] getArea();
|
||||
|
||||
int[] getOffset();
|
||||
|
||||
World getWorld();
|
||||
|
||||
/**
|
||||
* Will run the work cycle on a master TE. Will do nothing on any other farm component.
|
||||
*
|
||||
* @return true if any work was done, false otherwise.
|
||||
*/
|
||||
boolean doWork();
|
||||
|
||||
boolean hasLiquid(LiquidStack liquid);
|
||||
|
||||
void removeLiquid(LiquidStack liquid);
|
||||
|
||||
boolean hasResources(ItemStack[] resources);
|
||||
|
||||
void removeResources(ItemStack[] resources);
|
||||
|
||||
/**
|
||||
* Callback for {@link IFarmLogic}s to plant a sapling, seed, germling, stem. Will remove the appropriate germling from the farm's inventory. It's up to the
|
||||
* logic to only call this on a valid location.
|
||||
*
|
||||
* @param farmable
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return true if planting was successful, false otherwise.
|
||||
*/
|
||||
boolean plantGermling(IFarmable farmable, World world, int x, int y, int z);
|
||||
|
||||
/* INTERACTION WITH HATCHES */
|
||||
boolean acceptsAsGermling(ItemStack itemstack);
|
||||
|
||||
boolean acceptsAsResource(ItemStack itemstack);
|
||||
|
||||
boolean acceptsAsFertilizer(ItemStack itemstack);
|
||||
|
||||
/* LOGIC */
|
||||
/**
|
||||
* Set a farm logic for the given direction. UP/DOWN/UNKNOWN are invalid!
|
||||
*
|
||||
* @param direction
|
||||
* @param logic
|
||||
*/
|
||||
void setFarmLogic(ForgeDirection direction, IFarmLogic logic);
|
||||
|
||||
/**
|
||||
* Reset the farm logic for the given direction to default. UP/DOWN/UNKNOWN are invalid!
|
||||
*
|
||||
* @param direction
|
||||
*/
|
||||
void resetFarmLogic(ForgeDirection direction);
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package forestry.api.farming;
|
||||
|
||||
import forestry.api.core.IStructureLogic;
|
||||
|
||||
public interface IFarmInterface {
|
||||
|
||||
/**
|
||||
* Creates {@link IStructureLogic} for use in farm components.
|
||||
*
|
||||
* @param structure
|
||||
* {@link IFarmComponent} to create the logic for.
|
||||
* @return {@link IStructureLogic} for use in farm components
|
||||
*/
|
||||
IStructureLogic createFarmStructureLogic(IFarmComponent structure);
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
package forestry.api.farming;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public interface IFarmListener {
|
||||
|
||||
/**
|
||||
* Called before a crop is harvested.
|
||||
*
|
||||
* @param crop
|
||||
* ICrop about to be harvested.
|
||||
* @return true to cancel further processing of this crop.
|
||||
*/
|
||||
boolean beforeCropHarvest(ICrop crop);
|
||||
|
||||
/**
|
||||
* Called after a crop has been harvested, but before harvested items are stowed in the farms inventory.
|
||||
*
|
||||
* @param harvested
|
||||
* Collection of harvested stacks. May be manipulated. Ensure removal of stacks with 0 or less items!
|
||||
* @param crop
|
||||
* Harvested {@link ICrop}
|
||||
*/
|
||||
void afterCropHarvest(Collection<ItemStack> harvested, ICrop crop);
|
||||
|
||||
/**
|
||||
* Called after the stack of collected items has been returned by the farm logic, but before it is added to the farm's pending queue.
|
||||
*
|
||||
* @param collected
|
||||
* Collection of collected stacks. May be manipulated. Ensure removal of stacks with 0 or less items!
|
||||
* @param logic
|
||||
*/
|
||||
void hasCollected(Collection<ItemStack> collected, IFarmLogic logic);
|
||||
|
||||
/**
|
||||
* Called after farmland has successfully been cultivated by a farm logic.
|
||||
*
|
||||
* @param logic
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param direction
|
||||
* @param extent
|
||||
*/
|
||||
void hasCultivated(IFarmLogic logic, int x, int y, int z, ForgeDirection direction, int extent);
|
||||
|
||||
/**
|
||||
* Called after the stack of harvested crops has been returned by the farm logic, but before it is added to the farm's pending queue.
|
||||
*
|
||||
* @param harvested
|
||||
* @param logic
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param direction
|
||||
* @param extent
|
||||
*/
|
||||
void hasScheduledHarvest(Collection<ICrop> harvested, IFarmLogic logic, int x, int y, int z, ForgeDirection direction, int extent);
|
||||
|
||||
/**
|
||||
* Can be used to cancel farm task on a per side/{@link IFarmLogic} basis.
|
||||
*
|
||||
* @param logic
|
||||
* @param direction
|
||||
* @return true to skip any work action on the given logic and direction for this work cycle.
|
||||
*/
|
||||
boolean cancelTask(IFarmLogic logic, ForgeDirection direction);
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package forestry.api.farming;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IFarmLogic {
|
||||
|
||||
int getFertilizerConsumption();
|
||||
|
||||
int getWaterConsumption(float hydrationModifier);
|
||||
|
||||
boolean isAcceptedResource(ItemStack itemstack);
|
||||
|
||||
boolean isAcceptedGermling(ItemStack itemstack);
|
||||
|
||||
Collection<ItemStack> collect();
|
||||
|
||||
boolean cultivate(int x, int y, int z, ForgeDirection direction, int extent);
|
||||
|
||||
Collection<ICrop> harvest(int x, int y, int z, ForgeDirection direction, int extent);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
Icon getIcon();
|
||||
|
||||
String getTextureSheet();
|
||||
|
||||
String getName();
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package forestry.api.farming;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* IGermling describes a crop or other harvestable object and can be used to inspect item stacks and blocks for matches.
|
||||
*/
|
||||
public interface IFarmable {
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return true if the block at the given location is a "sapling" for this type, i.e. a non-harvestable immature version of the crop.
|
||||
*/
|
||||
boolean isSaplingAt(World world, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return {@link ICrop} if the block at the given location is a harvestable and mature crop, null otherwise.
|
||||
*/
|
||||
ICrop getCropAt(World world, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* @param itemstack
|
||||
* @return true if the item is a valid germling (plantable sapling, seed, etc.) for this type.
|
||||
*/
|
||||
boolean isGermling(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* @param itemstack
|
||||
* @return true if the item is something that can drop from this type without actually being harvested as a crop. (Apples or sapling from decaying leaves.)
|
||||
*/
|
||||
boolean isWindfall(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* Plants a sapling by manipulating the world. The {@link IFarmLogic} should have verified the given location as valid. Called by the {@link IFarmHousing}
|
||||
* which handles resources.
|
||||
*
|
||||
* @param germling
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return true on success, false otherwise.
|
||||
*/
|
||||
boolean plantSaplingAt(ItemStack germling, World world, int x, int y, int z);
|
||||
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package forestry.api.food;
|
||||
|
||||
public class BeverageManager {
|
||||
public static IBeverageEffect[] effectList = new IBeverageEffect[128];
|
||||
|
||||
public static IInfuserManager infuserManager;
|
||||
public static IIngredientManager ingredientManager;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package forestry.api.food;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IBeverageEffect {
|
||||
int getId();
|
||||
|
||||
void doEffect(World world, EntityPlayer player);
|
||||
|
||||
String getDescription();
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package forestry.api.food;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IInfuserManager {
|
||||
|
||||
void addMixture(int meta, ItemStack ingredient, IBeverageEffect effect);
|
||||
|
||||
void addMixture(int meta, ItemStack[] ingredients, IBeverageEffect effect);
|
||||
|
||||
ItemStack getSeasoned(ItemStack base, ItemStack[] ingredients);
|
||||
|
||||
boolean hasMixtures(ItemStack[] ingredients);
|
||||
|
||||
ItemStack[] getRequired(ItemStack[] ingredients);
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package forestry.api.food;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IIngredientManager {
|
||||
|
||||
String getDescription(ItemStack itemstack);
|
||||
|
||||
void addIngredient(ItemStack ingredient, String description);
|
||||
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
public class AlleleManager {
|
||||
|
||||
public static IAlleleRegistry alleleRegistry;
|
||||
|
||||
/**
|
||||
* Translates plain leaf blocks into genetic data. Used by bees to convert and pollinate foreign leaf blocks.
|
||||
*/
|
||||
public static HashMap<ItemStack, IIndividual> ersatzSpecimen = new HashMap<ItemStack, IIndividual>();
|
||||
/**
|
||||
* Translates plain saplings into genetic data. Used by the treealyzer and the farm to convert foreign saplings.
|
||||
*/
|
||||
public static HashMap<ItemStack, IIndividual> ersatzSaplings = new HashMap<ItemStack, IIndividual>();
|
||||
|
||||
/**
|
||||
* @deprecated Use IAlleleRegistry.getAllele instead!
|
||||
*/
|
||||
@Deprecated
|
||||
public static IAllele getAllele(String ident) {
|
||||
IAllele allele = null;
|
||||
|
||||
try {
|
||||
|
||||
String alleleClass = "forestry.core.genetics.Allele";
|
||||
|
||||
Object obj = Class.forName(alleleClass).getField(ident).get(null);
|
||||
if (obj instanceof IAllele)
|
||||
allele = (IAllele) obj;
|
||||
} catch (Exception ex) {
|
||||
FMLLog.warning("Could not retrieve bee allele identified by: " + ident);
|
||||
}
|
||||
|
||||
return allele;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
public enum EnumTolerance {
|
||||
NONE,
|
||||
|
||||
BOTH_1, BOTH_2, BOTH_3, BOTH_4, BOTH_5,
|
||||
|
||||
UP_1, UP_2, UP_3, UP_4, UP_5,
|
||||
|
||||
DOWN_1, DOWN_2, DOWN_3, DOWN_4, DOWN_5
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
/**
|
||||
* Should be extended for different types of alleles. ISpeciesAllele, IBiomeAllele, etc.
|
||||
*/
|
||||
public interface IAllele {
|
||||
|
||||
/**
|
||||
* @return A unique string identifier for this allele.
|
||||
*/
|
||||
String getUID();
|
||||
|
||||
/**
|
||||
* @return true if the allele is dominant, false otherwise.
|
||||
*/
|
||||
boolean isDominant();
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
public interface IAlleleEffect extends IAllele {
|
||||
/**
|
||||
* @return true if this effect can combine with the effect on other allele (i.e. run before or after). combination can only occur if both effects are
|
||||
* combinable.
|
||||
*/
|
||||
boolean isCombinable();
|
||||
|
||||
/**
|
||||
* Returns the passed data storage if it is valid for this effect or a new one if the passed storage object was invalid for this effect.
|
||||
*
|
||||
* @param storedData
|
||||
* @return
|
||||
*/
|
||||
IEffectData validateStorage(IEffectData storedData);
|
||||
|
||||
/**
|
||||
* @return Short, human-readable identifier used in the beealyzer.
|
||||
*/
|
||||
String getIdentifier();
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
/**
|
||||
* Simple interface to allow adding additional alleles containing float values.
|
||||
*/
|
||||
public interface IAlleleFloat extends IAllele {
|
||||
|
||||
float getValue();
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
|
||||
public interface IAlleleFlowers extends IAllele {
|
||||
|
||||
/**
|
||||
* @return FlowerProvider
|
||||
*/
|
||||
IFlowerProvider getProvider();
|
||||
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
/**
|
||||
* @author Alex Binnie
|
||||
*
|
||||
* Handler for events that occur in IAlleleRegistry, such as registering alleles, branches etc. Useful for handling plugin specific behavior (i.e.
|
||||
* creating a list of all bee species etc.)
|
||||
*
|
||||
*/
|
||||
public interface IAlleleHandler {
|
||||
|
||||
/**
|
||||
* Called when an allele is registered with {@link IAlleleRegistry}.
|
||||
*
|
||||
* @param allele
|
||||
* Allele which was registered.
|
||||
*/
|
||||
public void onRegisterAllele(IAllele allele);
|
||||
|
||||
/**
|
||||
* Called when a classification is registered with {@link IAlleleRegistry}.
|
||||
*
|
||||
* @param classification
|
||||
* Classification which was registered.
|
||||
*/
|
||||
public void onRegisterClassification(IClassification classification);
|
||||
|
||||
/**
|
||||
* Called when a fruit family is registered with {@link IAlleleRegistry}.
|
||||
*
|
||||
* @param family
|
||||
* Fruit family which was registered.
|
||||
*/
|
||||
public void onRegisterFruitFamily(IFruitFamily family);
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
/**
|
||||
* Simple interface to allow adding additional alleles containing integer values.
|
||||
*/
|
||||
public interface IAlleleInteger extends IAllele {
|
||||
|
||||
int getValue();
|
||||
|
||||
}
|
|
@ -1,174 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IClassification.EnumClassLevel;
|
||||
|
||||
public interface IAlleleRegistry {
|
||||
|
||||
/* SPECIES CLASSES */
|
||||
/**
|
||||
* Register a {@link ISpeciesRoot}.
|
||||
* @param {@link ISpeciesRoot} to register.
|
||||
*/
|
||||
void registerSpeciesRoot(ISpeciesRoot root);
|
||||
|
||||
/**
|
||||
* Retrieve the {@link ISpeciesRoot} with the given uid.
|
||||
* @param uid Unique id for the species class, i.e. "rootBees", "rootTrees", "rootButterflies".
|
||||
* @return {@link ISpeciesRoot} if it exists, null otherwise.
|
||||
*/
|
||||
ISpeciesRoot getSpeciesRoot(String uid);
|
||||
|
||||
/**
|
||||
* Retrieve a matching {@link ISpeciesRoot} for the given itemstack.
|
||||
* @param stack An itemstack possibly containing NBT data which can be converted by a species root.
|
||||
* @return {@link ISpeciesRoot} if found, null otherwise.
|
||||
*/
|
||||
ISpeciesRoot getSpeciesRoot(ItemStack stack);
|
||||
|
||||
/* INDIVIDUAL */
|
||||
/**
|
||||
* Tests the itemstack for genetic information.
|
||||
*
|
||||
* @param stack
|
||||
* @return true if the itemstack is an individual.
|
||||
*/
|
||||
boolean isIndividual(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Retrieve genetic information from an itemstack.
|
||||
*
|
||||
* @param stack
|
||||
* Stack to retrieve genetic information for.
|
||||
* @return IIndividual containing genetic information, null if none could be extracted.
|
||||
*/
|
||||
IIndividual getIndividual(ItemStack stack);
|
||||
|
||||
/* ALLELES */
|
||||
|
||||
/**
|
||||
* @return HashMap of all currently registered alleles.
|
||||
*/
|
||||
LinkedHashMap<String, IAllele> getRegisteredAlleles();
|
||||
|
||||
/**
|
||||
* Registers an allele.
|
||||
*
|
||||
* @param allele
|
||||
* IAllele to register.
|
||||
*/
|
||||
void registerAllele(IAllele allele);
|
||||
|
||||
/**
|
||||
* Gets an allele
|
||||
*
|
||||
* @param uid
|
||||
* String based unique identifier of the allele to retrieve.
|
||||
* @return IAllele if found, null otherwise.
|
||||
*/
|
||||
IAllele getAllele(String uid);
|
||||
|
||||
/* THIS SHOULD BE PHASED OUT */
|
||||
@Deprecated
|
||||
void reloadMetaMap(World world);
|
||||
|
||||
@Deprecated
|
||||
IAllele getFromMetaMap(int meta);
|
||||
|
||||
@Deprecated
|
||||
int getFromUIDMap(String uid);
|
||||
|
||||
/* CLASSIFICATIONS */
|
||||
/**
|
||||
* @return HashMap of all currently registered classifications.
|
||||
*/
|
||||
LinkedHashMap<String, IClassification> getRegisteredClassifications();
|
||||
|
||||
/**
|
||||
* Registers a classification.
|
||||
*
|
||||
* @param classification
|
||||
* IClassification to register.
|
||||
*/
|
||||
void registerClassification(IClassification classification);
|
||||
|
||||
/**
|
||||
* Creates and returns a classification.
|
||||
*
|
||||
* @param level
|
||||
* EnumClassLevel of the classification to create.
|
||||
* @param uid
|
||||
* String based unique identifier. Implementation will throw an exception if the key is already taken.
|
||||
* @param scientific
|
||||
* Binomial for the given classification.
|
||||
* @return
|
||||
*/
|
||||
IClassification createAndRegisterClassification(EnumClassLevel level, String uid, String scientific);
|
||||
|
||||
/**
|
||||
* Gets a classification.
|
||||
*
|
||||
* @param uid
|
||||
* String based unique identifier of the classification to retrieve.
|
||||
* @return Classification if found, null otherwise.
|
||||
*/
|
||||
IClassification getClassification(String uid);
|
||||
|
||||
/* FRUIT FAMILIES */
|
||||
/**
|
||||
* Get all registered fruit families.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
LinkedHashMap<String, IFruitFamily> getRegisteredFruitFamilies();
|
||||
|
||||
/**
|
||||
* Registers a new fruit family.
|
||||
*
|
||||
* @param family
|
||||
*/
|
||||
void registerFruitFamily(IFruitFamily family);
|
||||
|
||||
/**
|
||||
* Retrieves a fruit family identified by uid.
|
||||
*
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
IFruitFamily getFruitFamily(String uid);
|
||||
|
||||
/* ALLELE HANDLERS */
|
||||
/**
|
||||
* Registers a new IAlleleHandler
|
||||
*
|
||||
* @param handler
|
||||
* IAlleleHandler to register.
|
||||
*/
|
||||
void registerAlleleHandler(IAlleleHandler handler);
|
||||
|
||||
/* BLACKLIST */
|
||||
/**
|
||||
* Blacklist an allele identified by its UID from mutation.
|
||||
*
|
||||
* @param uid
|
||||
* UID of the allele to blacklist.
|
||||
*/
|
||||
void blacklistAllele(String uid);
|
||||
|
||||
/**
|
||||
* @return Current blacklisted alleles.
|
||||
*/
|
||||
ArrayList<String> getAlleleBlacklist();
|
||||
|
||||
/**
|
||||
* @param uid
|
||||
* UID of the species to vet.
|
||||
* @return true if the allele is blacklisted.
|
||||
*/
|
||||
boolean isBlacklisted(String uid);
|
||||
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.IIconProvider;
|
||||
|
||||
public interface IAlleleSpecies extends IAllele {
|
||||
|
||||
/**
|
||||
* @return the {@link ISpeciesRoot} associated with this species.
|
||||
*/
|
||||
ISpeciesRoot getRoot();
|
||||
|
||||
/**
|
||||
* @return Localized short, human-readable identifier used in tooltips and beealyzer.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* @return Localized short description of this species. (May be null.)
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/**
|
||||
* @return Preferred temperature
|
||||
*/
|
||||
EnumTemperature getTemperature();
|
||||
|
||||
/**
|
||||
* @return Preferred humidity
|
||||
*/
|
||||
EnumHumidity getHumidity();
|
||||
|
||||
/**
|
||||
* @return true if the species icon should have a glowing effect.
|
||||
*/
|
||||
boolean hasEffect();
|
||||
|
||||
/**
|
||||
* @return true if the species should not be displayed in NEI or creative inventory.
|
||||
*/
|
||||
boolean isSecret();
|
||||
|
||||
/**
|
||||
* @return true to have the species count against the species total.
|
||||
*/
|
||||
boolean isCounted();
|
||||
|
||||
/**
|
||||
* Binomial name of the species sans genus ("Apis"). Returning "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun
|
||||
* names or return null.
|
||||
*
|
||||
* @return flavour text (may be null)
|
||||
*/
|
||||
String getBinomial();
|
||||
|
||||
/**
|
||||
* Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
|
||||
*
|
||||
* @return flavour text (may be null)
|
||||
*/
|
||||
String getAuthority();
|
||||
|
||||
/**
|
||||
* @return Branch this species is associated with.
|
||||
*/
|
||||
IClassification getBranch();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IIconProvider getIconProvider();
|
||||
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import forestry.api.apiculture.IBeekeepingMode;
|
||||
|
||||
public interface IBreedingTracker {
|
||||
|
||||
void decodeFromNBT(NBTTagCompound nbttagcompound);
|
||||
|
||||
void encodeToNBT(NBTTagCompound nbttagcompound);
|
||||
|
||||
/**
|
||||
* @return Name of the current {@link IBeekeepingMode}.
|
||||
*/
|
||||
String getModeName();
|
||||
|
||||
/**
|
||||
* @return Set the current {@link IBeekeepingMode}.
|
||||
*/
|
||||
void setModeName(String name);
|
||||
|
||||
/**
|
||||
* @return Amount of species discovered.
|
||||
*/
|
||||
int getSpeciesBred();
|
||||
|
||||
/**
|
||||
* Register the birth of an individual. Will mark it as discovered.
|
||||
*
|
||||
* @param individual
|
||||
*/
|
||||
void registerIndividual(IIndividual individual);
|
||||
|
||||
/**
|
||||
* Marks a species as discovered. Should only be called from registerIndividual normally.
|
||||
*
|
||||
* @param species
|
||||
*/
|
||||
void registerSpecies(IAlleleSpecies species);
|
||||
|
||||
/**
|
||||
* Register a successful mutation. Will mark it as discovered.
|
||||
*
|
||||
* @param mutation
|
||||
*/
|
||||
void registerMutation(IMutation mutation);
|
||||
|
||||
/**
|
||||
* Queries the tracker for discovered species.
|
||||
*
|
||||
* @param mutation
|
||||
* Mutation to query for.
|
||||
* @return true if the mutation has been discovered.
|
||||
*/
|
||||
boolean isDiscovered(IMutation mutation);
|
||||
|
||||
/**
|
||||
* Queries the tracker for discovered species.
|
||||
*
|
||||
* @param species
|
||||
* Species to check.
|
||||
* @return true if the species has been bred.
|
||||
*/
|
||||
boolean isDiscovered(IAlleleSpecies species);
|
||||
|
||||
/**
|
||||
* Synchronizes the tracker to the client side. Should be called before opening any gui needing that information.
|
||||
*
|
||||
* @param world
|
||||
* @param player
|
||||
*/
|
||||
void synchToPlayer(EntityPlayer player);
|
||||
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import forestry.api.core.INBTTagable;
|
||||
|
||||
/**
|
||||
* Implementations other than Forestry's default one are not supported!
|
||||
*
|
||||
* @author SirSengir
|
||||
*/
|
||||
public interface IChromosome extends INBTTagable {
|
||||
|
||||
IAllele getPrimaryAllele();
|
||||
|
||||
IAllele getSecondaryAllele();
|
||||
|
||||
IAllele getInactiveAllele();
|
||||
|
||||
IAllele getActiveAllele();
|
||||
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
/**
|
||||
* Used by the *alyzers to display hierarchies.
|
||||
*/
|
||||
public interface IClassification {
|
||||
|
||||
public enum EnumClassLevel {
|
||||
|
||||
DOMAIN(0x777fff, true), KINGDOM(0x77c3ff), PHYLUM(0x77ffb6, true), DIVISION(0x77ffb6, true), CLASS(0x7bff77), ORDER(0xbeff77), FAMILY(0xfffd77),
|
||||
SUBFAMILY(0xfffd77), TRIBE(0xfffd77), GENUS(0xffba77);
|
||||
|
||||
private int colour;
|
||||
private boolean isDroppable;
|
||||
|
||||
private EnumClassLevel(int colour) {
|
||||
this(colour, false);
|
||||
}
|
||||
|
||||
private EnumClassLevel(int colour, boolean isDroppable) {
|
||||
this.colour = colour;
|
||||
this.isDroppable = isDroppable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Colour to use for displaying this classification.
|
||||
*/
|
||||
public int getColour() {
|
||||
return colour;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Indicates whether display of this classification level can be ommitted in case of space constraints.
|
||||
*/
|
||||
public boolean isDroppable() {
|
||||
return isDroppable;
|
||||
}
|
||||
}
|
||||
|
||||
EnumClassLevel getLevel();
|
||||
|
||||
/**
|
||||
* @return Unique String identifier.
|
||||
*/
|
||||
String getUID();
|
||||
|
||||
/**
|
||||
* @return Localized branch name for user display.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* A branch approximates a "genus" in real life. Real life examples: "Micrapis", "Megapis"
|
||||
*
|
||||
* @return flavour text (may be null)
|
||||
*/
|
||||
String getScientific();
|
||||
|
||||
/**
|
||||
* @return Localized description of this branch. (May be null.)
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/**
|
||||
* @return Member groups of this one.
|
||||
*/
|
||||
IClassification[] getMemberGroups();
|
||||
|
||||
/**
|
||||
* Adds subgroups to this group.
|
||||
*/
|
||||
void addMemberGroup(IClassification group);
|
||||
|
||||
/**
|
||||
* @return Member species of this group.
|
||||
*/
|
||||
IAlleleSpecies[] getMemberSpecies();
|
||||
|
||||
/**
|
||||
* Used by the allele registry to populate internal collection of branch members on the fly.
|
||||
*
|
||||
* @param species
|
||||
*/
|
||||
void addMemberSpecies(IAlleleSpecies species);
|
||||
|
||||
/**
|
||||
* @return Parent classification, null if this is root.
|
||||
*/
|
||||
IClassification getParent();
|
||||
|
||||
/**
|
||||
* Only used internally by the AlleleRegistry if this classification has been added to another one.
|
||||
*
|
||||
* @param parent
|
||||
*/
|
||||
void setParent(IClassification parent);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import forestry.api.core.INBTTagable;
|
||||
|
||||
public interface IEffectData extends INBTTagable {
|
||||
void setInteger(int index, int val);
|
||||
|
||||
void setFloat(int index, float val);
|
||||
|
||||
void setBoolean(int index, boolean val);
|
||||
|
||||
int getInteger(int index);
|
||||
|
||||
float getFloat(int index);
|
||||
|
||||
boolean getBoolean(int index);
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IFlowerProvider {
|
||||
/**
|
||||
* @param world
|
||||
* @param individual
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return True if the block at the passed coordinates is a valid flower for the species.
|
||||
*/
|
||||
boolean isAcceptedFlower(World world, IIndividual individual, int x, int y, int z);
|
||||
|
||||
boolean isAcceptedPollinatable(World world, IPollinatable pollinatable);
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @param individual
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return True if a flower was planted.
|
||||
*/
|
||||
boolean growFlower(World world, IIndividual individual, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* @return Short, human-readable identifier used in the beealyzer.
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products);
|
||||
|
||||
/**
|
||||
* @return Array of itemstacks representing valid flowers for the flower provider. The first in the array is for use as an icon Return null or an empty
|
||||
* array if the flower does not have an itemstack
|
||||
*/
|
||||
ItemStack[] getItemStacks();
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IFruitBearer {
|
||||
|
||||
/**
|
||||
* @return true if the actual tile can bear fruits.
|
||||
*/
|
||||
boolean hasFruit();
|
||||
|
||||
/**
|
||||
* @return Family of the potential fruits on this tile.
|
||||
*/
|
||||
IFruitFamily getFruitFamily();
|
||||
|
||||
/**
|
||||
* Picks the fruits of this tile, resetting it to unripe fruits.
|
||||
*
|
||||
* @param tool
|
||||
* Tool used in picking the fruits. May be null.
|
||||
* @return Picked fruits.
|
||||
*/
|
||||
Collection<ItemStack> pickFruit(ItemStack tool);
|
||||
|
||||
/**
|
||||
* @return float indicating the ripeness of the fruit with >= 1.0f indicating full ripeness.
|
||||
*/
|
||||
float getRipeness();
|
||||
|
||||
/**
|
||||
* Increases the ripeness of the fruit.
|
||||
*
|
||||
* @param add
|
||||
* Float to add to the ripeness. Will truncate to valid values.
|
||||
*/
|
||||
void addRipeness(float add);
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
public interface IFruitFamily {
|
||||
|
||||
/**
|
||||
* @return Unique String identifier.
|
||||
*/
|
||||
String getUID();
|
||||
|
||||
/**
|
||||
* @return Localized family name for user display.
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* A scientific-y name for this fruit family
|
||||
*
|
||||
* @return flavour text (may be null)
|
||||
*/
|
||||
String getScientific();
|
||||
|
||||
/**
|
||||
* @return Localized description of this fruit family. (May be null.)
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import forestry.api.core.INBTTagable;
|
||||
|
||||
/**
|
||||
* Implementations other than Forestry's default one are not supported!
|
||||
*/
|
||||
public interface IGenome extends INBTTagable {
|
||||
|
||||
IAlleleSpecies getPrimary();
|
||||
|
||||
IAlleleSpecies getSecondary();
|
||||
|
||||
IChromosome[] getChromosomes();
|
||||
|
||||
IAllele getActiveAllele(int chromosome);
|
||||
|
||||
IAllele getInactiveAllele(int chromosome);
|
||||
|
||||
boolean isGeneticEqual(IGenome other);
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.core.INBTTagable;
|
||||
|
||||
/**
|
||||
* Implementations other than Forestry's default one are not supported!
|
||||
*/
|
||||
public interface IIndividual extends INBTTagable {
|
||||
|
||||
String getIdent();
|
||||
|
||||
String getDisplayName();
|
||||
|
||||
void addTooltip(List<String> list);
|
||||
|
||||
/**
|
||||
* Call to mark the IIndividual as analyzed.
|
||||
* @return true if the IIndividual has not been analyzed previously.
|
||||
*/
|
||||
boolean analyze();
|
||||
|
||||
boolean isAnalyzed();
|
||||
|
||||
boolean hasEffect();
|
||||
|
||||
boolean isSecret();
|
||||
|
||||
IGenome getGenome();
|
||||
|
||||
/**
|
||||
* Check whether the genetic makeup of two IIndividuals is identical. Ignores additional data like generations, irregular mating, etc..
|
||||
* @param other
|
||||
* @return true if the given other IIndividual has the amount of chromosomes and their alleles are identical.
|
||||
*/
|
||||
boolean isGeneticEqual(IIndividual other);
|
||||
|
||||
IIndividual copy();
|
||||
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IIndividualLiving extends IIndividual {
|
||||
|
||||
/**
|
||||
* @return Current health of the individual.
|
||||
*/
|
||||
int getHealth();
|
||||
|
||||
/**
|
||||
* @return Maximum health of the individual.
|
||||
*/
|
||||
int getMaxHealth();
|
||||
|
||||
/**
|
||||
* Age the individual.
|
||||
* @param world
|
||||
* @param ageModifier
|
||||
*/
|
||||
void age(World world, float ageModifier);
|
||||
|
||||
/**
|
||||
* Mate the bee with the given individual.
|
||||
* @param drone
|
||||
*/
|
||||
void mate(IIndividual individual);
|
||||
|
||||
/**
|
||||
* @return true if the individual is among the living.
|
||||
*/
|
||||
boolean isAlive();
|
||||
|
||||
/**
|
||||
* @param chromosome
|
||||
* @return true if both primary and secondary species allele match.
|
||||
*/
|
||||
boolean isPureBred(int chromosomeOrdinal);
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
/**
|
||||
* AlleleManager.alleleRegistry can be cast to this type.
|
||||
*/
|
||||
public interface ILegacyHandler {
|
||||
void registerLegacyMapping(int id, String uid);
|
||||
|
||||
IAllele getFromLegacyMap(int id);
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
/**
|
||||
* Bees can be seeded either as hive drops or as mutation results.
|
||||
*
|
||||
* Add mutations to BeeManager.beeMutations
|
||||
*
|
||||
* @author SirSengir
|
||||
*/
|
||||
public interface IMutation {
|
||||
|
||||
/**
|
||||
* @return first of the alleles implementing IAlleleSpecies required for this mutation.
|
||||
*/
|
||||
IAllele getAllele0();
|
||||
|
||||
/**
|
||||
* @return second of the alleles implementing IAlleleSpecies required for this mutation.
|
||||
*/
|
||||
IAllele getAllele1();
|
||||
|
||||
/**
|
||||
* @return Array of {@link IAllele} representing the full default genome of the mutated side. The array _must_ implement this format:
|
||||
*
|
||||
* Chromosome Must implement Customizable Note ----------- --------------- ------------- ------------ 0 : SPECIES IAlleleSpecies X 1 : SPEED
|
||||
* AlleleFloat 2 : LIFESPAN AlleleInteger 3 : FERTILITY AlleleInteger 4 : TEMPERATURE_TOLERANCE AlleleTolerance 5 : NOCTURNAL AlleleBoolean 6 :
|
||||
* (HUMIDITY) (AlleleHumidity) Not used. Anything passed into here will be nulled. 7 : HUMIDITY_TOLERANCE AlleleTolerance 8 : TOLERANT_FLYER
|
||||
* AlleleBoolean 9 : CAVE_DWELLING AlleleBoolean 10: FLOWER_PROVIDER IAlleleFlowers X 11: FLOWERING AlleleInteger 12: TERRITORY AlleleArea 13:
|
||||
* EFFECT IAlleleEffect X
|
||||
*
|
||||
* Make sure to return a proper array. Returning an allele of the wrong type will cause cast errors on runtime.
|
||||
*
|
||||
* Alleles marked as customizable can be populated with your own custom alleles. Make sure to register them correctly in alleleList!
|
||||
*
|
||||
* Other alleles must be populated with any matching pre-defined allele. Retrieve those via BeeManager.getAllele
|
||||
*
|
||||
*/
|
||||
IAllele[] getTemplate();
|
||||
|
||||
/**
|
||||
* @return Unmodified base chance for mutation to fire.
|
||||
*/
|
||||
float getBaseChance();
|
||||
|
||||
/**
|
||||
* @param allele
|
||||
* @return true if the passed allele is one of the alleles participating in this mutation.
|
||||
*/
|
||||
boolean isPartner(IAllele allele);
|
||||
|
||||
/**
|
||||
* @param allele
|
||||
* @return the other allele which was not passed as argument.
|
||||
*/
|
||||
IAllele getPartner(IAllele allele);
|
||||
|
||||
/**
|
||||
* @return true if the mutation should not be displayed in the beealyzer.
|
||||
*/
|
||||
boolean isSecret();
|
||||
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
public interface IPollinatable {
|
||||
|
||||
/**
|
||||
* @return plant types this pollinatable is classified as. (Can be used by bees to determine whether to interact or not.
|
||||
*/
|
||||
EnumSet<EnumPlantType> getPlantType();
|
||||
|
||||
/**
|
||||
* @return IIndividual containing the genetic information of this IPollinatable
|
||||
*/
|
||||
IIndividual getPollen();
|
||||
|
||||
/**
|
||||
* Checks whether this {@IPollinatable} can mate with the given pollen.
|
||||
*
|
||||
* Must be the one to check genetic equivalency.
|
||||
*
|
||||
* @param pollen
|
||||
* IIndividual representing the pollen.
|
||||
* @return true if mating is possible, false otherwise.
|
||||
*/
|
||||
boolean canMateWith(IIndividual pollen);
|
||||
|
||||
/**
|
||||
* Pollinates this entity.
|
||||
*
|
||||
* @param pollen
|
||||
* IIndividual representing the pollen.
|
||||
*/
|
||||
void mateWith(IIndividual pollen);
|
||||
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
public interface ISpeciesBreeding {
|
||||
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
package forestry.api.genetics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ISpeciesRoot {
|
||||
|
||||
String getUID();
|
||||
|
||||
/**
|
||||
* @return Integer denoting the number of (counted) species of this type in the world.
|
||||
*/
|
||||
int getSpeciesCount();
|
||||
|
||||
boolean isMember(ItemStack stack);
|
||||
|
||||
boolean isMember(ItemStack stack, int type);
|
||||
|
||||
boolean isMember(IIndividual individual);
|
||||
|
||||
IIndividual getMember(ItemStack stack);
|
||||
|
||||
ItemStack getMemberStack(IIndividual individual, int type);
|
||||
|
||||
/* BREEDING TRACKER */
|
||||
IBreedingTracker getBreedingTracker(World world, String player);
|
||||
|
||||
/* GENOME MANIPULATION */
|
||||
IIndividual templateAsIndividual(IAllele[] template);
|
||||
|
||||
IIndividual templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
IChromosome[] templateAsChromosomes(IAllele[] template);
|
||||
|
||||
IChromosome[] templateAsChromosomes(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
IGenome templateAsGenome(IAllele[] template);
|
||||
|
||||
IGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
/* TEMPLATES */
|
||||
/**
|
||||
* Registers a bee template using the UID of the first allele as identifier.
|
||||
*
|
||||
* @param template
|
||||
*/
|
||||
void registerTemplate(IAllele[] template);
|
||||
|
||||
/**
|
||||
* Registers a bee template using the passed identifier.
|
||||
*
|
||||
* @param template
|
||||
*/
|
||||
void registerTemplate(String identifier, IAllele[] template);
|
||||
|
||||
/**
|
||||
* Retrieves a registered template using the passed identifier.
|
||||
*
|
||||
* @param identifier
|
||||
* @return
|
||||
*/
|
||||
IAllele[] getTemplate(String identifier);
|
||||
|
||||
/**
|
||||
* @return Default bee template for use in emergencies.
|
||||
*/
|
||||
IAllele[] getDefaultTemplate();
|
||||
|
||||
IAllele[] getRandomTemplate(Random rand);
|
||||
|
||||
Map<String, IAllele[]> getGenomeTemplates();
|
||||
ArrayList<? extends IIndividual> getIndividualTemplates();
|
||||
|
||||
/* MUTATIONS */
|
||||
/**
|
||||
* Use to register mutations.
|
||||
*
|
||||
* @param mutation
|
||||
*/
|
||||
void registerMutation(IMutation mutation);
|
||||
|
||||
/**
|
||||
* @return All registered mutations.
|
||||
*/
|
||||
Collection<? extends IMutation> getMutations(boolean shuffle);
|
||||
|
||||
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
package forestry.api.lepidopterology;
|
||||
|
||||
public enum EnumButterflyChromosome {
|
||||
SPECIES,
|
||||
/**
|
||||
* Physical size.
|
||||
*/
|
||||
SIZE,
|
||||
/**
|
||||
* Flight speed.
|
||||
*/
|
||||
SPEED,
|
||||
/**
|
||||
* How long the butterfly can last without access to matching pollinatables.
|
||||
*/
|
||||
LIFESPAN,
|
||||
/**
|
||||
* Species with a higher metabolism have a higher appetite and may cause more damage to their environment.
|
||||
*/
|
||||
METABOLISM,
|
||||
/**
|
||||
* Determines likelyhood of caterpillars and length of caterpillar/pupation phase. Also: Number of max caterpillars after mating?
|
||||
*/
|
||||
FERTILITY,
|
||||
/**
|
||||
* Not sure yet.
|
||||
*/
|
||||
TEMPERATURE_TOLERANCE,
|
||||
/**
|
||||
* Not sure yet.
|
||||
*/
|
||||
HUMIDITY_TOLERANCE,
|
||||
/**
|
||||
* Only nocturnal butterflys/moths will fly at night. Allows daylight activity for naturally nocturnal species.
|
||||
*/
|
||||
NOCTURNAL,
|
||||
/**
|
||||
* Only tolerant flyers will fly in the rain.
|
||||
*/
|
||||
TOLERANT_FLYER,
|
||||
/**
|
||||
* Fire resistance.
|
||||
*/
|
||||
FIRE_RESIST,
|
||||
/**
|
||||
* Required flowers/leaves.
|
||||
*/
|
||||
FLOWER_PROVIDER,
|
||||
/**
|
||||
* Extra effect to surroundings. (?)
|
||||
*/
|
||||
EFFECT
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package forestry.api.lepidopterology;
|
||||
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public interface IAlleleButterflyEffect extends IAlleleEffect {
|
||||
|
||||
/**
|
||||
* Used by butterflies to trigger effects in the world.
|
||||
* @param butterfly {@link IEntityButterfly}
|
||||
* @param entity
|
||||
* @param storedData
|
||||
* @return
|
||||
*/
|
||||
IEffectData doEffect(IEntityButterfly butterfly, IEffectData storedData);
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package forestry.api.lepidopterology;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public interface IAlleleButterflySpecies extends IAlleleSpecies {
|
||||
|
||||
/**
|
||||
* @return Texture to be used for the Entity of this species.
|
||||
*/
|
||||
String getEntityTexture();
|
||||
|
||||
/**
|
||||
* @return Float between 0 and 1 representing the rarity of the species, will affect spawn rate.
|
||||
*/
|
||||
float getRarity();
|
||||
|
||||
/**
|
||||
* @return true if this species is only active at night.
|
||||
*/
|
||||
boolean isNocturnal();
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package forestry.api.lepidopterology;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IIndividualLiving;
|
||||
|
||||
public interface IButterfly extends IIndividualLiving {
|
||||
|
||||
IButterflyGenome getGenome();
|
||||
|
||||
float getSize();
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return true if the butterfly can take flight at the given location at this time. (Used to auto-spawn butterflies from dropped items.)
|
||||
*/
|
||||
boolean canTakeFlight(World world, double x, double y, double z);
|
||||
|
||||
/**
|
||||
* Create an exact copy of this butterfly.
|
||||
*/
|
||||
IButterfly copy();
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package forestry.api.lepidopterology;
|
||||
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IGenome;
|
||||
|
||||
public interface IButterflyGenome extends IGenome {
|
||||
|
||||
IAlleleButterflySpecies getPrimary();
|
||||
|
||||
IAlleleButterflySpecies getSecondary();
|
||||
|
||||
float getSize();
|
||||
|
||||
int getLifespan();
|
||||
|
||||
int getMetabolism();
|
||||
|
||||
int getFertility();
|
||||
|
||||
float getSpeed();
|
||||
|
||||
EnumTolerance getToleranceTemp();
|
||||
|
||||
EnumTolerance getToleranceHumid();
|
||||
|
||||
boolean getNocturnal();
|
||||
|
||||
boolean getTolerantFlyer();
|
||||
|
||||
boolean getFireResist();
|
||||
|
||||
IFlowerProvider getFlowerProvider();
|
||||
|
||||
IAlleleButterflyEffect getEffect();
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package forestry.api.lepidopterology;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
public interface IButterflyRoot extends ISpeciesRoot {
|
||||
|
||||
boolean isMember(ItemStack stack);
|
||||
|
||||
IButterfly getMember(ItemStack stack);
|
||||
|
||||
ItemStack getMemberStack(IIndividual butterfly, int type);
|
||||
|
||||
/* GENOME CONVERSION */
|
||||
IButterfly templateAsIndividual(IAllele[] template);
|
||||
|
||||
IButterfly templateAsIndividual(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
IButterflyGenome templateAsGenome(IAllele[] template);
|
||||
|
||||
IButterflyGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
/* BUTTERFLY SPECIFIC */
|
||||
/**
|
||||
* Spawns the given butterfly in the world.
|
||||
* @param butterfly
|
||||
* @return butterfly entity on success, null otherwise.
|
||||
*/
|
||||
EntityLiving spawnButterflyInWorld(World world, IButterfly butterfly, double x, double y, double z);
|
||||
|
||||
/* TEMPLATES */
|
||||
ArrayList<IButterfly> getIndividualTemplates();
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package forestry.api.lepidopterology;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.passive.IAnimals;
|
||||
|
||||
public interface IEntityButterfly extends IAnimals {
|
||||
|
||||
void changeExhaustion(int change);
|
||||
|
||||
int getExhaustion();
|
||||
|
||||
IButterfly getButterfly();
|
||||
|
||||
/**
|
||||
* @return The entity as an EntityCreature to save casting.
|
||||
*/
|
||||
EntityCreature getEntity();
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package forestry.api.storage;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
public abstract class BackpackEvent extends Event {
|
||||
|
||||
public final EntityPlayer player;
|
||||
public final IBackpackDefinition backpackDefinition;
|
||||
public final IInventory backpackInventory;
|
||||
|
||||
public BackpackEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory) {
|
||||
this.player = player;
|
||||
this.backpackDefinition = backpackDefinition;
|
||||
this.backpackInventory = backpackInventory;
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package forestry.api.storage;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
|
||||
/**
|
||||
* Use @ForgeSubscribe on a method taking this event as an argument. Will fire whenever a backpack tries to resupply to a player inventory. Processing will stop
|
||||
* if the event is canceled.
|
||||
*/
|
||||
@Cancelable
|
||||
public class BackpackResupplyEvent extends BackpackEvent {
|
||||
|
||||
public BackpackResupplyEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory) {
|
||||
super(player, backpackDefinition, backpackInventory);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package forestry.api.storage;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
|
||||
/**
|
||||
* Use @ForgeSubscribe on a method taking this event as an argument. Will fire whenever a backpack tries to store an item. Processing will stop if the stacksize
|
||||
* of stackToStow drops to 0 or less or the event is canceled.
|
||||
*/
|
||||
@Cancelable
|
||||
public class BackpackStowEvent extends BackpackEvent {
|
||||
|
||||
public final ItemStack stackToStow;
|
||||
|
||||
public BackpackStowEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory, ItemStack stackToStow) {
|
||||
super(player, backpackDefinition, backpackInventory);
|
||||
this.stackToStow = stackToStow;
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package forestry.api.world;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ITreeGenData {
|
||||
|
||||
int getGirth(World world, int x, int y, int z);
|
||||
|
||||
float getHeightModifier();
|
||||
|
||||
boolean canGrow(World world, int x, int y, int z, int expectedGirth, int expectedHeight);
|
||||
|
||||
void setLeaves(World world, String owner, int x, int y, int z);
|
||||
|
||||
boolean allowsFruitBlocks();
|
||||
|
||||
boolean trySpawnFruitBlock(World world, int x, int y, int z);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package forestry.api.world;
|
||||
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public interface IWorldGenInterface {
|
||||
|
||||
/**
|
||||
* Retrieves generators for trees identified by a given string.
|
||||
*
|
||||
* Returned generator classes take an {@link ITreeGenData} in the constructor.
|
||||
*
|
||||
* @param ident
|
||||
* Unique identifier for tree type. Forestry's convention is 'treeSpecies', i.e. 'treeBaobab', 'treeSequoia'.
|
||||
* @return All generators matching the given ident.
|
||||
*/
|
||||
Class<? extends WorldGenerator>[] getTreeGenerators(String ident);
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package forestry.api.world;
|
||||
|
||||
public class WorldGenManager {
|
||||
public static IWorldGenInterface worldgenInterface;
|
||||
}
|
Loading…
Reference in a new issue