mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 04:22:32 +00:00
Automatic code reformatting
This commit is contained in:
1 parent
9611ae08ae
commit
8cfafec6f9
672 files changed
+2462
-2985
No files matched your search
@@ -13,7 +13,6 @@ import java.util.Map;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* Some miscellaneous lists and settings for bees.
|
||||
*
|
||||
* @author SirSengir
|
||||
|
||||
@@ -75,9 +75,9 @@ public enum EnumBeeChromosome implements IChromosomeType {
|
||||
* Determines the bee's effect.
|
||||
*/
|
||||
EFFECT(IAlleleBeeEffect.class);
|
||||
|
||||
|
||||
private final Class<? extends IAllele> alleleClass;
|
||||
|
||||
|
||||
EnumBeeChromosome(Class<? extends IAllele> alleleClass) {
|
||||
this.alleleClass = alleleClass;
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@ 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. (server)
|
||||
*
|
||||
* @param genome Genome of the bee queen causing this effect
|
||||
* @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 housing {@link IBeeHousing} the bee currently resides in.
|
||||
* @param housing {@link IBeeHousing} the bee currently resides in.
|
||||
* @return storedData, may have been manipulated.
|
||||
*/
|
||||
IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
|
||||
@@ -23,11 +23,11 @@ public interface IAlleleBeeEffect extends IAlleleEffect {
|
||||
/**
|
||||
* Is called to produce visual bee effects. (client)
|
||||
*
|
||||
* @param genome Genome of the bee queen causing this effect
|
||||
* @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 housing {@link IBeeHousing} the bee currently resides in.
|
||||
* @param housing {@link IBeeHousing} the bee currently resides in.
|
||||
* @return storedData, may have been manipulated.
|
||||
*/
|
||||
IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing);
|
||||
|
||||
|
||||
}
|
||||
@@ -7,14 +7,13 @@ package forestry.api.apiculture;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public interface IAlleleBeeSpecies extends IAlleleSpecies {
|
||||
|
||||
@@ -41,13 +40,14 @@ public interface IAlleleBeeSpecies extends IAlleleSpecies {
|
||||
|
||||
/**
|
||||
* Only jubilant bees produce specialities.
|
||||
*
|
||||
* @return true if the bee is jubilant, false otherwise.
|
||||
*/
|
||||
boolean isJubilant(IBeeGenome genome, IBeeHousing housing);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ModelResourceLocation getModel(EnumBeeType type);
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager);
|
||||
}
|
||||
@@ -5,9 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpeciesBuilder;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IAlleleBeeSpeciesBuilder extends IAlleleSpeciesBuilder {
|
||||
|
||||
@@ -38,9 +37,13 @@ public interface IAlleleBeeSpeciesBuilder extends IAlleleSpeciesBuilder {
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder setNocturnal();
|
||||
|
||||
/** Use this if you have custom icons for bees. */
|
||||
/**
|
||||
* Use this if you have custom icons for bees.
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder setCustomBeeModelProvider(IBeeModelProvider beeIconProvider);
|
||||
|
||||
/** Use this if you have custom icon colours for bees (other than the default static primary + secondary colours). */
|
||||
/**
|
||||
* Use this if you have custom icon colours for bees (other than the default static primary + secondary colours).
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder setCustomBeeSpriteColourProvider(IBeeSpriteColourProvider beeIconColourProvider);
|
||||
}
|
||||
@@ -18,8 +18,7 @@ public interface IApiaristTracker extends IBreedingTracker {
|
||||
/**
|
||||
* Register the birth of a queen. Will mark species as discovered.
|
||||
*
|
||||
* @param queen
|
||||
* Created queen.
|
||||
* @param queen Created queen.
|
||||
*/
|
||||
void registerQueen(IIndividual queen);
|
||||
|
||||
@@ -31,8 +30,7 @@ public interface IApiaristTracker extends IBreedingTracker {
|
||||
/**
|
||||
* Register the birth of a princess. Will mark species as discovered.
|
||||
*
|
||||
* @param princess
|
||||
* Created princess.
|
||||
* @param princess Created princess.
|
||||
*/
|
||||
void registerPrincess(IIndividual princess);
|
||||
|
||||
@@ -44,8 +42,7 @@ public interface IApiaristTracker extends IBreedingTracker {
|
||||
/**
|
||||
* Register the birth of a drone. Will mark species as discovered.
|
||||
*
|
||||
* @param drone
|
||||
* Created drone.
|
||||
* @param drone Created drone.
|
||||
*/
|
||||
void registerDrone(IIndividual drone);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* When implemented as a capability by armor items, protects the wearer from negative bee effects.
|
||||
*
|
||||
* @see ApicultureCapabilities#ARMOR_APIARIST
|
||||
*/
|
||||
public interface IArmorApiarist {
|
||||
|
||||
@@ -17,9 +17,10 @@ public interface IArmorApiaristHelper {
|
||||
|
||||
/**
|
||||
* Called when the apiarist's armor acts as protection against an attack.
|
||||
* @param stack ItemStack to check
|
||||
* @param entity Entity being attacked
|
||||
* @param cause Optional cause of attack, such as a bee effect identifier
|
||||
*
|
||||
* @param stack ItemStack to check
|
||||
* @param entity Entity being attacked
|
||||
* @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 item is valid Apiarist Armor and should protect the player from that attack
|
||||
* @since Forestry 4.2
|
||||
@@ -28,11 +29,12 @@ public interface IArmorApiaristHelper {
|
||||
|
||||
/**
|
||||
* Called when the apiarist's armor acts as protection against an attack.
|
||||
* @param entity Entity being attacked
|
||||
* @param cause Optional cause of attack, such as a bee effect identifier
|
||||
*
|
||||
* @param entity Entity being attacked
|
||||
* @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 The number of valid Apiarist Armor pieces the player is wearing that are actually protecting.
|
||||
* 4 means full protection, but it can go higher if they are holding items like the smoker.
|
||||
* 4 means full protection, but it can go higher if they are holding items like the smoker.
|
||||
* @since Forestry 4.2
|
||||
*/
|
||||
int wearsItems(EntityLivingBase entity, String cause, boolean doProtect);
|
||||
|
||||
@@ -14,15 +14,15 @@ public interface IBeeFactory {
|
||||
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
|
||||
* See IAlleleBeeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
|
||||
*
|
||||
* @param uid Unique Identifier for this species
|
||||
* @param dominant Whether this species is genetically dominant (false means it is recessive)
|
||||
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
|
||||
* @param unlocalizedName Unlocalized name for this species
|
||||
* @param uid Unique Identifier for this species
|
||||
* @param dominant Whether this species is genetically dominant (false means it is recessive)
|
||||
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
|
||||
* @param unlocalizedName Unlocalized name for this species
|
||||
* @param unlocalizedDescription Unlocalized description for this species
|
||||
* @param branch Classification of this species
|
||||
* @param binomial Binomial name of the species sans genus ("Apis"). "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
|
||||
* @param primaryColor The outline color of this species
|
||||
* @param secondaryColor The body color of this species
|
||||
* @param branch Classification of this species
|
||||
* @param binomial Binomial name of the species sans genus ("Apis"). "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
|
||||
* @param primaryColor The outline color of this species
|
||||
* @param secondaryColor The body color of this species
|
||||
* @return a new bee species allele.
|
||||
*/
|
||||
IAlleleBeeSpeciesBuilder createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor);
|
||||
@@ -31,7 +31,7 @@ public interface IBeeFactory {
|
||||
* Creates a new bee branch.
|
||||
* Must be registered with AlleleManager.alleleRegistry.getClassification("family.apidae").addMemberGroup();
|
||||
*
|
||||
* @param uid Unique Identifier for this branch
|
||||
* @param uid Unique Identifier for this branch
|
||||
* @param scientific approximates a "genus" in real life. Real life examples: "Micrapis", "Megapis"
|
||||
* @return a new bee branch
|
||||
*/
|
||||
|
||||
@@ -5,23 +5,21 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
|
||||
/**
|
||||
* Only the default implementation is supported.
|
||||
*
|
||||
* @author SirSengir
|
||||
*
|
||||
*/
|
||||
public interface IBeeGenome extends IGenome {
|
||||
|
||||
@Override
|
||||
IAlleleBeeSpecies getPrimary();
|
||||
|
||||
|
||||
@Override
|
||||
IAlleleBeeSpecies getSecondary();
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ public interface IBeeHousing extends IHousing, IErrorLogicSource, IClimateProvid
|
||||
/**
|
||||
* Used by {@link IBeeRoot#createBeeHousingModifier(IBeeHousing)}
|
||||
* to combine bee modifiers from several sources that can change over time.
|
||||
*
|
||||
* @return IBeeModifiers from the housing, frames, etc.
|
||||
*/
|
||||
Iterable<IBeeModifier> getBeeModifiers();
|
||||
@@ -26,6 +27,7 @@ public interface IBeeHousing extends IHousing, IErrorLogicSource, IClimateProvid
|
||||
/**
|
||||
* Used by {@link IBeeRoot#createBeeHousingListener(IBeeHousing)}
|
||||
* to combine bee listeners from several sources that can change over time.
|
||||
*
|
||||
* @return IBeeListeners from the housing, multiblock parts, etc.
|
||||
*/
|
||||
Iterable<IBeeListener> getBeeListeners();
|
||||
@@ -37,15 +39,15 @@ public interface IBeeHousing extends IHousing, IErrorLogicSource, IClimateProvid
|
||||
int getBlockLightValue();
|
||||
|
||||
boolean canBlockSeeTheSky();
|
||||
|
||||
|
||||
boolean isRaining();
|
||||
|
||||
@Nullable
|
||||
GameProfile getOwner();
|
||||
|
||||
/**
|
||||
* @since Forestry 4.2
|
||||
* @return exact coordinates where bee particle FX should spawn from
|
||||
* @since Forestry 4.2
|
||||
*/
|
||||
Vec3d getBeeFXCoordinates();
|
||||
}
|
||||
@@ -21,7 +21,7 @@ public interface IBeeHousingInventory {
|
||||
* Adds products to the housing's inventory.
|
||||
*
|
||||
* @param product ItemStack with the product to add.
|
||||
* @param all if true, success requires that all products are added
|
||||
* @param all if true, success requires that all products are added
|
||||
* @return boolean indicating success or failure.
|
||||
*/
|
||||
boolean addProduct(ItemStack product, boolean all);
|
||||
|
||||
@@ -11,6 +11,7 @@ public interface IBeeListener {
|
||||
|
||||
/**
|
||||
* Called when the bees wear out the housing's equipment.
|
||||
*
|
||||
* @param amount Integer indicating the amount worn out.
|
||||
*/
|
||||
void wearOutEquipment(int amount);
|
||||
@@ -22,6 +23,7 @@ public interface IBeeListener {
|
||||
|
||||
/**
|
||||
* Called when the bees have retrieved some pollen.
|
||||
*
|
||||
* @return true if this bee listener handled the pollen.
|
||||
*/
|
||||
boolean onPollenRetrieved(IIndividual pollen);
|
||||
|
||||
@@ -5,14 +5,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
|
||||
public interface IBeeModelProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager);
|
||||
|
||||
@@ -7,29 +7,29 @@ package forestry.api.apiculture;
|
||||
|
||||
public interface IBeeModifier {
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param currentModifier Current modifier.
|
||||
* @return Float used to modify the base territory.
|
||||
*/
|
||||
float getTerritoryModifier(IBeeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param mate Genome of the bee mate this modifier is called for.
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param mate Genome of the bee mate this modifier is called for.
|
||||
* @param currentModifier Current modifier.
|
||||
* @return Float used to modify the base mutation chance.
|
||||
*/
|
||||
float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param currentModifier Current modifier.
|
||||
* @return Float used to modify the life span of queens.
|
||||
*/
|
||||
float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
* @param currentModifier Current modifier.
|
||||
* @return Float modifying the production speed of queens.
|
||||
*/
|
||||
|
||||
@@ -8,10 +8,10 @@ package forestry.api.apiculture;
|
||||
import forestry.api.genetics.IMutation;
|
||||
|
||||
public interface IBeeMutation extends IMutation {
|
||||
|
||||
|
||||
@Override
|
||||
IBeeRoot getRoot();
|
||||
|
||||
|
||||
/**
|
||||
* @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an integer previously!
|
||||
*/
|
||||
|
||||
@@ -15,8 +15,8 @@ public interface IBeeMutationFactory {
|
||||
*
|
||||
* @param parentBee0 A parent bee for this mutation
|
||||
* @param parentBee1 A parent bee for this mutation
|
||||
* @param result The resulting alleles for this mutation
|
||||
* @param chance The chance that breeding the two parent bees will result in this mutation
|
||||
* @param result The resulting alleles for this mutation
|
||||
* @param chance The chance that breeding the two parent bees will result in this mutation
|
||||
* @return a new bee mutation.
|
||||
*/
|
||||
IBeeMutationBuilder createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, int chance);
|
||||
|
||||
@@ -13,7 +13,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
/**
|
||||
* Bees can be seeded either as hive drops or as mutation results.
|
||||
*
|
||||
* <p>
|
||||
* Add IHiveDrops with HiveManager.get___Hive.addDrop
|
||||
*
|
||||
* @author SirSengir
|
||||
@@ -28,7 +28,7 @@ public interface IHiveDrop {
|
||||
* Chance to drop a bee or extra items. Default drops have 0.80 (= 80 %).
|
||||
*
|
||||
* @param world Minecraft world this is called for.
|
||||
* @param pos Coordinates of the broken hive.
|
||||
* @param pos Coordinates of the broken hive.
|
||||
* @return Chance for drop as a float of 0.0 - 1.0.
|
||||
*/
|
||||
double getChance(IBlockAccess world, BlockPos pos, int fortune);
|
||||
@@ -37,7 +37,7 @@ public interface IHiveDrop {
|
||||
* Chance for the princess to be ignoble. Default is around 0.4 to 0.7 (40% - 70%).
|
||||
*
|
||||
* @param world Minecraft world this is called for.
|
||||
* @param pos Coordinates of the broken hive.
|
||||
* @param pos Coordinates of the broken hive.
|
||||
* @return Chance for ignoble as a float of 0.0 - 1.0.
|
||||
*/
|
||||
double getIgnobleChance(IBlockAccess world, BlockPos pos, int fortune);
|
||||
|
||||
@@ -15,9 +15,9 @@ public interface IHiveFrame {
|
||||
* 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. The wear modifier of the current beekeeping mode has already been taken into account.
|
||||
* @param frame ItemStack containing the actual frame.
|
||||
* @param queen Current queen in the caller.
|
||||
* @param wear Integer denoting the amount worn out. The wear modifier of the current beekeeping mode has already been taken into account.
|
||||
* @return ItemStack containing the actual frame with adjusted damage, or null if it has been broken.
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -8,9 +8,13 @@ package forestry.api.apiculture;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
public interface IJubilanceFactory {
|
||||
/** The default Jubilance Provider is satisfied when the humidity and temperature are ideal for the bee. */
|
||||
/**
|
||||
* The default Jubilance Provider is satisfied when the humidity and temperature are ideal for the bee.
|
||||
*/
|
||||
IJubilanceProvider getDefault();
|
||||
|
||||
/** The Requires Resource Jubilance Provider is satisfied when a specific block is under the hive. */
|
||||
/**
|
||||
* The Requires Resource Jubilance Provider is satisfied when a specific block is under the hive.
|
||||
*/
|
||||
IJubilanceProvider getRequiresResource(IBlockState... acceptedBlockStates);
|
||||
}
|
||||
@@ -7,14 +7,13 @@ package forestry.api.apiculture.hives;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
|
||||
public interface IHiveDescription {
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
public enum EnumFruitFamily implements IFruitFamily {
|
||||
PRUNES("prunes", "Prunus domestica"),
|
||||
|
||||
@@ -11,7 +11,7 @@ public enum EnumGermlingType implements ISpeciesType {
|
||||
SAPLING("sapling"), POLLEN("pollen");
|
||||
|
||||
public static final EnumGermlingType[] VALUES = values();
|
||||
|
||||
|
||||
private final String name;
|
||||
|
||||
EnumGermlingType(String name) {
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
public enum EnumPileType{
|
||||
public enum EnumPileType {
|
||||
WOOD,
|
||||
DIRT,
|
||||
ASH;
|
||||
|
||||
|
||||
public static final EnumPileType[] VALUES = values();
|
||||
}
|
||||
@@ -51,15 +51,15 @@ public enum EnumTreeChromosome implements IChromosomeType {
|
||||
* Amount of random ticks which need to elapse before a sapling will grow into a tree.
|
||||
*/
|
||||
MATURATION(IAlleleInteger.class),
|
||||
|
||||
|
||||
GIRTH(IAlleleInteger.class),
|
||||
/**
|
||||
* Determines if the tree can burn.
|
||||
*/
|
||||
FIREPROOF(IAlleleBoolean.class),;
|
||||
|
||||
|
||||
private final Class<? extends IAllele> alleleClass;
|
||||
|
||||
|
||||
EnumTreeChromosome(Class<? extends IAllele> alleleClass) {
|
||||
this.alleleClass = alleleClass;
|
||||
}
|
||||
|
||||
@@ -5,11 +5,10 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IAlleleEffect;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Simple allele encapsulating a leaf effect. (Not implemented)
|
||||
|
||||
@@ -7,23 +7,21 @@ package forestry.api.arboriculture;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.genetics.IAlleleProperty;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAlleleTreeSpecies> {
|
||||
|
||||
|
||||
@Override
|
||||
ITreeRoot getRoot();
|
||||
|
||||
|
||||
/**
|
||||
* @return Native plant type of this species.
|
||||
*/
|
||||
@@ -38,24 +36,24 @@ public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAll
|
||||
* @return Tree generator for this species.
|
||||
*/
|
||||
ITreeGenerator getGenerator();
|
||||
|
||||
|
||||
/**
|
||||
* @return The modid from the mod of the species.
|
||||
*/
|
||||
String getModID();
|
||||
|
||||
|
||||
IWoodProvider getWoodProvider();
|
||||
|
||||
|
||||
/* MODELS AND OVERRIDES */
|
||||
@SideOnly(Side.CLIENT)
|
||||
ILeafSpriteProvider getLeafSpriteProvider();
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
int getGermlingColour(EnumGermlingType type, int renderPass);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ModelResourceLocation getGermlingModel(EnumGermlingType type);
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
|
||||
|
||||
|
||||
@@ -5,20 +5,23 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpeciesBuilder;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
public interface IAlleleTreeSpeciesBuilder extends IAlleleSpeciesBuilder {
|
||||
|
||||
@Override
|
||||
IAlleleTreeSpecies build();
|
||||
|
||||
/** Add a fruit family for this tree. Trees can have multiple fruit families. */
|
||||
/**
|
||||
* Add a fruit family for this tree. Trees can have multiple fruit families.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder addFruitFamily(IFruitFamily family);
|
||||
|
||||
/** Set the minecraft plant type for this tree. Default is Plains. */
|
||||
/**
|
||||
* Set the minecraft plant type for this tree. Default is Plains.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder setPlantType(EnumPlantType type);
|
||||
|
||||
}
|
||||
@@ -9,24 +9,24 @@ import javax.annotation.Nullable;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
|
||||
public interface IFruitProvider {
|
||||
IFruitFamily getFamily();
|
||||
|
||||
int getColour(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime);
|
||||
|
||||
/** return the color to use for decorative leaves. Usually the ripe color. */
|
||||
/**
|
||||
* return the color to use for decorative leaves. Usually the ripe color.
|
||||
*/
|
||||
int getDecorativeColor();
|
||||
|
||||
boolean isFruitLeaf(ITreeGenome genome, World world, BlockPos pos);
|
||||
@@ -60,7 +60,9 @@ public interface IFruitProvider {
|
||||
@Nullable
|
||||
ResourceLocation getSprite(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime);
|
||||
|
||||
/** return the ResourceLocation to display on decorative leaves */
|
||||
/**
|
||||
* return the ResourceLocation to display on decorative leaves
|
||||
*/
|
||||
@Nullable
|
||||
ResourceLocation getDecorativeSprite();
|
||||
|
||||
|
||||
@@ -5,14 +5,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
|
||||
/**
|
||||
* Provides icons for saplings, pollen, etc.
|
||||
* You must implement this yourself to use TreeManager.treeFactory.createSpecies()
|
||||
@@ -21,12 +19,13 @@ import forestry.api.core.IModelManager;
|
||||
public interface IGermlingModelProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
|
||||
|
||||
|
||||
ModelResourceLocation getModel(EnumGermlingType type);
|
||||
|
||||
/**
|
||||
* Provides color for sapling. See {@link ILeafSpriteProvider} for pollen color.
|
||||
* @param type the germling type to render
|
||||
*
|
||||
* @param type the germling type to render
|
||||
* @param renderPass renderPass of rendering
|
||||
* @return sapling color for renderPass
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
/**
|
||||
* Provides icons for leaves. Used by TreeManager.treeFactory.createSpecies()
|
||||
* Get a default Forestry implementation from TreeManager.treeFactory.getLeafIconProvider() or implement your own.
|
||||
*
|
||||
* <p>
|
||||
* If you implement your own, be sure to register the icons.
|
||||
* Icon registration is not done here because these icons are heavily reused.
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@ public interface IToolGrafter {
|
||||
*
|
||||
* @param stack ItemStack containing the grafter.
|
||||
* @param world Minecraft world the player and the target block inhabit.
|
||||
* @param pos Coordinate of the broken leaf block.
|
||||
* @param pos Coordinate of the broken leaf block.
|
||||
* @return Float representing the factor the usual drop chance is to be multiplied by.
|
||||
*/
|
||||
float getSaplingModifier(ItemStack stack, World world, EntityPlayer player, BlockPos pos);
|
||||
|
||||
@@ -16,22 +16,24 @@ public interface ITreeFactory {
|
||||
* Automatically registered with AlleleManager.alleleRegistry.registerAllele()
|
||||
* See IAlleleTreeSpeciesBuilder and IAlleleSpeciesBuilder for adding additional properties to the returned species.
|
||||
*
|
||||
* @param uid Unique Identifier for this species
|
||||
* @param unlocalizedName Unlocalized name for this species
|
||||
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
|
||||
* @param uid Unique Identifier for this species
|
||||
* @param unlocalizedName Unlocalized name for this species
|
||||
* @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry.
|
||||
* @param unlocalizedDescription Unlocalized description for this species
|
||||
* @param dominant Whether this species is genetically dominant (false means it is recessive)
|
||||
* @param branch Classification of this species
|
||||
* @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
|
||||
* @param modID The modID from the mod of the species
|
||||
* @param leafSpriteProvider The leaf sprite provider for this species
|
||||
* @param germlingModelProvider The germling model provider for this species
|
||||
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
|
||||
* @param generator The tree generator
|
||||
* @param dominant Whether this species is genetically dominant (false means it is recessive)
|
||||
* @param branch Classification of this species
|
||||
* @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
|
||||
* @param modID The modID from the mod of the species
|
||||
* @param leafSpriteProvider The leaf sprite provider for this species
|
||||
* @param germlingModelProvider The germling model provider for this species
|
||||
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
|
||||
* @param generator The tree generator
|
||||
* @return a new tree species allele.
|
||||
*/
|
||||
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, @Nonnull IWoodProvider woodProvider, ITreeGenerator generator);
|
||||
|
||||
/** Get one of the built-in Forestry leaf types. Default type is deciduous. */
|
||||
/**
|
||||
* Get one of the built-in Forestry leaf types. Default type is deciduous.
|
||||
*/
|
||||
ILeafSpriteProvider getLeafIconProvider(EnumLeafType enumLeafType, Color color, Color colorPollinated);
|
||||
}
|
||||
@@ -7,15 +7,13 @@ package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
/**
|
||||
* Implements the tree generation for a tree species.
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ public interface ITreeGenome extends IGenome {
|
||||
|
||||
@Override
|
||||
IAlleleTreeSpecies getSecondary();
|
||||
|
||||
|
||||
IFruitProvider getFruitProvider();
|
||||
|
||||
float getHeight();
|
||||
@@ -23,7 +23,7 @@ public interface ITreeGenome extends IGenome {
|
||||
|
||||
/**
|
||||
* @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
|
||||
* IFruitProvider
|
||||
*/
|
||||
float getYield();
|
||||
|
||||
|
||||
@@ -8,28 +8,24 @@ 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.
|
||||
*/
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
public interface ITreeMutation extends IMutation {
|
||||
|
||||
|
||||
/**
|
||||
* @return {@link ISpeciesRoot} this mutation is associated with.
|
||||
*/
|
||||
|
||||
@@ -15,8 +15,8 @@ public interface ITreeMutationFactory {
|
||||
*
|
||||
* @param parentTree0 A parent tree for this mutation
|
||||
* @param parentTree1 A parent tree for this mutation
|
||||
* @param result The resulting alleles for this mutation
|
||||
* @param chance The chance that breeding the two parent trees will result in this mutation
|
||||
* @param result The resulting alleles for this mutation
|
||||
* @param chance The chance that breeding the two parent trees will result in this mutation
|
||||
* @return a new tree mutation.
|
||||
*/
|
||||
ITreeMutationBuilder createMutation(IAlleleTreeSpecies parentTree0, IAlleleTreeSpecies parentTree1, IAllele[] result, int chance);
|
||||
|
||||
@@ -24,7 +24,7 @@ public interface IWoodAccess {
|
||||
ItemStack getStack(IWoodType woodType, WoodBlockKind kind, boolean fireproof);
|
||||
|
||||
IBlockState getBlock(IWoodType woodType, WoodBlockKind kind, boolean fireproof);
|
||||
|
||||
|
||||
List<IWoodType> getRegisteredWoodTypes();
|
||||
|
||||
}
|
||||
@@ -15,5 +15,5 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
public interface IWoodItemMeshDefinition extends ItemMeshDefinition {
|
||||
|
||||
ResourceLocation getDefaultModelLocation(ItemStack stack);
|
||||
|
||||
|
||||
}
|
||||
@@ -13,9 +13,9 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IWoodStateMapper extends IStateMapper {
|
||||
|
||||
|
||||
ModelResourceLocation getModelLocation(IBlockState state);
|
||||
|
||||
|
||||
ModelResourceLocation getDefaultModelResourceLocation(IBlockState state);
|
||||
|
||||
}
|
||||
@@ -12,16 +12,16 @@ public interface IWoodType extends IStringSerializable {
|
||||
float getHardness();
|
||||
|
||||
int getCarbonization();
|
||||
|
||||
|
||||
float getCharcoalChance(int numberOfCharcoal);
|
||||
|
||||
|
||||
String getPlankTexture();
|
||||
|
||||
|
||||
String getDoorLowerTexture();
|
||||
|
||||
|
||||
String getDoorUpperTexture();
|
||||
|
||||
|
||||
String getBarkTexture();
|
||||
|
||||
|
||||
String getHeartTexture();
|
||||
}
|
||||
@@ -7,13 +7,19 @@ package forestry.api.circuits;
|
||||
|
||||
public interface ICircuitLayout {
|
||||
|
||||
/** unique ID for this circuit layout */
|
||||
/**
|
||||
* unique ID for this circuit layout
|
||||
*/
|
||||
String getUID();
|
||||
|
||||
/** localized name for this circuit layout */
|
||||
/**
|
||||
* localized name for this circuit layout
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/** localized string for how this circuit layout is used */
|
||||
/**
|
||||
* localized string for how this circuit layout is used
|
||||
*/
|
||||
String getUsage();
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,9 +10,13 @@ package forestry.api.circuits;
|
||||
* See CircuitSocketType for Forestry's uses.
|
||||
*/
|
||||
public interface ICircuitSocketType {
|
||||
/** unique identifier for this socket type */
|
||||
/**
|
||||
* unique identifier for this socket type
|
||||
*/
|
||||
String getUid();
|
||||
|
||||
/** comparison using uid */
|
||||
/**
|
||||
* comparison using uid
|
||||
*/
|
||||
boolean equals(ICircuitSocketType socketType);
|
||||
}
|
||||
@@ -3,5 +3,5 @@ package forestry.api.climate;
|
||||
public enum EnumClimatiserModes {
|
||||
|
||||
POSITIVE, NEGATIVE, NONE
|
||||
|
||||
|
||||
}
|
||||
@@ -3,5 +3,5 @@ package forestry.api.climate;
|
||||
public enum EnumClimatiserTypes {
|
||||
|
||||
TEMPERATURE, HUMIDITY, NONE
|
||||
|
||||
|
||||
}
|
||||
@@ -7,12 +7,12 @@ package forestry.api.climate;
|
||||
|
||||
public interface IClimateControl {
|
||||
|
||||
float getControlTemperature();
|
||||
float getControlTemperature();
|
||||
|
||||
float getControlHumidity();
|
||||
|
||||
void setControlTemperature(float temperature);
|
||||
float getControlHumidity();
|
||||
|
||||
void setControlTemperature(float temperature);
|
||||
|
||||
void setControlHumidity(float humidity);
|
||||
|
||||
void setControlHumidity(float humidity);
|
||||
|
||||
}
|
||||
@@ -10,5 +10,5 @@ import forestry.api.core.ILocatable;
|
||||
public interface IClimateControlProvider extends ILocatable {
|
||||
|
||||
IClimateControl getClimateControl();
|
||||
|
||||
|
||||
}
|
||||
@@ -14,17 +14,17 @@ public interface IClimatePosition extends INbtReadable, INbtWritable {
|
||||
IClimateRegion getClimateRegion();
|
||||
|
||||
BlockPos getPos();
|
||||
|
||||
|
||||
void setTemperature(float temperature);
|
||||
|
||||
|
||||
void addTemperature(float temperature);
|
||||
|
||||
|
||||
float getTemperature();
|
||||
|
||||
void setHumidity(float humidity);
|
||||
|
||||
|
||||
void addHumidity(float humidity);
|
||||
|
||||
|
||||
float getHumidity();
|
||||
|
||||
}
|
||||
@@ -10,9 +10,9 @@ import forestry.api.core.EnumTemperature;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
public interface IClimateProvider {
|
||||
Biome getBiome();
|
||||
Biome getBiome();
|
||||
|
||||
EnumTemperature getTemperature();
|
||||
EnumTemperature getTemperature();
|
||||
|
||||
EnumHumidity getHumidity();
|
||||
EnumHumidity getHumidity();
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public interface IClimateSource {
|
||||
|
||||
/**
|
||||
* @param tickCount The current tick count.
|
||||
* @param region The climate region, in that the source stands.
|
||||
* @param region The climate region, in that the source stands.
|
||||
* @return Return true if the the climate has changed.
|
||||
*/
|
||||
boolean changeClimate(int tickCount, IClimateRegion region);
|
||||
|
||||
@@ -8,6 +8,6 @@ package forestry.api.climate;
|
||||
import forestry.api.core.ILocatable;
|
||||
|
||||
public interface IClimateSourceProvider extends ILocatable {
|
||||
|
||||
|
||||
IClimateSource getClimateSource();
|
||||
}
|
||||
@@ -8,11 +8,11 @@ package forestry.api.climate;
|
||||
public interface IClimatiserDefinition {
|
||||
|
||||
float getChange();
|
||||
|
||||
|
||||
double getRange();
|
||||
|
||||
|
||||
EnumClimatiserModes getMode();
|
||||
|
||||
|
||||
EnumClimatiserTypes getType();
|
||||
|
||||
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
public class BiomeHelper {
|
||||
@@ -14,6 +13,7 @@ public class BiomeHelper {
|
||||
/**
|
||||
* Determines if a given Biome is of HELLISH temperature, since it is treated separately from actual temperature values.
|
||||
* Uses the BiomeDictionary.
|
||||
*
|
||||
* @param biomeGen Biome of the biome in question
|
||||
* @return true, if the Biome is a Nether-type biome; false otherwise.
|
||||
*/
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
package forestry.api.core;
|
||||
|
||||
public class CamouflageManager {
|
||||
|
||||
|
||||
public static ICamouflageAccess camouflageAccess;
|
||||
|
||||
|
||||
public static final String DEFAULT = "default";
|
||||
|
||||
|
||||
public static final String GLASS = "glass";
|
||||
|
||||
|
||||
public static final String DOOR = "door";
|
||||
|
||||
}
|
||||
@@ -8,14 +8,16 @@ package forestry.api.core;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
/**
|
||||
* Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location.
|
||||
*
|
||||
* This enum concerns humidity.
|
||||
* Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location.
|
||||
* <p>
|
||||
* This enum concerns humidity.
|
||||
*/
|
||||
public enum EnumHumidity {
|
||||
ARID("Arid"),
|
||||
NORMAL("Normal"),
|
||||
/** matches {@link Biome#isHighHumidity()} */
|
||||
/**
|
||||
* matches {@link Biome#isHighHumidity()}
|
||||
*/
|
||||
DAMP("Damp");
|
||||
|
||||
public final String name;
|
||||
|
||||
@@ -9,14 +9,13 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location.
|
||||
*
|
||||
* This enum concerns temperature.
|
||||
* Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location.
|
||||
* <p>
|
||||
* This enum concerns temperature.
|
||||
*/
|
||||
public enum EnumTemperature {
|
||||
NONE("None", "habitats/ocean"), ICY("Icy", "habitats/snow"), COLD("Cold", "habitats/taiga"),
|
||||
@@ -43,6 +42,7 @@ public enum EnumTemperature {
|
||||
* Determines the EnumTemperature given a floating point representation of
|
||||
* Minecraft temperature. Hellish biomes are handled based on their biome
|
||||
* type - check BiomeHelper.isBiomeHellish.
|
||||
*
|
||||
* @param rawTemp raw temperature value
|
||||
* @return EnumTemperature corresponding to value of rawTemp
|
||||
*/
|
||||
|
||||
@@ -13,21 +13,21 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Forestry's API is divided into several subcategories to make it easier to understand.
|
||||
*
|
||||
* <p>
|
||||
* If you need to distribute API files, try to only include the parts you are actually
|
||||
* using to minimize conflicts due to API changes.
|
||||
*
|
||||
* .core - Miscallenous base classes and interfaces as well as some basics for tools, armor, game modes and stuff needed by biome mods.
|
||||
* .fuels - Managers and classes to facilitate adding fuels to various engines and machines.
|
||||
* .recipes - Managers and helpers to facilitate adding new recipes to various machines.
|
||||
* .storage - Managers, events and interfaces for defining new backpacks and handling backpack behaviour.
|
||||
* .mail - Anything related to handling letters and adding new mail carrier systems.
|
||||
* .genetics - Shared code for all genetic subclasses.
|
||||
* \ .apiculture - Bees.
|
||||
* \ .arboriculture - Trees.
|
||||
* \ .lepidopterology - Butterflies.
|
||||
*
|
||||
* Note that if Forestry is not present, all these references will be null.
|
||||
* <p>
|
||||
* .core - Miscallenous base classes and interfaces as well as some basics for tools, armor, game modes and stuff needed by biome mods.
|
||||
* .fuels - Managers and classes to facilitate adding fuels to various engines and machines.
|
||||
* .recipes - Managers and helpers to facilitate adding new recipes to various machines.
|
||||
* .storage - Managers, events and interfaces for defining new backpacks and handling backpack behaviour.
|
||||
* .mail - Anything related to handling letters and adding new mail carrier systems.
|
||||
* .genetics - Shared code for all genetic subclasses.
|
||||
* \ .apiculture - Bees.
|
||||
* \ .arboriculture - Trees.
|
||||
* \ .lepidopterology - Butterflies.
|
||||
* <p>
|
||||
* Note that if Forestry is not present, all these references will be null.
|
||||
*/
|
||||
public class ForestryAPI {
|
||||
|
||||
@@ -41,13 +41,13 @@ public class ForestryAPI {
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static ITextureManager textureManager;
|
||||
|
||||
|
||||
/**
|
||||
* A {@link IModelManager} needed for some things in the API.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IModelManager modelManager;
|
||||
|
||||
|
||||
public static IClimateManager climateManager;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,16 +5,13 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IBreedingTracker;
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
public abstract class ForestryEvent extends Event {
|
||||
|
||||
|
||||
@@ -12,21 +12,22 @@ public interface ICamouflageHandler extends ILocatable {
|
||||
/**
|
||||
* @return The item of the block that is the camouflage of this handler for the type.
|
||||
*/
|
||||
ItemStack getCamouflageBlock(String type);
|
||||
ItemStack getCamouflageBlock(String type);
|
||||
|
||||
/**
|
||||
* @return The default camouflage block item for the type.
|
||||
*/
|
||||
ItemStack getDefaultCamouflageBlock(String type);
|
||||
/**
|
||||
* @return The default camouflage block item for the type.
|
||||
*/
|
||||
ItemStack getDefaultCamouflageBlock(String type);
|
||||
|
||||
/**
|
||||
* @return True if the handler can handle this type of camouflage.
|
||||
*/
|
||||
boolean canHandleType(String type);
|
||||
/**
|
||||
* @return True if the handler can handle this type of camouflage.
|
||||
*/
|
||||
boolean canHandleType(String type);
|
||||
|
||||
/**
|
||||
* Set the camouflage block item for the type.
|
||||
* @return True if the block has chanced.
|
||||
*/
|
||||
boolean setCamouflageBlock(String type, ItemStack camouflageBlock, boolean sendClientUpdate);
|
||||
/**
|
||||
* Set the camouflage block item for the type.
|
||||
*
|
||||
* @return True if the block has chanced.
|
||||
*/
|
||||
boolean setCamouflageBlock(String type, ItemStack camouflageBlock, boolean sendClientUpdate);
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import net.minecraft.util.math.BlockPos;
|
||||
public interface ICamouflagedTile {
|
||||
|
||||
String getCamouflageType();
|
||||
|
||||
|
||||
BlockPos getCoordinates();
|
||||
|
||||
|
||||
}
|
||||
@@ -5,8 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
|
||||
/**
|
||||
@@ -17,6 +15,7 @@ public interface IErrorLogic extends IErrorSource {
|
||||
|
||||
/**
|
||||
* Sets the errorState when condition is true, and unsets it when condition is false.
|
||||
*
|
||||
* @return condition
|
||||
*/
|
||||
boolean setCondition(boolean condition, IErrorState errorState);
|
||||
|
||||
@@ -10,13 +10,12 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author CovertJaguar <http://www.railcraft.info/>
|
||||
*/
|
||||
public interface IErrorState {
|
||||
|
||||
|
||||
short getID();
|
||||
|
||||
|
||||
String getUniqueName();
|
||||
|
||||
String getUnlocalizedDescription();
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.event.LootTableLoadEvent;
|
||||
|
||||
public interface IForestryConstants {
|
||||
@@ -15,12 +14,12 @@ public interface IForestryConstants {
|
||||
* @return The villager ID for the Apiarist Villager.
|
||||
*/
|
||||
String getApicultureVillagerID();
|
||||
|
||||
|
||||
/**
|
||||
* @return The villager ID for the Arborist Villager.
|
||||
*/
|
||||
String getArboricultureVillagerID();
|
||||
|
||||
|
||||
/**
|
||||
* @return The {@link LootTableLoadEvent} key for adding items to the Forestry Villager chest.
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface IGameMode {
|
||||
* @return Value of the requested setting, false if unknown setting.
|
||||
*/
|
||||
boolean getBooleanSetting(String ident);
|
||||
|
||||
|
||||
/**
|
||||
* @param ident Identifier for the setting. (See the gamemode config.)
|
||||
* @return Value of the requested setting, 0 if unknown setting.
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package forestry.api.core;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -14,5 +13,5 @@ public interface IItemModelRegister {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModel(Item item, IModelManager manager);
|
||||
|
||||
|
||||
}
|
||||
@@ -16,6 +16,8 @@ import net.minecraft.world.World;
|
||||
public interface ILocatable {
|
||||
BlockPos getCoordinates();
|
||||
|
||||
/** Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12 */
|
||||
/**
|
||||
* Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12
|
||||
*/
|
||||
World getWorldObj();
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -13,19 +13,19 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IModelManager {
|
||||
|
||||
|
||||
void registerItemModel(Item item, int meta, String modifier, String identifier);
|
||||
|
||||
|
||||
void registerItemModel(Item item, int meta, String identifier);
|
||||
|
||||
|
||||
void registerItemModel(Item item, int meta);
|
||||
|
||||
|
||||
ModelResourceLocation getModelLocation(Item item);
|
||||
|
||||
|
||||
ModelResourceLocation getModelLocation(String identifier);
|
||||
|
||||
|
||||
ModelResourceLocation getModelLocation(String modID, String identifier);
|
||||
|
||||
|
||||
void registerItemModel(Item item, ItemMeshDefinition definition);
|
||||
|
||||
|
||||
}
|
||||
@@ -12,5 +12,5 @@ public interface ISpriteRegister {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerSprites(ITextureManager manager);
|
||||
|
||||
|
||||
}
|
||||
@@ -12,5 +12,5 @@ public interface IStateMapperRegister {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerStateMapper();
|
||||
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
package forestry.api.core;
|
||||
|
||||
/**
|
||||
* Marks a tool as a scoop.
|
||||
* Marks a tool as a scoop.
|
||||
*/
|
||||
public interface IToolScoop {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ package forestry.api.core;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
||||
/**
|
||||
* References to the specialised tabs added by Forestry to creative inventory.
|
||||
* References to the specialised tabs added by Forestry to creative inventory.
|
||||
*/
|
||||
public class Tabs {
|
||||
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.farming;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class Farmables {
|
||||
/**
|
||||
* Can be used to add IFarmables to some of the vanilla farm logics.
|
||||
@@ -20,7 +19,7 @@ public class Farmables {
|
||||
* Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
|
||||
*/
|
||||
public static final Multimap<String, IFarmable> farmables = HashMultimap.create();
|
||||
|
||||
|
||||
public static final Map<ItemStack, Integer> fertilizers = new LinkedHashMap<>();
|
||||
|
||||
}
|
||||
@@ -5,14 +5,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.farming;
|
||||
|
||||
import forestry.api.core.IErrorLogicSource;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.core.IErrorLogicSource;
|
||||
|
||||
public interface IFarmHousing extends IErrorLogicSource {
|
||||
|
||||
BlockPos getCoords();
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface IFarmListener {
|
||||
* 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}
|
||||
* @param crop Harvested {@link ICrop}
|
||||
*/
|
||||
void afterCropHarvest(Collection<ItemStack> harvested, ICrop crop);
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -33,12 +32,12 @@ public interface IFarmLogic {
|
||||
Collection<ICrop> harvest(World world, BlockPos pos, FarmDirection direction, int extent);
|
||||
|
||||
IFarmLogic setManual(boolean manual);
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ResourceLocation getTextureMap();
|
||||
|
||||
|
||||
String getName();
|
||||
|
||||
|
||||
/**
|
||||
* @return the itemStack that represents this farm logic. Used as an icon for the farm logic.
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,6 @@ package forestry.api.fuels;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class FuelManager {
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
/**
|
||||
* Holds a static reference to the {@link IAlleleRegistry}.
|
||||
* Holds a static reference to the {@link IAlleleRegistry}.
|
||||
*/
|
||||
public class AlleleManager {
|
||||
/**
|
||||
|
||||
@@ -6,13 +6,13 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
* Called after Forestry has registered all his species alleles of a individual.
|
||||
*/
|
||||
public class AlleleSpeciesRegisterEvent extends Event {
|
||||
|
||||
|
||||
private final ISpeciesRoot root;
|
||||
|
||||
|
||||
public AlleleSpeciesRegisterEvent(ISpeciesRoot root) {
|
||||
this.root = root;
|
||||
}
|
||||
|
||||
|
||||
public ISpeciesRoot getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ package forestry.api.genetics;
|
||||
|
||||
/**
|
||||
* An {@link IIndividual}'s {@link IGenome} is composed of {@link IChromosome}s consisting each of a primary and secondary {@link IAllele}.
|
||||
*
|
||||
* <p>
|
||||
* {@link IAllele}s hold all information regarding an {@link IIndividual}'s traits, from species to size, temperature tolerances, etc.
|
||||
*
|
||||
* <p>
|
||||
* Should be extended for different types of alleles. ISpeciesAllele, IBiomeAllele, etc.
|
||||
*
|
||||
* @author SirSengir
|
||||
@@ -25,7 +25,7 @@ public interface IAllele {
|
||||
* @return true if the allele is dominant, false otherwise.
|
||||
*/
|
||||
boolean isDominant();
|
||||
|
||||
|
||||
/**
|
||||
* @return Localized short, human-readable identifier used in tooltips and beealyzer.
|
||||
*/
|
||||
|
||||
@@ -5,15 +5,13 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Basic effect allele.
|
||||
* Basic effect allele.
|
||||
*/
|
||||
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.
|
||||
* combinable.
|
||||
*/
|
||||
boolean isCombinable();
|
||||
|
||||
|
||||
@@ -4,71 +4,71 @@ import net.minecraft.util.math.Vec3i;
|
||||
|
||||
/**
|
||||
* Creates new alleles with smart localization.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* <p>
|
||||
* UID is created like this:
|
||||
* modId + '.' + category + WordUtils.capitalize(valueName);
|
||||
* modId + '.' + category + WordUtils.capitalize(valueName);
|
||||
* For Example:
|
||||
* modId:forestry, category:height, valueName:smallest => forestry.heightSmallest
|
||||
* modId:forestry, category:height, valueName:smallest => forestry.heightSmallest
|
||||
* This is mainly for legacy compatibility and may change in future major versions.
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
* <p>
|
||||
* The default localization uses:
|
||||
* [modId].allele.[valueName]
|
||||
*
|
||||
* <p>
|
||||
* Languages that need category-specific names can override it by defining:
|
||||
* [modId].allele.[category].[valueName]
|
||||
*
|
||||
* <p>
|
||||
* For example:
|
||||
* en_US
|
||||
* forestry.allele.smallest=Smallest
|
||||
* forestry.allele.smallest=Smallest
|
||||
* ru_RU
|
||||
* forestry.allele.smallest=????? ?????????
|
||||
* forestry.allele.height.smallest=????? ??????
|
||||
* forestry.allele.smallest=????? ?????????
|
||||
* forestry.allele.height.smallest=????? ??????
|
||||
*/
|
||||
public interface IAlleleFactory {
|
||||
/**
|
||||
* @param modId mod prefix for uid and localization (i.e. "forestry")
|
||||
* @param category allele category for uid and localization (i.e. "height")
|
||||
* @param valueName allele value name for uid and localization (i.e. "smallest")
|
||||
* @param value allele float value
|
||||
* @param modId mod prefix for uid and localization (i.e. "forestry")
|
||||
* @param category allele category for uid and localization (i.e. "height")
|
||||
* @param valueName allele value name for uid and localization (i.e. "smallest")
|
||||
* @param value allele float value
|
||||
* @param isDominant allele dominance
|
||||
* @param types allele chromosome type for registration (i.e. EnumTreeChromosome.HEIGHT)
|
||||
* @param types allele chromosome type for registration (i.e. EnumTreeChromosome.HEIGHT)
|
||||
* @return a new IAlleleFloat, registered with the allele registry.
|
||||
* @since Forestry 4.2
|
||||
*/
|
||||
IAlleleFloat createFloat(String modId, String category, String valueName, float value, boolean isDominant, IChromosomeType... types);
|
||||
|
||||
/**
|
||||
* @param modId mod prefix for uid and localization (i.e. "forestry")
|
||||
* @param category allele category for uid and localization (i.e. "territory")
|
||||
* @param valueName allele value name for uid and localization (i.e. "large")
|
||||
* @param value allele area x, y, z size
|
||||
* @param modId mod prefix for uid and localization (i.e. "forestry")
|
||||
* @param category allele category for uid and localization (i.e. "territory")
|
||||
* @param valueName allele value name for uid and localization (i.e. "large")
|
||||
* @param value allele area x, y, z size
|
||||
* @param isDominant allele dominance
|
||||
* @param types allele chromosome type for registration (i.e. EnumBeeChromosome.TERRITORY)
|
||||
* @param types allele chromosome type for registration (i.e. EnumBeeChromosome.TERRITORY)
|
||||
* @return a new IAlleleArea, registered with the allele registry.
|
||||
* @since Forestry 4.2
|
||||
*/
|
||||
IAlleleArea createArea(String modId, String category, String valueName, Vec3i value, boolean isDominant, IChromosomeType... types);
|
||||
|
||||
/**
|
||||
* @param modId mod prefix for uid and localization (i.e. "forestry")
|
||||
* @param category allele category for uid and localization (i.e. "fertility")
|
||||
* @param valueName allele value name for uid and localization (i.e. "low")
|
||||
* @param value allele int value
|
||||
* @param modId mod prefix for uid and localization (i.e. "forestry")
|
||||
* @param category allele category for uid and localization (i.e. "fertility")
|
||||
* @param valueName allele value name for uid and localization (i.e. "low")
|
||||
* @param value allele int value
|
||||
* @param isDominant allele dominance
|
||||
* @param types allele chromosome type for registration (i.e. EnumBeeChromosome.FERTILITY)
|
||||
* @param types allele chromosome type for registration (i.e. EnumBeeChromosome.FERTILITY)
|
||||
* @return a new IAlleleInteger, registered with the allele registry.
|
||||
* @since Forestry 4.2
|
||||
*/
|
||||
IAlleleInteger createInteger(String modId, String category, String valueName, int value, boolean isDominant, IChromosomeType... types);
|
||||
|
||||
/**
|
||||
* @param modId mod prefix for uid and localization (i.e. "forestry")
|
||||
* @param category allele category for uid and localization (i.e. "fireproof")
|
||||
* @param value allele boolean value
|
||||
* @param modId mod prefix for uid and localization (i.e. "forestry")
|
||||
* @param category allele category for uid and localization (i.e. "fireproof")
|
||||
* @param value allele boolean value
|
||||
* @param isDominant allele dominance
|
||||
* @param types allele chromosome type for registration (i.e. EnumTreeChromosome.FIREPROOF)
|
||||
* @param types allele chromosome type for registration (i.e. EnumTreeChromosome.FIREPROOF)
|
||||
* @return a new IAlleleBoolean, registered with the allele registry.
|
||||
* Note that valueName will always be "true" or "false"
|
||||
* @since Forestry 4.2
|
||||
@@ -76,12 +76,12 @@ public interface IAlleleFactory {
|
||||
IAlleleBoolean createBoolean(String modId, String category, boolean value, boolean isDominant, IChromosomeType... types);
|
||||
|
||||
/**
|
||||
* @param modId mod prefix for uid (i.e. "forestry")
|
||||
* @param category allele category for uid (i.e. "flowers")
|
||||
* @param valueName allele value name for uid (i.e. "vanilla")
|
||||
* @param value allele IFlowerProvider value
|
||||
* @param modId mod prefix for uid (i.e. "forestry")
|
||||
* @param category allele category for uid (i.e. "flowers")
|
||||
* @param valueName allele value name for uid (i.e. "vanilla")
|
||||
* @param value allele IFlowerProvider value
|
||||
* @param isDominant allele dominance
|
||||
* @param types allele chromosome type for registration (i.e. EnumBeeChromosome.FLOWER_PROVIDER)
|
||||
* @param types allele chromosome type for registration (i.e. EnumBeeChromosome.FLOWER_PROVIDER)
|
||||
* @return a new IAlleleFlowers, registered with the allele registry.
|
||||
* IAlleleFlowers localization is handled by the IFlowerProvider.getDescription(), unlike the other alleles.
|
||||
* @since Forestry 4.2
|
||||
|
||||
@@ -7,34 +7,30 @@ package forestry.api.genetics;
|
||||
|
||||
/**
|
||||
* @author Alex Binnie
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
* @param allele Allele which was registered.
|
||||
*/
|
||||
void onRegisterAllele(IAllele allele);
|
||||
|
||||
/**
|
||||
* Called when a classification is registered with {@link IAlleleRegistry}.
|
||||
*
|
||||
* @param classification
|
||||
* Classification which was registered.
|
||||
* @param classification Classification which was registered.
|
||||
*/
|
||||
void onRegisterClassification(IClassification classification);
|
||||
|
||||
/**
|
||||
* Called when a fruit family is registered with {@link IAlleleRegistry}.
|
||||
*
|
||||
* @param family
|
||||
* Fruit family which was registered.
|
||||
* @param family Fruit family which was registered.
|
||||
*/
|
||||
void onRegisterFruitFamily(IFruitFamily family);
|
||||
}
|
||||
@@ -7,5 +7,5 @@ public interface IAlleleProperty<A extends IAlleleProperty<A>> extends IAllele,
|
||||
*/
|
||||
@Override
|
||||
int compareTo(A o);
|
||||
|
||||
|
||||
}
|
||||
@@ -9,11 +9,9 @@ import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.genetics.IClassification.EnumClassLevel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Manages {@link ISpeciesRoot}, {@link IAllele}s, {@link IFruitFamily}s, {@link IClassification}, the blacklist and allows creation of research notes.
|
||||
@@ -26,6 +24,7 @@ public interface IAlleleRegistry {
|
||||
|
||||
/**
|
||||
* Register a {@link ISpeciesRoot}.
|
||||
*
|
||||
* @param root {@link ISpeciesRoot} to register.
|
||||
*/
|
||||
void registerSpeciesRoot(ISpeciesRoot root);
|
||||
@@ -37,6 +36,7 @@ public interface IAlleleRegistry {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@@ -45,6 +45,7 @@ public interface IAlleleRegistry {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@@ -53,6 +54,7 @@ public interface IAlleleRegistry {
|
||||
|
||||
/**
|
||||
* Retrieve a matching {@link ISpeciesRoot} for the given {@link IIndividual}-class.
|
||||
*
|
||||
* @param clz Class extending {@link IIndividual}.
|
||||
* @return {@link ISpeciesRoot} if found, null otherwise.
|
||||
*/
|
||||
@@ -77,8 +79,7 @@ public interface IAlleleRegistry {
|
||||
/**
|
||||
* Retrieve genetic information from an itemstack.
|
||||
*
|
||||
* @param stack
|
||||
* Stack to retrieve genetic information for.
|
||||
* @param stack Stack to retrieve genetic information for.
|
||||
* @return IIndividual containing genetic information, null if none could be extracted.
|
||||
*/
|
||||
@Nullable
|
||||
@@ -93,11 +94,11 @@ public interface IAlleleRegistry {
|
||||
|
||||
/**
|
||||
* Registers an allele.
|
||||
*
|
||||
* <p>
|
||||
* NOTE: Where possible, it is recommended to use IAlleleFactory instead
|
||||
* because it has built-in advanced localization support.
|
||||
* because it has built-in advanced localization support.
|
||||
*
|
||||
* @param allele IAllele to register.
|
||||
* @param allele IAllele to register.
|
||||
* @param chromosomeTypes valid chromosomeTypes for this allele.
|
||||
* @since Forestry 4.2
|
||||
*/
|
||||
@@ -111,18 +112,15 @@ public interface IAlleleRegistry {
|
||||
/**
|
||||
* Registers an old allele UID and the new IAllele to replace instances of it with.
|
||||
*
|
||||
* @param deprecatedAlleleUID
|
||||
* the old allele's UID
|
||||
* @param replacement
|
||||
* the IAllele that the deprecated Allele will be replaced with.
|
||||
* @param deprecatedAlleleUID the old allele's UID
|
||||
* @param replacement the IAllele that the deprecated Allele will be replaced with.
|
||||
*/
|
||||
void registerDeprecatedAlleleReplacement(String deprecatedAlleleUID, IAllele replacement);
|
||||
|
||||
/**
|
||||
* Gets an allele
|
||||
*
|
||||
* @param uid
|
||||
* String based unique identifier of the allele to retrieve.
|
||||
* @param uid String based unique identifier of the allele to retrieve.
|
||||
* @return IAllele if found or a replacement is found in the Deprecated Allele map, null otherwise.
|
||||
*/
|
||||
IAllele getAllele(String uid);
|
||||
@@ -149,20 +147,16 @@ public interface IAlleleRegistry {
|
||||
/**
|
||||
* Registers a classification.
|
||||
*
|
||||
* @param classification
|
||||
* IClassification to register.
|
||||
* @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.
|
||||
* @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 Created {@link IClassification} for easier chaining.
|
||||
*/
|
||||
IClassification createAndRegisterClassification(EnumClassLevel level, String uid, String scientific);
|
||||
@@ -172,8 +166,7 @@ public interface IAlleleRegistry {
|
||||
/**
|
||||
* Gets a classification.
|
||||
*
|
||||
* @param uid
|
||||
* String based unique identifier of the classification to retrieve.
|
||||
* @param uid String based unique identifier of the classification to retrieve.
|
||||
* @return {@link IClassification} if found, null otherwise.
|
||||
*/
|
||||
IClassification getClassification(String uid);
|
||||
@@ -207,8 +200,7 @@ public interface IAlleleRegistry {
|
||||
/**
|
||||
* Registers a new IAlleleHandler
|
||||
*
|
||||
* @param handler
|
||||
* IAlleleHandler to register.
|
||||
* @param handler IAlleleHandler to register.
|
||||
*/
|
||||
void registerAlleleHandler(IAlleleHandler handler);
|
||||
|
||||
@@ -217,8 +209,7 @@ public interface IAlleleRegistry {
|
||||
/**
|
||||
* Blacklist an allele identified by its UID from mutation.
|
||||
*
|
||||
* @param uid
|
||||
* UID of the allele to blacklist.
|
||||
* @param uid UID of the allele to blacklist.
|
||||
*/
|
||||
void blacklistAllele(String uid);
|
||||
|
||||
@@ -228,8 +219,7 @@ public interface IAlleleRegistry {
|
||||
Collection<String> getAlleleBlacklist();
|
||||
|
||||
/**
|
||||
* @param uid
|
||||
* UID of the species to vet.
|
||||
* @param uid UID of the species to vet.
|
||||
* @return true if the allele is blacklisted.
|
||||
*/
|
||||
boolean isBlacklisted(String uid);
|
||||
@@ -238,14 +228,14 @@ public interface IAlleleRegistry {
|
||||
|
||||
/**
|
||||
* @param researcher Username of the player who researched this note.
|
||||
* @param species {@link IAlleleSpecies} to encode on the research note.
|
||||
* @param species {@link IAlleleSpecies} to encode on the research note.
|
||||
* @return An itemstack containing a research note with the given species encoded onto it.
|
||||
*/
|
||||
ItemStack getSpeciesNoteStack(GameProfile researcher, IAlleleSpecies species);
|
||||
|
||||
/**
|
||||
* @param researcher Username of the player who researched this note.
|
||||
* @param mutation {@link IMutation} to encode on the research note.
|
||||
* @param mutation {@link IMutation} to encode on the research note.
|
||||
* @return An itemstack containing a research note with the given mutation encoded onto it.
|
||||
*/
|
||||
ItemStack getMutationNoteStack(GameProfile researcher, IMutation mutation);
|
||||
|
||||
@@ -5,13 +5,11 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Basic species allele.
|
||||
@@ -53,6 +51,7 @@ public interface IAlleleSpecies extends IAllele {
|
||||
/**
|
||||
* Complexity determines the difficulty researching a species. The values of primary and secondary are
|
||||
* added together (and rounded) to determine the amount of pairs needed for successful research.
|
||||
*
|
||||
* @return Values between 3 - 11 are useful.
|
||||
*/
|
||||
int getComplexity();
|
||||
|
||||
@@ -18,10 +18,14 @@ public interface IAlleleSpeciesBuilder {
|
||||
|
||||
IAlleleSpeciesBuilder setHasEffect();
|
||||
|
||||
/** Secret species are not shown in creative mode. */
|
||||
/**
|
||||
* Secret species are not shown in creative mode.
|
||||
*/
|
||||
IAlleleSpeciesBuilder setIsSecret();
|
||||
|
||||
/** Uncounted species do not count toward total species discovered. */
|
||||
/**
|
||||
* Uncounted species do not count toward total species discovered.
|
||||
*/
|
||||
IAlleleSpeciesBuilder setIsNotCounted();
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -7,11 +7,10 @@ package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import forestry.api.apiculture.IBeekeepingMode;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import forestry.api.apiculture.IBeekeepingMode;
|
||||
|
||||
/**
|
||||
* Keeps track of who bred, discovered, and researched which species in a world.
|
||||
*
|
||||
@@ -48,7 +47,7 @@ public interface IBreedingTracker {
|
||||
* @param individual
|
||||
*/
|
||||
void registerPickup(IIndividual individual);
|
||||
|
||||
|
||||
/**
|
||||
* Marks a species as discovered. Should only be called from registerIndividual normally.
|
||||
*
|
||||
@@ -66,8 +65,7 @@ public interface IBreedingTracker {
|
||||
/**
|
||||
* Queries the tracker for discovered species.
|
||||
*
|
||||
* @param mutation
|
||||
* Mutation to query for.
|
||||
* @param mutation Mutation to query for.
|
||||
* @return true if the mutation has been discovered.
|
||||
*/
|
||||
boolean isDiscovered(IMutation mutation);
|
||||
@@ -75,8 +73,7 @@ public interface IBreedingTracker {
|
||||
/**
|
||||
* Queries the tracker for discovered species.
|
||||
*
|
||||
* @param species
|
||||
* Species to check.
|
||||
* @param species Species to check.
|
||||
* @return true if the species has been bred.
|
||||
*/
|
||||
boolean isDiscovered(IAlleleSpecies species);
|
||||
|
||||
@@ -31,7 +31,7 @@ public interface ICheckPollinatable {
|
||||
|
||||
/**
|
||||
* Checks whether this can mate with the given pollen.
|
||||
*
|
||||
* <p>
|
||||
* Must be the one to check genetic equivalency.
|
||||
*
|
||||
* @param pollen IIndividual representing the pollen.
|
||||
|
||||
@@ -9,7 +9,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Biological classifications from domain down to genus.
|
||||
*
|
||||
* <p>
|
||||
* Used by the *alyzers to display hierarchies.
|
||||
*/
|
||||
public interface IClassification {
|
||||
|
||||
@@ -8,25 +8,27 @@ import forestry.api.core.EnumTemperature;
|
||||
public interface IClimateHelper {
|
||||
/**
|
||||
* Determines whether the given temperature and humidity are within the given constraints.
|
||||
*
|
||||
* @param temperature The temperature to test.
|
||||
* @param humidity The humidity to test.
|
||||
* @param baseTemp Base temperature for the test.
|
||||
* @param tolTemp Temperature tolerance to apply.
|
||||
* @param baseHumid Base humidity for the test.
|
||||
* @param tolHumid Humidity tolerance to apply.
|
||||
* @param humidity The humidity to test.
|
||||
* @param baseTemp Base temperature for the test.
|
||||
* @param tolTemp Temperature tolerance to apply.
|
||||
* @param baseHumid Base humidity for the test.
|
||||
* @param tolHumid Humidity tolerance to apply.
|
||||
* @return true if both temperature and humidity fit the given constraints.
|
||||
*/
|
||||
boolean isWithinLimits(EnumTemperature temperature, EnumHumidity humidity,
|
||||
EnumTemperature baseTemp, EnumTolerance tolTemp,
|
||||
EnumHumidity baseHumid, EnumTolerance tolHumid);
|
||||
EnumTemperature baseTemp, EnumTolerance tolTemp,
|
||||
EnumHumidity baseHumid, EnumTolerance tolHumid);
|
||||
|
||||
boolean isWithinLimits(EnumTemperature temperature, EnumTemperature baseTemp, EnumTolerance tolTemp);
|
||||
|
||||
boolean isWithinLimits(EnumHumidity humidity, EnumHumidity baseHumid, EnumTolerance tolHumid);
|
||||
|
||||
|
||||
/**
|
||||
* Gets a collection of humidities which fit the given parameters.
|
||||
* @param prefered Base humidity from which to measure.
|
||||
*
|
||||
* @param prefered Base humidity from which to measure.
|
||||
* @param tolerance Tolerance to apply to the base humidity.
|
||||
* @return A collection of humidities which fall within the given parameters.
|
||||
*/
|
||||
@@ -34,14 +36,16 @@ public interface IClimateHelper {
|
||||
|
||||
/**
|
||||
* Gets a collection of temperatures which fit the given parameters.
|
||||
* @param prefered Base temperature from which to measure.
|
||||
*
|
||||
* @param prefered Base temperature from which to measure.
|
||||
* @param tolerance Tolerance to apply to the base temperatures.
|
||||
* @return A collection of temperatures which fall within the given parameters.
|
||||
*/
|
||||
Collection<EnumTemperature> getToleratedTemperature(EnumTemperature prefered, EnumTolerance tolerance);
|
||||
|
||||
|
||||
/**
|
||||
* Gets a localized, human readable string for the given temperature.
|
||||
*
|
||||
* @param temperature Temperature to generate the string for.
|
||||
* @return A localized, human readable string for the given temperature.
|
||||
*/
|
||||
@@ -49,6 +53,7 @@ public interface IClimateHelper {
|
||||
|
||||
/**
|
||||
* Gets a localized, human readable string for the given humidity.
|
||||
*
|
||||
* @param humidity Humidity to generate the string for.
|
||||
* @return A localized, human readable string for the given humidity.
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.world.World;
|
||||
public interface IFlowerGrowthHelper {
|
||||
/**
|
||||
* Plants a random flower from flowerType at the specified position.
|
||||
*
|
||||
* @return true if successful, false if it could not be planted.
|
||||
*/
|
||||
boolean plantRandomFlower(String flowerType, World world, BlockPos pos);
|
||||
|
||||
@@ -16,6 +16,7 @@ public interface IFlowerGrowthRule {
|
||||
* Checks a position for suitability, and then plants a flower there.
|
||||
* Returns true on success.
|
||||
* For implementers, you can plant a random flower using IFlowerGrowthHelper.plantRandomFlower
|
||||
*
|
||||
* @since Forestry 4.0.8
|
||||
*/
|
||||
boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos);
|
||||
|
||||
@@ -29,6 +29,7 @@ public interface IFlowerProvider {
|
||||
/**
|
||||
* Allows the flower provider to affect the produce at the given location.
|
||||
* If this flowerProvider does not affect the products, it should return the products unchanged.
|
||||
*
|
||||
* @return Array of itemstacks being the (modified or unmodified) produce.
|
||||
*/
|
||||
List<ItemStack> affectProducts(World world, IIndividual individual, BlockPos pos, List<ItemStack> products);
|
||||
|
||||
@@ -28,8 +28,7 @@ public interface IFruitBearer {
|
||||
/**
|
||||
* Picks the fruits of this tile, resetting it to unripe fruits.
|
||||
*
|
||||
* @param tool
|
||||
* Tool used in picking the fruits. May be empty.
|
||||
* @param tool Tool used in picking the fruits. May be empty.
|
||||
* @return Picked fruits.
|
||||
*/
|
||||
NonNullList<ItemStack> pickFruit(ItemStack tool);
|
||||
@@ -42,8 +41,7 @@ public interface IFruitBearer {
|
||||
/**
|
||||
* Increases the ripeness of the fruit. Adding 1.0f will fully ripen the fruit.
|
||||
*
|
||||
* @param add
|
||||
* Float to add to the ripeness. Will truncate to valid values.
|
||||
* @param add Float to add to the ripeness. Will truncate to valid values.
|
||||
*/
|
||||
void addRipeness(float add);
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import forestry.api.core.INbtWritable;
|
||||
|
||||
/**
|
||||
* An actual individual with genetic information.
|
||||
*
|
||||
* <p>
|
||||
* Only the default implementation is supported.
|
||||
*/
|
||||
public interface IIndividual extends INbtWritable {
|
||||
@@ -23,7 +23,8 @@ public interface IIndividual extends INbtWritable {
|
||||
void addTooltip(List<String> list);
|
||||
|
||||
/**
|
||||
* Call to mark the IIndividual as analyzed.
|
||||
* Call to mark the IIndividual as analyzed.
|
||||
*
|
||||
* @return true if the IIndividual has not been analyzed previously.
|
||||
*/
|
||||
boolean analyze();
|
||||
@@ -38,6 +39,7 @@ public interface IIndividual extends INbtWritable {
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@@ -34,6 +34,7 @@ public interface IIndividualLiving extends IIndividual {
|
||||
|
||||
/**
|
||||
* Age the individual.
|
||||
*
|
||||
* @param world
|
||||
* @param ageModifier
|
||||
*/
|
||||
@@ -41,6 +42,7 @@ public interface IIndividualLiving extends IIndividual {
|
||||
|
||||
/**
|
||||
* Mate with the given individual.
|
||||
*
|
||||
* @param individual the {@link IIndividual} to mate this one with.
|
||||
*/
|
||||
void mate(IIndividual individual);
|
||||
|
||||
@@ -2,9 +2,8 @@ package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
/**
|
||||
* Translates blockStates for a single plain leaf block into genetic data.
|
||||
|
||||
Loaded 100 of 672 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user