Search in sources :

Example 1 with Registration

use of knightminer.ceramics.Registration 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)1 List (java.util.List)1 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 CeramicsTags (knightminer.ceramics.recipe.CeramicsTags)1 KilnRecipe (knightminer.ceramics.recipe.KilnRecipe)1 IModPlugin (mezz.jei.api.IModPlugin)1 JeiPlugin (mezz.jei.api.JeiPlugin)1 VanillaRecipeCategoryUid (mezz.jei.api.constants.VanillaRecipeCategoryUid)1 VanillaTypes (mezz.jei.api.constants.VanillaTypes)1 ISubtypeInterpreter (mezz.jei.api.ingredients.subtypes.ISubtypeInterpreter)1 IGuiHandlerRegistration (mezz.jei.api.registration.IGuiHandlerRegistration)1 IRecipeCatalystRegistration (mezz.jei.api.registration.IRecipeCatalystRegistration)1 IRecipeCategoryRegistration (mezz.jei.api.registration.IRecipeCategoryRegistration)1 IRecipeRegistration (mezz.jei.api.registration.IRecipeRegistration)1