Search in sources :

Example 1 with IModifiableDisplay

use of slimeknights.tconstruct.library.tools.item.IModifiableDisplay in project TinkersConstruct by SlimeKnights.

the class ArmorDyeingRecipe method getRecipes.

@Override
public List<IDisplayModifierRecipe> getRecipes() {
    if (displayRecipes == null) {
        List<ItemStack> toolInputs = Arrays.stream(this.toolRequirement.getItems()).map(stack -> {
            if (stack.getItem() instanceof IModifiableDisplay) {
                return ((IModifiableDisplay) stack.getItem()).getRenderTool();
            }
            return stack;
        }).toList();
        ModifierEntry result = new ModifierEntry(TinkerModifiers.dyed.get(), 1);
        displayRecipes = Arrays.stream(DyeColor.values()).map(dye -> new DisplayRecipe(result, toolInputs, dye)).collect(Collectors.toList());
    }
    return displayRecipes;
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) JsonObject(com.google.gson.JsonObject) LoggingRecipeSerializer(slimeknights.mantle.recipe.helper.LoggingRecipeSerializer) DyeColor(net.minecraft.world.item.DyeColor) Arrays(java.util.Arrays) Tag(net.minecraft.nbt.Tag) IDisplayModifierRecipe(slimeknights.tconstruct.library.recipe.modifiers.adding.IDisplayModifierRecipe) Getter(lombok.Getter) RequiredArgsConstructor(lombok.RequiredArgsConstructor) TinkerModifiers(slimeknights.tconstruct.tools.TinkerModifiers) FriendlyByteBuf(net.minecraft.network.FriendlyByteBuf) IMultiRecipe(slimeknights.mantle.recipe.IMultiRecipe) Ingredient(net.minecraft.world.item.crafting.Ingredient) ImmutableList(com.google.common.collect.ImmutableList) IModifiableDisplay(slimeknights.tconstruct.library.tools.item.IModifiableDisplay) ModifierEntry(slimeknights.tconstruct.library.modifiers.ModifierEntry) Nullable(javax.annotation.Nullable) ModDataNBT(slimeknights.tconstruct.library.tools.nbt.ModDataNBT) RecipeSerializer(net.minecraft.world.item.crafting.RecipeSerializer) FinishedRecipe(net.minecraft.data.recipes.FinishedRecipe) ITinkerStationContainer(slimeknights.tconstruct.library.recipe.tinkerstation.ITinkerStationContainer) Collectors(java.util.stream.Collectors) Items(net.minecraftforge.common.Tags.Items) ITinkerStationRecipe(slimeknights.tconstruct.library.recipe.tinkerstation.ITinkerStationRecipe) List(java.util.List) Modifier(slimeknights.tconstruct.library.modifiers.Modifier) ItemStack(net.minecraft.world.item.ItemStack) Level(net.minecraft.world.level.Level) ToolStack(slimeknights.tconstruct.library.tools.nbt.ToolStack) IModifiableDisplay(slimeknights.tconstruct.library.tools.item.IModifiableDisplay) ModifierEntry(slimeknights.tconstruct.library.modifiers.ModifierEntry) ItemStack(net.minecraft.world.item.ItemStack)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 JsonObject (com.google.gson.JsonObject)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Nullable (javax.annotation.Nullable)1 Getter (lombok.Getter)1 RequiredArgsConstructor (lombok.RequiredArgsConstructor)1 FinishedRecipe (net.minecraft.data.recipes.FinishedRecipe)1 Tag (net.minecraft.nbt.Tag)1 FriendlyByteBuf (net.minecraft.network.FriendlyByteBuf)1 ResourceLocation (net.minecraft.resources.ResourceLocation)1 DyeColor (net.minecraft.world.item.DyeColor)1 ItemStack (net.minecraft.world.item.ItemStack)1 Ingredient (net.minecraft.world.item.crafting.Ingredient)1 RecipeSerializer (net.minecraft.world.item.crafting.RecipeSerializer)1 Level (net.minecraft.world.level.Level)1 Items (net.minecraftforge.common.Tags.Items)1 IMultiRecipe (slimeknights.mantle.recipe.IMultiRecipe)1 LoggingRecipeSerializer (slimeknights.mantle.recipe.helper.LoggingRecipeSerializer)1