use of forestry.api.core.ForestryEvent in project ForestryMC by ForestryMC.
the class BreedingTracker method registerSpecies.
@Override
public void registerSpecies(IAlleleSpecies species) {
if (!discoveredSpecies.contains(species.getUID())) {
discoveredSpecies.add(species.getUID());
ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot(speciesRootUID());
ForestryEvent event = new ForestryEvent.SpeciesDiscovered(speciesRoot, username, species, this);
MinecraftForge.EVENT_BUS.post(event);
syncToPlayer(Collections.singleton(species.getUID()), emptyStringCollection, emptyStringCollection);
}
}
use of forestry.api.core.ForestryEvent in project ForestryMC by ForestryMC.
the class BreedingTracker method registerMutation.
@Override
public void registerMutation(IMutation mutation) {
String mutationString = getMutationString(mutation);
if (!discoveredMutations.contains(mutationString)) {
discoveredMutations.add(mutationString);
markDirty();
ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot(speciesRootUID());
ForestryEvent event = new ForestryEvent.MutationDiscovered(speciesRoot, username, mutation, this);
MinecraftForge.EVENT_BUS.post(event);
syncToPlayer(emptyStringCollection, Collections.singleton(mutationString), emptyStringCollection);
}
}
Aggregations