Search in sources :

Example 1 with ISubtypeInterpreter

use of mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter in project SophisticatedBackpacks by P3pp3rF1y.

the class SBPPlugin method registerItemSubtypes.

@Override
public void registerItemSubtypes(ISubtypeRegistration registration) {
    ISubtypeInterpreter backpackNbtInterpreter = itemStack -> itemStack.getCapability(CapabilityBackpackWrapper.getCapabilityInstance()).map(wrapper -> "{clothColor:" + wrapper.getClothColor() + ",borderColor:" + wrapper.getBorderColor() + "}").orElse("");
    registration.registerSubtypeInterpreter(ModItems.BACKPACK.get(), backpackNbtInterpreter);
    registration.registerSubtypeInterpreter(ModItems.IRON_BACKPACK.get(), backpackNbtInterpreter);
    registration.registerSubtypeInterpreter(ModItems.GOLD_BACKPACK.get(), backpackNbtInterpreter);
    registration.registerSubtypeInterpreter(ModItems.DIAMOND_BACKPACK.get(), backpackNbtInterpreter);
    registration.registerSubtypeInterpreter(ModItems.NETHERITE_BACKPACK.get(), backpackNbtInterpreter);
}
Also used : IRecipeCatalystRegistration(mezz.jei.api.registration.IRecipeCatalystRegistration) SophisticatedBackpacks(net.p3pp3rf1y.sophisticatedbackpacks.SophisticatedBackpacks) IStackHelper(mezz.jei.api.helpers.IStackHelper) BackpackScreen(net.p3pp3rf1y.sophisticatedbackpacks.client.gui.BackpackScreen) ArrayList(java.util.ArrayList) IModPlugin(mezz.jei.api.IModPlugin) ItemStack(net.minecraft.item.ItemStack) JeiPlugin(mezz.jei.api.JeiPlugin) IGhostIngredientHandler(mezz.jei.api.gui.handlers.IGhostIngredientHandler) IRecipeTransferRegistration(mezz.jei.api.registration.IRecipeTransferRegistration) IRecipeRegistration(mezz.jei.api.registration.IRecipeRegistration) IRecipeTransferHandlerHelper(mezz.jei.api.recipe.transfer.IRecipeTransferHandlerHelper) SettingsScreen(net.p3pp3rf1y.sophisticatedbackpacks.client.gui.SettingsScreen) PacketHandler(net.p3pp3rf1y.sophisticatedbackpacks.network.PacketHandler) BackpackContainer(net.p3pp3rf1y.sophisticatedbackpacks.common.gui.BackpackContainer) VanillaRecipeCategoryUid(mezz.jei.api.constants.VanillaRecipeCategoryUid) Rectangle2d(net.minecraft.client.renderer.Rectangle2d) CapabilityBackpackWrapper(net.p3pp3rf1y.sophisticatedbackpacks.api.CapabilityBackpackWrapper) IGuiHandlerRegistration(mezz.jei.api.registration.IGuiHandlerRegistration) IGuiContainerHandler(mezz.jei.api.gui.handlers.IGuiContainerHandler) ModItems(net.p3pp3rf1y.sophisticatedbackpacks.init.ModItems) ISubtypeInterpreter(mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter) List(java.util.List) IFilterSlot(net.p3pp3rf1y.sophisticatedbackpacks.common.gui.IFilterSlot) ISubtypeRegistration(mezz.jei.api.registration.ISubtypeRegistration) ResourceLocation(net.minecraft.util.ResourceLocation) ISubtypeInterpreter(mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter)

Example 2 with ISubtypeInterpreter

use of mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter in project Ceramics by KnightMiner.

the class JEIPlugin method registerItemSubtypes.

@Override
public void registerItemSubtypes(ISubtypeRegistration registration) {
    ISubtypeInterpreter bucketInterpreter = BaseClayBucketItem::getSubtype;
    registration.registerSubtypeInterpreter(Registration.CLAY_BUCKET.get(), bucketInterpreter);
    registration.registerSubtypeInterpreter(Registration.CRACKED_CLAY_BUCKET.get(), bucketInterpreter);
    // separate different states of crackable clay
    ISubtypeInterpreter crackableClay = stack -> CrackableBlockItem.getCracks(stack) > 0 ? "cracked" : "";
    registration.registerSubtypeInterpreter(Registration.TERRACOTTA_CISTERN.asItem(), crackableClay);
    Registration.COLORED_CISTERN.forEach(block -> registration.registerSubtypeInterpreter(block.asItem(), crackableClay));
    registration.registerSubtypeInterpreter(Registration.TERRACOTTA_FAUCET.asItem(), crackableClay);
    registration.registerSubtypeInterpreter(Registration.TERRACOTTA_CHANNEL.asItem(), crackableClay);
}
Also used : Ingredient(net.minecraft.item.crafting.Ingredient) IRecipeCatalystRegistration(mezz.jei.api.registration.IRecipeCatalystRegistration) IJeiRuntime(mezz.jei.api.runtime.IJeiRuntime) KilnContainer(knightminer.ceramics.container.KilnContainer) KilnRecipe(knightminer.ceramics.recipe.KilnRecipe) KilnScreen(knightminer.ceramics.client.gui.KilnScreen) ArrayList(java.util.ArrayList) IModPlugin(mezz.jei.api.IModPlugin) ItemStack(net.minecraft.item.ItemStack) JeiPlugin(mezz.jei.api.JeiPlugin) RecipeManager(net.minecraft.item.crafting.RecipeManager) Minecraft(net.minecraft.client.Minecraft) IRecipeTransferRegistration(mezz.jei.api.registration.IRecipeTransferRegistration) IRecipeRegistration(mezz.jei.api.registration.IRecipeRegistration) NonNullList(net.minecraft.util.NonNullList) Ceramics(knightminer.ceramics.Ceramics) Registration(knightminer.ceramics.Registration) IRecipe(net.minecraft.item.crafting.IRecipe) VanillaRecipeCategoryUid(mezz.jei.api.constants.VanillaRecipeCategoryUid) IRecipeCategoryRegistration(mezz.jei.api.registration.IRecipeCategoryRegistration) IGuiHandlerRegistration(mezz.jei.api.registration.IGuiHandlerRegistration) ISubtypeInterpreter(mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter) CeramicsTags(knightminer.ceramics.recipe.CeramicsTags) Collectors(java.util.stream.Collectors) CrackableBlockItem(knightminer.ceramics.items.CrackableBlockItem) BaseClayBucketItem(knightminer.ceramics.items.BaseClayBucketItem) List(java.util.List) ISubtypeRegistration(mezz.jei.api.registration.ISubtypeRegistration) IInventory(net.minecraft.inventory.IInventory) ItemGroup(net.minecraft.item.ItemGroup) ResourceLocation(net.minecraft.util.ResourceLocation) VanillaTypes(mezz.jei.api.constants.VanillaTypes) ClientWorld(net.minecraft.client.world.ClientWorld) ISubtypeInterpreter(mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter)

Aggregations

ArrayList (java.util.ArrayList)2 List (java.util.List)2 IModPlugin (mezz.jei.api.IModPlugin)2 JeiPlugin (mezz.jei.api.JeiPlugin)2 VanillaRecipeCategoryUid (mezz.jei.api.constants.VanillaRecipeCategoryUid)2 ISubtypeInterpreter (mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter)2 IGuiHandlerRegistration (mezz.jei.api.registration.IGuiHandlerRegistration)2 IRecipeCatalystRegistration (mezz.jei.api.registration.IRecipeCatalystRegistration)2 IRecipeRegistration (mezz.jei.api.registration.IRecipeRegistration)2 IRecipeTransferRegistration (mezz.jei.api.registration.IRecipeTransferRegistration)2 ISubtypeRegistration (mezz.jei.api.registration.ISubtypeRegistration)2 ItemStack (net.minecraft.item.ItemStack)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 Collectors (java.util.stream.Collectors)1 Ceramics (knightminer.ceramics.Ceramics)1 Registration (knightminer.ceramics.Registration)1 KilnScreen (knightminer.ceramics.client.gui.KilnScreen)1 KilnContainer (knightminer.ceramics.container.KilnContainer)1 BaseClayBucketItem (knightminer.ceramics.items.BaseClayBucketItem)1 CrackableBlockItem (knightminer.ceramics.items.CrackableBlockItem)1