use of mezz.jei.api.helpers.IModIdHelper in project minecolonies by Minecolonies.
the class JEIPlugin method registerCategories.
@Override
public void registerCategories(@NotNull final IRecipeCategoryRegistration registration) {
final IJeiHelpers jeiHelpers = registration.getJeiHelpers();
final IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
final IModIdHelper modIdHelper = jeiHelpers.getModIdHelper();
registration.addRecipeCategories(new CompostRecipeCategory(guiHelper));
registration.addRecipeCategories(new FishermanRecipeCategory(guiHelper));
categories.clear();
for (final BuildingEntry building : IMinecoloniesAPI.getInstance().getBuildingRegistry()) {
for (final Supplier<IBuildingModule> producer : building.getModuleProducers()) {
final IBuildingModule module = producer.get();
if (module instanceof ICraftingBuildingModule) {
final ICraftingBuildingModule crafting = (ICraftingBuildingModule) module;
final IJob<?> job = crafting.getCraftingJob();
if (job != null) {
registerCategory(registration, new GenericRecipeCategory(building, job, crafting, guiHelper, modIdHelper));
}
}
if (module instanceof AnimalHerdingModule) {
final AnimalHerdingModule herding = (AnimalHerdingModule) module;
registerCategory(registration, new HerderRecipeCategory(building, herding.getHerdingJob(), herding, guiHelper));
}
}
}
}
Aggregations