Search in sources :

Example 1 with ISubtypeRegistry

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);
}
Also used : JEIPlugin(mezz.jei.api.JEIPlugin) IModRegistry(mezz.jei.api.IModRegistry) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) JeiUtil(forestry.core.utils.JeiUtil) ForestryModuleUids(forestry.modules.ForestryModuleUids) BeeManager(forestry.api.apiculture.BeeManager) ISubtypeRegistry(mezz.jei.api.ISubtypeRegistry) IModPlugin(mezz.jei.api.IModPlugin) ForestryAPI(forestry.api.core.ForestryAPI) Constants(forestry.core.config.Constants) ItemRegistryApiculture(forestry.apiculture.items.ItemRegistryApiculture) ResourceLocation(net.minecraft.util.ResourceLocation) Preconditions(com.google.common.base.Preconditions) Genome(forestry.core.genetics.Genome) ModuleApiculture(forestry.apiculture.ModuleApiculture) ResourceLocation(net.minecraft.util.ResourceLocation) ItemRegistryApiculture(forestry.apiculture.items.ItemRegistryApiculture) IAlleleSpecies(forestry.api.genetics.IAlleleSpecies) ISubtypeRegistry(mezz.jei.api.ISubtypeRegistry)

Aggregations

Preconditions (com.google.common.base.Preconditions)1 BeeManager (forestry.api.apiculture.BeeManager)1 ForestryAPI (forestry.api.core.ForestryAPI)1 IAlleleSpecies (forestry.api.genetics.IAlleleSpecies)1 ModuleApiculture (forestry.apiculture.ModuleApiculture)1 ItemRegistryApiculture (forestry.apiculture.items.ItemRegistryApiculture)1 Constants (forestry.core.config.Constants)1 Genome (forestry.core.genetics.Genome)1 JeiUtil (forestry.core.utils.JeiUtil)1 ForestryModuleUids (forestry.modules.ForestryModuleUids)1 IModPlugin (mezz.jei.api.IModPlugin)1 IModRegistry (mezz.jei.api.IModRegistry)1 ISubtypeRegistry (mezz.jei.api.ISubtypeRegistry)1 JEIPlugin (mezz.jei.api.JEIPlugin)1 ResourceLocation (net.minecraft.util.ResourceLocation)1