public class AlleleRegistry extends java.lang.Object implements IAlleleRegistry
| Constructor and Description |
|---|
AlleleRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
addValidAlleleTypes(IAllele allele,
IChromosomeType... chromosomeTypes)
Add more valid chromosome types for an allele.
|
void |
blacklistAllele(java.lang.String uid)
Blacklist an allele identified by its UID from mutation.
|
IClassification |
createAndRegisterClassification(IClassification.EnumClassLevel level,
java.lang.String uid,
java.lang.String scientific)
Creates and returns a classification.
|
IClassification |
createAndRegisterClassification(IClassification.EnumClassLevel level,
java.lang.String uid,
java.lang.String scientific,
IClassification... members) |
IAllele |
getAllele(java.lang.String uid)
Gets an allele
|
java.util.Collection<java.lang.String> |
getAlleleBlacklist() |
java.util.Collection<IChromosomeType> |
getChromosomeTypes(IAllele allele) |
IClassification |
getClassification(java.lang.String uid)
Gets a classification.
|
java.util.Map<java.lang.String,IAllele> |
getDeprecatedAlleleReplacements() |
IFruitFamily |
getFruitFamily(java.lang.String uid)
Retrieves a fruit family identified by uid.
|
IIndividual |
getIndividual(net.minecraft.item.ItemStack stack)
Retrieve genetic information from an itemstack.
|
net.minecraft.item.ItemStack |
getMutationNoteStack(com.mojang.authlib.GameProfile researcher,
IMutation mutation) |
java.util.Map<java.lang.String,IAllele> |
getRegisteredAlleles() |
java.util.Collection<IAllele> |
getRegisteredAlleles(IChromosomeType type) |
java.util.Map<java.lang.String,IClassification> |
getRegisteredClassifications() |
java.util.Map<java.lang.String,IFruitFamily> |
getRegisteredFruitFamilies()
Get all registered fruit families.
|
net.minecraft.item.ItemStack |
getSpeciesNoteStack(com.mojang.authlib.GameProfile researcher,
IAlleleSpecies species) |
java.util.Map<java.lang.String,ISpeciesRoot> |
getSpeciesRoot() |
ISpeciesRoot |
getSpeciesRoot(java.lang.Class<? extends IIndividual> individualClass)
Retrieve a matching
ISpeciesRoot for the given IIndividual-class. |
ISpeciesRoot |
getSpeciesRoot(IIndividual individual)
Retrieve a matching
ISpeciesRoot for the given IIndividual |
ISpeciesRoot |
getSpeciesRoot(net.minecraft.item.ItemStack stack)
Retrieve a matching
ISpeciesRoot for the given itemstack. |
ISpeciesRoot |
getSpeciesRoot(java.lang.String uid)
Retrieve the
ISpeciesRoot with the given uid. |
void |
initialize() |
boolean |
isBlacklisted(java.lang.String uid) |
boolean |
isIndividual(net.minecraft.item.ItemStack stack)
Tests the itemstack for genetic information.
|
void |
registerAllele(IAllele allele,
IChromosomeType... chromosomeTypes)
Registers an allele.
|
void |
registerAlleleHandler(IAlleleHandler handler)
Registers a new IAlleleHandler
|
void |
registerClassification(IClassification branch)
Registers a classification.
|
void |
registerDeprecatedAlleleReplacement(java.lang.String deprecatedUID,
IAllele replacementAllele)
Registers an old allele UID and the new IAllele to replace instances of it with.
|
void |
registerFruitFamily(IFruitFamily family)
Registers a new fruit family.
|
void |
registerSpeciesRoot(ISpeciesRoot root)
Register a
ISpeciesRoot. |
public void registerSpeciesRoot(ISpeciesRoot root)
IAlleleRegistryISpeciesRoot.registerSpeciesRoot in interface IAlleleRegistryroot - ISpeciesRoot to register.public java.util.Map<java.lang.String,ISpeciesRoot> getSpeciesRoot()
getSpeciesRoot in interface IAlleleRegistryISpeciesRoot.@Nullable public ISpeciesRoot getSpeciesRoot(java.lang.String uid)
IAlleleRegistryISpeciesRoot with the given uid.getSpeciesRoot in interface IAlleleRegistryuid - Unique id for the species class, i.e. "rootBees", "rootTrees", "rootButterflies".ISpeciesRoot if it exists, null otherwise.@Nullable public ISpeciesRoot getSpeciesRoot(net.minecraft.item.ItemStack stack)
IAlleleRegistryISpeciesRoot for the given itemstack.getSpeciesRoot in interface IAlleleRegistrystack - An itemstack possibly containing NBT data which can be converted by a species root.ISpeciesRoot if found, null otherwise.@Nullable public ISpeciesRoot getSpeciesRoot(java.lang.Class<? extends IIndividual> individualClass)
IAlleleRegistryISpeciesRoot for the given IIndividual-class.getSpeciesRoot in interface IAlleleRegistryindividualClass - Class extending IIndividual.ISpeciesRoot if found, null otherwise.public ISpeciesRoot getSpeciesRoot(IIndividual individual)
IAlleleRegistryISpeciesRoot for the given IIndividualgetSpeciesRoot in interface IAlleleRegistrypublic boolean isIndividual(net.minecraft.item.ItemStack stack)
IAlleleRegistryisIndividual in interface IAlleleRegistry@Nullable public IIndividual getIndividual(net.minecraft.item.ItemStack stack)
IAlleleRegistrygetIndividual in interface IAlleleRegistrystack - Stack to retrieve genetic information for.public void initialize()
public java.util.Map<java.lang.String,IAllele> getRegisteredAlleles()
getRegisteredAlleles in interface IAlleleRegistrypublic java.util.Map<java.lang.String,IAllele> getDeprecatedAlleleReplacements()
getDeprecatedAlleleReplacements in interface IAlleleRegistrypublic void registerAllele(IAllele allele, IChromosomeType... chromosomeTypes)
IAlleleRegistryNOTE: Where possible, it is recommended to use IAlleleFactory instead because it has built-in advanced localization support.
registerAllele in interface IAlleleRegistryallele - IAllele to register.chromosomeTypes - valid chromosomeTypes for this allele.public void addValidAlleleTypes(IAllele allele, IChromosomeType... chromosomeTypes)
IAlleleRegistryaddValidAlleleTypes in interface IAlleleRegistrypublic void registerDeprecatedAlleleReplacement(java.lang.String deprecatedUID,
IAllele replacementAllele)
IAlleleRegistryregisterDeprecatedAlleleReplacement in interface IAlleleRegistrydeprecatedUID - the old allele's UIDreplacementAllele - the IAllele that the deprecated Allele will be replaced with.@Nullable public IAllele getAllele(java.lang.String uid)
IAlleleRegistrygetAllele in interface IAlleleRegistryuid - String based unique identifier of the allele to retrieve.public java.util.Collection<IAllele> getRegisteredAlleles(IChromosomeType type)
getRegisteredAlleles in interface IAlleleRegistrypublic java.util.Collection<IChromosomeType> getChromosomeTypes(IAllele allele)
getChromosomeTypes in interface IAlleleRegistrypublic void registerClassification(IClassification branch)
IAlleleRegistryregisterClassification in interface IAlleleRegistrybranch - IClassification to register.public java.util.Map<java.lang.String,IClassification> getRegisteredClassifications()
getRegisteredClassifications in interface IAlleleRegistrypublic IClassification createAndRegisterClassification(IClassification.EnumClassLevel level, java.lang.String uid, java.lang.String scientific)
IAlleleRegistrycreateAndRegisterClassification in interface IAlleleRegistrylevel - EnumClassLevel of the classification to create.uid - String based unique identifier. Implementation will throw an exception if the key is already taken.scientific - Binomial for the given classification.IClassification for easier chaining.public IClassification createAndRegisterClassification(IClassification.EnumClassLevel level, java.lang.String uid, java.lang.String scientific, IClassification... members)
createAndRegisterClassification in interface IAlleleRegistrypublic IClassification getClassification(java.lang.String uid)
IAlleleRegistrygetClassification in interface IAlleleRegistryuid - String based unique identifier of the classification to retrieve.IClassification if found, null otherwise.public void registerFruitFamily(IFruitFamily family)
IAlleleRegistryregisterFruitFamily in interface IAlleleRegistrypublic java.util.Map<java.lang.String,IFruitFamily> getRegisteredFruitFamilies()
IAlleleRegistrygetRegisteredFruitFamilies in interface IAlleleRegistrypublic IFruitFamily getFruitFamily(java.lang.String uid)
IAlleleRegistrygetFruitFamily in interface IAlleleRegistrypublic void registerAlleleHandler(IAlleleHandler handler)
IAlleleRegistryregisterAlleleHandler in interface IAlleleRegistryhandler - IAlleleHandler to register.public void blacklistAllele(java.lang.String uid)
IAlleleRegistryblacklistAllele in interface IAlleleRegistryuid - UID of the allele to blacklist.public java.util.Collection<java.lang.String> getAlleleBlacklist()
getAlleleBlacklist in interface IAlleleRegistrypublic boolean isBlacklisted(java.lang.String uid)
isBlacklisted in interface IAlleleRegistryuid - UID of the species to vet.public net.minecraft.item.ItemStack getSpeciesNoteStack(com.mojang.authlib.GameProfile researcher,
IAlleleSpecies species)
getSpeciesNoteStack in interface IAlleleRegistryresearcher - Username of the player who researched this note.species - IAlleleSpecies to encode on the research note.public net.minecraft.item.ItemStack getMutationNoteStack(com.mojang.authlib.GameProfile researcher,
IMutation mutation)
getMutationNoteStack in interface IAlleleRegistryresearcher - Username of the player who researched this note.mutation - IMutation to encode on the research note.