use of mezz.jei.api.ISubtypeRegistry in project ForestryMC by ForestryMC.
the class ApicultureJeiPlugin method registerItemSubtypes.
@Override
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
if (!ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.APICULTURE))) {
return;
}
ItemRegistryApiculture items = ModuleApiculture.getItems();
Preconditions.checkNotNull(items);
ISubtypeRegistry.ISubtypeInterpreter beeSubtypeInterpreter = itemStack -> {
IAlleleSpecies species = Genome.getSpeciesDirectly(BeeManager.beeRoot, itemStack);
return species == null ? ISubtypeRegistry.ISubtypeInterpreter.NONE : species.getUID();
};
subtypeRegistry.registerSubtypeInterpreter(items.beeDroneGE, beeSubtypeInterpreter);
subtypeRegistry.registerSubtypeInterpreter(items.beePrincessGE, beeSubtypeInterpreter);
subtypeRegistry.registerSubtypeInterpreter(items.beeQueenGE, beeSubtypeInterpreter);
}
Aggregations