Search in sources :

Example 1 with FilterData

use of forestry.sorting.FilterData in project ForestryMC by ForestryMC.

the class TileGeneticFilter method getValidDirections.

public Collection<EnumFacing> getValidDirections(ItemStack itemStack, EnumFacing from) {
    ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(itemStack);
    IIndividual individual = null;
    ISpeciesType type = null;
    if (root != null) {
        individual = root.getMember(itemStack);
        type = root.getType(itemStack);
    }
    IFilterData filterData = new FilterData(root, individual, type);
    List<EnumFacing> validFacings = new LinkedList<>();
    for (EnumFacing facing : EnumFacing.VALUES) {
        if (facing == from) {
            continue;
        }
        if (isValidFacing(facing, itemStack, filterData)) {
            validFacings.add(facing);
        }
    }
    return validFacings;
}
Also used : ISpeciesRoot(forestry.api.genetics.ISpeciesRoot) IIndividual(forestry.api.genetics.IIndividual) IFilterData(forestry.api.genetics.IFilterData) ISpeciesType(forestry.api.genetics.ISpeciesType) EnumFacing(net.minecraft.util.EnumFacing) IFilterData(forestry.api.genetics.IFilterData) FilterData(forestry.sorting.FilterData) LinkedList(java.util.LinkedList)

Aggregations

IFilterData (forestry.api.genetics.IFilterData)1 IIndividual (forestry.api.genetics.IIndividual)1 ISpeciesRoot (forestry.api.genetics.ISpeciesRoot)1 ISpeciesType (forestry.api.genetics.ISpeciesType)1 FilterData (forestry.sorting.FilterData)1 LinkedList (java.util.LinkedList)1 EnumFacing (net.minecraft.util.EnumFacing)1