Search in sources :

Example 1 with EntityIngredientRenderer

use of slimeknights.tconstruct.plugin.jei.entity.EntityIngredientRenderer in project TinkersConstruct by SlimeKnights.

the class JEIPlugin method registerIngredients.

@Override
public void registerIngredients(IModIngredientRegistration registration) {
    assert Minecraft.getInstance().level != null;
    RecipeManager manager = Minecraft.getInstance().level.getRecipeManager();
    List<ModifierEntry> modifiers = Collections.emptyList();
    if (Config.CLIENT.showModifiersInJEI.get()) {
        modifiers = RecipeHelper.getJEIRecipes(manager, RecipeTypes.TINKER_STATION, IDisplayModifierRecipe.class).stream().map(recipe -> recipe.getDisplayResult().getModifier()).distinct().sorted(Comparator.comparing(Modifier::getId)).map(mod -> new ModifierEntry(mod, 1)).collect(Collectors.toList());
    }
    registration.register(ENTITY_TYPE, Collections.emptyList(), new EntityIngredientHelper(), new EntityIngredientRenderer(16));
    registration.register(MODIFIER_TYPE, modifiers, new ModifierIngredientHelper(), ModifierBookmarkIngredientRenderer.INSTANCE);
    registration.register(PATTERN_TYPE, Collections.emptyList(), new PatternIngredientHelper(), PatternIngredientRenderer.INSTANCE);
}
Also used : HeatingStructureScreen(slimeknights.tconstruct.smeltery.client.screen.HeatingStructureScreen) Item(net.minecraft.world.item.Item) MeltingFuel(slimeknights.tconstruct.library.recipe.fuel.MeltingFuel) RecipeHelper(slimeknights.mantle.recipe.helper.RecipeHelper) Config(slimeknights.tconstruct.common.config.Config) UidContext(mezz.jei.api.ingredients.subtypes.UidContext) IGuiHelper(mezz.jei.api.helpers.IGuiHelper) SlotType(slimeknights.tconstruct.library.tools.SlotType) CastItemObject(slimeknights.tconstruct.common.registration.CastItemObject) CastingTableCategory(slimeknights.tconstruct.plugin.jei.casting.CastingTableCategory) ArmorSlotType(slimeknights.tconstruct.tools.item.ArmorSlotType) RecipeType(net.minecraft.world.item.crafting.RecipeType) VanillaRecipeCategoryUid(mezz.jei.api.constants.VanillaRecipeCategoryUid) ModList(net.minecraftforge.fml.ModList) IGuiHandlerRegistration(mezz.jei.api.registration.IGuiHandlerRegistration) IGuiContainerHandler(mezz.jei.api.gui.handlers.IGuiContainerHandler) TinkerTools(slimeknights.tconstruct.tools.TinkerTools) AlloyRecipe(slimeknights.tconstruct.library.recipe.alloying.AlloyRecipe) SeveringCategory(slimeknights.tconstruct.plugin.jei.entity.SeveringCategory) IDisplayableCastingRecipe(slimeknights.tconstruct.library.recipe.casting.IDisplayableCastingRecipe) IMaterialItem(slimeknights.tconstruct.library.tools.part.IMaterialItem) IIngredientType(mezz.jei.api.ingredients.IIngredientType) Modifier(slimeknights.tconstruct.library.modifiers.Modifier) FluidStack(net.minecraftforge.fluids.FluidStack) CastingBasinCategory(slimeknights.tconstruct.plugin.jei.casting.CastingBasinCategory) ItemStack(net.minecraft.world.item.ItemStack) MaterialIdNBT(slimeknights.tconstruct.library.tools.nbt.MaterialIdNBT) IRecipeCatalystRegistration(mezz.jei.api.registration.IRecipeCatalystRegistration) IDisplayModifierRecipe(slimeknights.tconstruct.library.recipe.modifiers.adding.IDisplayModifierRecipe) MeltingRecipe(slimeknights.tconstruct.library.recipe.melting.MeltingRecipe) EntityType(net.minecraft.world.entity.EntityType) AbstractContainerMenu(net.minecraft.world.inventory.AbstractContainerMenu) ModifierBookmarkIngredientRenderer(slimeknights.tconstruct.plugin.jei.modifiers.ModifierBookmarkIngredientRenderer) TinkerModifiers(slimeknights.tconstruct.tools.TinkerModifiers) IModPlugin(mezz.jei.api.IModPlugin) Container(net.minecraft.world.Container) EntityIngredientRenderer(slimeknights.tconstruct.plugin.jei.entity.EntityIngredientRenderer) IModifiableDisplay(slimeknights.tconstruct.library.tools.item.IModifiableDisplay) IModIngredientRegistration(mezz.jei.api.registration.IModIngredientRegistration) IRecipeTransferRegistration(mezz.jei.api.registration.IRecipeTransferRegistration) CopperCanItem(slimeknights.tconstruct.smeltery.item.CopperCanItem) MeltingCategory(slimeknights.tconstruct.plugin.jei.melting.MeltingCategory) Nullable(javax.annotation.Nullable) RecipeTypes(slimeknights.tconstruct.library.recipe.RecipeTypes) MelterScreen(slimeknights.tconstruct.smeltery.client.screen.MelterScreen) DefaultEntityMeltingRecipe(slimeknights.tconstruct.plugin.jei.entity.DefaultEntityMeltingRecipe) Tag(net.minecraft.tags.Tag) MaterialVariantId(slimeknights.tconstruct.library.materials.definition.MaterialVariantId) Pattern(slimeknights.tconstruct.library.recipe.partbuilder.Pattern) IScreenWithFluidTank(slimeknights.tconstruct.smeltery.client.screen.IScreenWithFluidTank) TinkerSmeltery(slimeknights.tconstruct.smeltery.TinkerSmeltery) RetexturedBlockItem(slimeknights.mantle.item.RetexturedBlockItem) MoldingRecipe(slimeknights.tconstruct.library.recipe.molding.MoldingRecipe) ModifierIngredientHelper(slimeknights.tconstruct.plugin.jei.modifiers.ModifierIngredientHelper) ResourceLocation(net.minecraft.resources.ResourceLocation) PatternIngredientHelper(slimeknights.tconstruct.plugin.jei.partbuilder.PatternIngredientHelper) EntityIngredientHelper(slimeknights.tconstruct.plugin.jei.entity.EntityIngredientHelper) FluidAttributes(net.minecraftforge.fluids.FluidAttributes) EntityMeltingRecipeCategory(slimeknights.tconstruct.plugin.jei.entity.EntityMeltingRecipeCategory) Registry(net.minecraft.core.Registry) IIngredientManager(mezz.jei.api.runtime.IIngredientManager) CreativeSlotItem(slimeknights.tconstruct.tools.item.CreativeSlotItem) IDisplayPartBuilderRecipe(slimeknights.tconstruct.library.recipe.partbuilder.IDisplayPartBuilderRecipe) ModifierEntry(slimeknights.tconstruct.library.modifiers.ModifierEntry) MeltingFuelHandler(slimeknights.tconstruct.plugin.jei.melting.MeltingFuelHandler) PartBuilderCategory(slimeknights.tconstruct.plugin.jei.partbuilder.PartBuilderCategory) EntityMeltingRecipe(slimeknights.tconstruct.library.recipe.entitymelting.EntityMeltingRecipe) IMaterial(slimeknights.tconstruct.library.materials.definition.IMaterial) TinkerTables(slimeknights.tconstruct.tables.TinkerTables) TinkerTags(slimeknights.tconstruct.common.TinkerTags) IRecipeCategoryRegistration(mezz.jei.api.registration.IRecipeCategoryRegistration) Collectors(java.util.stream.Collectors) List(java.util.List) FoundryCategory(slimeknights.tconstruct.plugin.jei.melting.FoundryCategory) RecipeManager(net.minecraft.world.item.crafting.RecipeManager) IIngredientSubtypeInterpreter(mezz.jei.api.ingredients.subtypes.IIngredientSubtypeInterpreter) ISubtypeRegistration(mezz.jei.api.registration.ISubtypeRegistration) MaterialRecipe(slimeknights.tconstruct.library.recipe.material.MaterialRecipe) VanillaTypes(mezz.jei.api.constants.VanillaTypes) IJeiRuntime(mezz.jei.api.runtime.IJeiRuntime) AbstractContainerScreen(net.minecraft.client.gui.screens.inventory.AbstractContainerScreen) SeveringRecipe(slimeknights.tconstruct.library.recipe.modifiers.severing.SeveringRecipe) JeiPlugin(mezz.jei.api.JeiPlugin) ImmutableList(com.google.common.collect.ImmutableList) Minecraft(net.minecraft.client.Minecraft) ItemLike(net.minecraft.world.level.ItemLike) IRecipeRegistration(mezz.jei.api.registration.IRecipeRegistration) Fluid(net.minecraft.world.level.material.Fluid) TinkerMaterials(slimeknights.tconstruct.shared.TinkerMaterials) SerializationTags(net.minecraft.tags.SerializationTags) PatternIngredientRenderer(slimeknights.tconstruct.plugin.jei.partbuilder.PatternIngredientRenderer) TinkerFluids(slimeknights.tconstruct.fluids.TinkerFluids) MaterialItemList(slimeknights.tconstruct.plugin.jei.partbuilder.MaterialItemList) SmelteryCompat(slimeknights.tconstruct.smeltery.data.SmelteryCompat) Recipe(net.minecraft.world.item.crafting.Recipe) ModifierRecipeCategory(slimeknights.tconstruct.plugin.jei.modifiers.ModifierRecipeCategory) Comparator(java.util.Comparator) Collections(java.util.Collections) TinkerStationTransferInfo(slimeknights.tconstruct.plugin.jei.transfer.TinkerStationTransferInfo) ModifierIngredientHelper(slimeknights.tconstruct.plugin.jei.modifiers.ModifierIngredientHelper) PatternIngredientHelper(slimeknights.tconstruct.plugin.jei.partbuilder.PatternIngredientHelper) EntityIngredientHelper(slimeknights.tconstruct.plugin.jei.entity.EntityIngredientHelper) IDisplayModifierRecipe(slimeknights.tconstruct.library.recipe.modifiers.adding.IDisplayModifierRecipe) RecipeManager(net.minecraft.world.item.crafting.RecipeManager) ModifierEntry(slimeknights.tconstruct.library.modifiers.ModifierEntry) EntityIngredientRenderer(slimeknights.tconstruct.plugin.jei.entity.EntityIngredientRenderer) Modifier(slimeknights.tconstruct.library.modifiers.Modifier)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 Collections (java.util.Collections)1 Comparator (java.util.Comparator)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Nullable (javax.annotation.Nullable)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 IGuiContainerHandler (mezz.jei.api.gui.handlers.IGuiContainerHandler)1 IGuiHelper (mezz.jei.api.helpers.IGuiHelper)1 IIngredientType (mezz.jei.api.ingredients.IIngredientType)1 IIngredientSubtypeInterpreter (mezz.jei.api.ingredients.subtypes.IIngredientSubtypeInterpreter)1 UidContext (mezz.jei.api.ingredients.subtypes.UidContext)1 IGuiHandlerRegistration (mezz.jei.api.registration.IGuiHandlerRegistration)1 IModIngredientRegistration (mezz.jei.api.registration.IModIngredientRegistration)1 IRecipeCatalystRegistration (mezz.jei.api.registration.IRecipeCatalystRegistration)1 IRecipeCategoryRegistration (mezz.jei.api.registration.IRecipeCategoryRegistration)1 IRecipeRegistration (mezz.jei.api.registration.IRecipeRegistration)1