mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 12:59:44 +00:00
Update for 1.11. Missing assets, unstable.
This commit is contained in:
1 parent
30d7365518
commit
9611ae08ae
1145 files changed
+15561
-18107
No files matched your search
@@ -23,12 +23,12 @@ public class AlleleManager {
|
||||
/**
|
||||
* Translates plain leaf blocks into genetic data. Used by bees and butterflies to convert and pollinate foreign leaf blocks.
|
||||
*/
|
||||
public static Map<Block, ILeafTranslator> leafTranslators = new HashMap<>();
|
||||
public static final Map<Block, ILeafTranslator> leafTranslators = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Translates plain saplings into genetic data. Used by the treealyzer and the farm to convert foreign saplings.
|
||||
*/
|
||||
public static Map<Item, ISaplingTranslator> saplingTranslation = new HashMap<>();
|
||||
public static final Map<Item, ISaplingTranslator> saplingTranslation = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Queryable instance of an {@link IClimateHelper} for easier implementation.
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Basic effect allele.
|
||||
*/
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
public interface IAllelePlantType extends IAllele {
|
||||
|
||||
EnumSet<EnumPlantType> getPlantTypes();
|
||||
|
||||
}
|
||||
@@ -1,13 +1,11 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public interface IAlleleProperty<A extends IAlleleProperty<A>> extends IAllele, Comparable<A> {
|
||||
|
||||
/**
|
||||
* To compare the allele for the properties
|
||||
*/
|
||||
@Override
|
||||
int compareTo(@Nonnull A o);
|
||||
int compareTo(A o);
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -39,6 +40,7 @@ public interface IAlleleRegistry {
|
||||
* @param uid Unique id for the species class, i.e. "rootBees", "rootTrees", "rootButterflies".
|
||||
* @return {@link ISpeciesRoot} if it exists, null otherwise.
|
||||
*/
|
||||
@Nullable
|
||||
ISpeciesRoot getSpeciesRoot(String uid);
|
||||
|
||||
/**
|
||||
@@ -46,6 +48,7 @@ public interface IAlleleRegistry {
|
||||
* @param stack An itemstack possibly containing NBT data which can be converted by a species root.
|
||||
* @return {@link ISpeciesRoot} if found, null otherwise.
|
||||
*/
|
||||
@Nullable
|
||||
ISpeciesRoot getSpeciesRoot(ItemStack stack);
|
||||
|
||||
/**
|
||||
@@ -53,8 +56,14 @@ public interface IAlleleRegistry {
|
||||
* @param clz Class extending {@link IIndividual}.
|
||||
* @return {@link ISpeciesRoot} if found, null otherwise.
|
||||
*/
|
||||
@Nullable
|
||||
ISpeciesRoot getSpeciesRoot(Class<? extends IIndividual> clz);
|
||||
|
||||
/**
|
||||
* Retrieve a matching {@link ISpeciesRoot} for the given {@link IIndividual}
|
||||
*/
|
||||
ISpeciesRoot getSpeciesRoot(IIndividual individual);
|
||||
|
||||
/* INDIVIDUAL */
|
||||
|
||||
/**
|
||||
@@ -72,6 +81,7 @@ public interface IAlleleRegistry {
|
||||
* Stack to retrieve genetic information for.
|
||||
* @return IIndividual containing genetic information, null if none could be extracted.
|
||||
*/
|
||||
@Nullable
|
||||
IIndividual getIndividual(ItemStack stack);
|
||||
|
||||
/* ALLELES */
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -20,6 +22,7 @@ public interface IBreedingTracker {
|
||||
/**
|
||||
* @return Name of the current {@link IBeekeepingMode}.
|
||||
*/
|
||||
@Nullable
|
||||
String getModeName();
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Biological classifications from domain down to genus.
|
||||
*
|
||||
@@ -62,12 +64,12 @@ public interface IClassification {
|
||||
/**
|
||||
* A branch approximates a "genus" in real life. Real life examples: "Micrapis", "Megapis"
|
||||
*
|
||||
* @return flavour text (may be null)
|
||||
* @return flavour text
|
||||
*/
|
||||
String getScientific();
|
||||
|
||||
/**
|
||||
* @return Localized description of this branch. (May be null.)
|
||||
* @return Localized description of this branch.
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
@@ -96,12 +98,11 @@ public interface IClassification {
|
||||
/**
|
||||
* @return Parent classification, null if this is root.
|
||||
*/
|
||||
@Nullable
|
||||
IClassification getParent();
|
||||
|
||||
/**
|
||||
* Only used internally by the AlleleRegistry if this classification has been added to another one.
|
||||
*
|
||||
* @param parent
|
||||
*/
|
||||
void setParent(IClassification parent);
|
||||
}
|
||||
@@ -16,13 +16,9 @@ import forestry.api.core.INbtWritable;
|
||||
public interface IEffectData extends INbtWritable, INbtReadable {
|
||||
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);
|
||||
}
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -29,5 +31,5 @@ public interface IFlowerProvider {
|
||||
* If this flowerProvider does not affect the products, it should return the products unchanged.
|
||||
* @return Array of itemstacks being the (modified or unmodified) produce.
|
||||
*/
|
||||
ItemStack[] affectProducts(World world, IIndividual individual, BlockPos pos, ItemStack[] products);
|
||||
List<ItemStack> affectProducts(World world, IIndividual individual, BlockPos pos, List<ItemStack> products);
|
||||
}
|
||||
@@ -5,17 +5,15 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
|
||||
// See {@link forestry.api.apiculture.FlowerManager}.FlowerType___ for basic Forestry flower types.
|
||||
// Each IFlowerProvider has one flower type, and multiple IFlowerProviders may share one type.
|
||||
// "Acceptable flowers" allow nearby bees to do work.
|
||||
@@ -43,6 +41,7 @@ public interface IFlowerRegistry {
|
||||
* Registers custom logic for accepted flowers.
|
||||
* These rules are inefficient compared to ones made with registerAcceptableFlower, but may be necessary for tile entity flowers.
|
||||
* The flower types built into Forestry can not be used here.
|
||||
*
|
||||
* @since Forestry 4.0.8
|
||||
*/
|
||||
void registerAcceptableFlowerRule(IFlowerAcceptableRule flowerAcceptableRule, String... flowerTypes);
|
||||
@@ -51,7 +50,7 @@ public interface IFlowerRegistry {
|
||||
* Registers a plantable flower.
|
||||
* The distribution is based on its own weight and the total number of plants for this flowerType.
|
||||
*
|
||||
* @param weight Weight for the Flower (Vanilla = 1.0, Modded flowers < 1.0)
|
||||
* @param weight Weight for the Flower (Vanilla = 1.0, Modded flowers < 1.0)
|
||||
* @param flowerTypes See {@link forestry.api.apiculture.FlowerManager}.FlowerTypeXXX
|
||||
*/
|
||||
void registerPlantableFlower(IBlockState blockState, double weight, String... flowerTypes);
|
||||
@@ -63,12 +62,11 @@ public interface IFlowerRegistry {
|
||||
|
||||
/**
|
||||
* @param beeHousing The bee housing that will help determine the size of the area to check.
|
||||
* @param bee The bee that will help determine the size of the area to check.
|
||||
* @param bee The bee that will help determine the size of the area to check.
|
||||
* @param flowerType See {@link forestry.api.apiculture.FlowerManager}.FlowerTypeXXX
|
||||
* @param maxFlowers the largest number of flowers to check for before returning. Use 1 if you only need 1.
|
||||
* @return the coordinates of nearby accepted flowers, with size from 0 to maxFlowers.
|
||||
*/
|
||||
@Nonnull
|
||||
List<BlockPos> getAcceptedFlowerCoordinates(IBeeHousing beeHousing, IBee bee, String flowerType, int maxFlowers);
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
/**
|
||||
* Can be implemented by tile entities which can bear fruit.
|
||||
@@ -30,10 +29,10 @@ public interface IFruitBearer {
|
||||
* Picks the fruits of this tile, resetting it to unripe fruits.
|
||||
*
|
||||
* @param tool
|
||||
* Tool used in picking the fruits. May be null.
|
||||
* Tool used in picking the fruits. May be empty.
|
||||
* @return Picked fruits.
|
||||
*/
|
||||
Collection<ItemStack> pickFruit(ItemStack tool);
|
||||
NonNullList<ItemStack> pickFruit(ItemStack tool);
|
||||
|
||||
/**
|
||||
* @return float indicating the ripeness of the fruit with >= 1.0f indicating full ripeness.
|
||||
|
||||
@@ -5,34 +5,26 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import forestry.api.core.INbtWritable;
|
||||
|
||||
/**
|
||||
* Holds the {@link IChromosome}s which comprise the traits of a given individual.
|
||||
*
|
||||
* <p>
|
||||
* Only the default implementation is supported.
|
||||
*/
|
||||
public interface IGenome extends INbtWritable {
|
||||
|
||||
@Nonnull
|
||||
IAlleleSpecies getPrimary();
|
||||
|
||||
@Nonnull
|
||||
IAlleleSpecies getSecondary();
|
||||
|
||||
@Nonnull
|
||||
IChromosome[] getChromosomes();
|
||||
|
||||
@Nonnull
|
||||
IAllele getActiveAllele(IChromosomeType chromosomeType);
|
||||
|
||||
@Nonnull
|
||||
IAllele getInactiveAllele(IChromosomeType chromosomeType);
|
||||
|
||||
boolean isGeneticEqual(IGenome other);
|
||||
|
||||
@Nonnull
|
||||
ISpeciesRoot getSpeciesRoot();
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.core.INbtWritable;
|
||||
@@ -35,7 +34,6 @@ public interface IIndividual extends INbtWritable {
|
||||
|
||||
boolean isSecret();
|
||||
|
||||
@Nonnull
|
||||
IGenome getGenome();
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IIndividualLiving extends IIndividual {
|
||||
@@ -12,6 +14,7 @@ public interface IIndividualLiving extends IIndividual {
|
||||
/**
|
||||
* @return Genetic information of the mate, null if unmated.
|
||||
*/
|
||||
@Nullable
|
||||
IGenome getMate();
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -39,6 +38,7 @@ public interface ISpeciesRoot {
|
||||
|
||||
/**
|
||||
* Used to check whether a given itemstack contains genetic data corresponding to an {@link IIndividual} of this class.
|
||||
*
|
||||
* @param stack itemstack to check.
|
||||
* @return true if the itemstack contains an {@link IIndividual} of this class, false otherwise.
|
||||
*/
|
||||
@@ -46,14 +46,16 @@ public interface ISpeciesRoot {
|
||||
|
||||
/**
|
||||
* Used to check whether a given itemstack contains genetic data corresponding to an {@link IIndividual} of this class and matches the given type.
|
||||
*
|
||||
* @param stack itemstack to check.
|
||||
* @param type Integer denoting the type needed to match. (i.e. butterfly vs. butterfly serum; bee queens, princesses, drones; etc.)
|
||||
* @param type Integer denoting the type needed to match. (i.e. butterfly vs. butterfly serum; bee queens, princesses, drones; etc.)
|
||||
* @return true if the itemstack contains an {@link IIndividual} of this class, false otherwise.
|
||||
*/
|
||||
boolean isMember(ItemStack stack, ISpeciesType type);
|
||||
|
||||
/**
|
||||
* Used to check whether the given {@link IIndividual} is member of this class.
|
||||
*
|
||||
* @param individual {@link IIndividual} to check.
|
||||
* @return true if the individual is member of this class, false otherwise.
|
||||
*/
|
||||
@@ -66,13 +68,15 @@ public interface ISpeciesRoot {
|
||||
@Nullable
|
||||
ISpeciesType getType(ItemStack itemStack);
|
||||
|
||||
/** Species type used to represent this species in icons */
|
||||
/**
|
||||
* Species type used to represent this species in icons
|
||||
*/
|
||||
ISpeciesType getIconType();
|
||||
|
||||
ItemStack getMemberStack(IIndividual individual, ISpeciesType type);
|
||||
|
||||
/* BREEDING TRACKER */
|
||||
IBreedingTracker getBreedingTracker(World world, GameProfile player);
|
||||
IBreedingTracker getBreedingTracker(World world, @Nullable GameProfile player);
|
||||
|
||||
/* GENOME MANIPULATION */
|
||||
IIndividual templateAsIndividual(IAllele[] template);
|
||||
@@ -109,6 +113,7 @@ public interface ISpeciesRoot {
|
||||
* @param identifier species UID
|
||||
* @return Array of {@link IAllele} representing a genome.
|
||||
*/
|
||||
@Nullable
|
||||
IAllele[] getTemplate(String identifier);
|
||||
|
||||
/**
|
||||
@@ -124,7 +129,7 @@ public interface ISpeciesRoot {
|
||||
|
||||
Map<String, IAllele[]> getGenomeTemplates();
|
||||
|
||||
ArrayList<? extends IIndividual> getIndividualTemplates();
|
||||
List<? extends IIndividual> getIndividualTemplates();
|
||||
|
||||
/* MUTATIONS */
|
||||
|
||||
@@ -147,8 +152,8 @@ public interface ISpeciesRoot {
|
||||
List<? extends IMutation> getCombinations(IAllele other);
|
||||
|
||||
/**
|
||||
* @since Forestry 3.7
|
||||
* @return all possible mutations that result from breeding two species
|
||||
* @since Forestry 3.7
|
||||
*/
|
||||
List<IMutation> getCombinations(IAlleleSpecies parentSpecies0, IAlleleSpecies parentSpecies1, boolean shuffle);
|
||||
|
||||
@@ -163,7 +168,8 @@ public interface ISpeciesRoot {
|
||||
|
||||
/**
|
||||
* Sets an item stack as a valid (generic) research catalyst for this class.
|
||||
* @param itemstack ItemStack to set as suitable.
|
||||
*
|
||||
* @param itemstack ItemStack to set as suitable.
|
||||
* @param suitability Float between 0 and 1 to indicate suitability.
|
||||
*/
|
||||
void setResearchSuitability(ItemStack itemstack, float suitability);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -12,7 +14,8 @@ import net.minecraft.world.World;
|
||||
public interface ISpeciesRootPollinatable extends ISpeciesRoot {
|
||||
|
||||
ICheckPollinatable createPollinatable(IIndividual individual);
|
||||
|
||||
IPollinatable tryConvertToPollinatable(GameProfile owner, World world, final BlockPos pos, final IIndividual pollen);
|
||||
|
||||
@Nullable
|
||||
IPollinatable tryConvertToPollinatable(@Nullable GameProfile owner, World world, final BlockPos pos, final IIndividual pollen);
|
||||
|
||||
}
|
||||
@@ -3,7 +3,12 @@
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "4.7.1", owner = "ForestryAPI|core", provides = "ForestryAPI|genetics")
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
Reference in new issue
Block a user