The one in orange

- Blueprint overlay now renders a '1' for single missing items
- Dough can now be created in the mixer without the need of buckets
- JEI no longer shows all available machines as catalysts for sequenced assembly recipes
This commit is contained in:
simibubi 2021-07-02 12:52:52 +02:00
parent b5ff93cff0
commit c6fa055d9b
12 changed files with 85 additions and 11 deletions

View file

@ -3391,6 +3391,7 @@ ab602a53a5d8d057aad910dd1c5529cde2d587ab data/create/recipes/mixing/chocolate.js
d3bf74bb3826cf2dccaf7377b8b3e0fdaa38f1aa data/create/recipes/mixing/chocolate_melting.json
0e29b4ce13750aab5a60ae54cbec8776569b35e0 data/create/recipes/mixing/chromatic_compound.json
d9a3dff1288d675ab812eef1eb73cb27dcc71bd2 data/create/recipes/mixing/crushed_brass.json
ec331b1de31bbe2795aec729e931726ec4f4534f data/create/recipes/mixing/dough_by_mixing.json
ffba306dbb52e4d7afeaec183b92821dbc402a7c data/create/recipes/mixing/honey.json
cd9a78454bce20cf3557f5c44febae77ebd43e54 data/create/recipes/mixing/lava_from_cobble.json
0f89b3f2d81585591513619b8d1e8694eb874316 data/create/recipes/mixing/tea.json

View file

@ -0,0 +1,18 @@
{
"type": "create:mixing",
"ingredients": [
{
"item": "create:wheat_flour"
},
{
"fluid": "minecraft:water",
"nbt": {},
"amount": 1000
}
],
"results": [
{
"item": "create:dough"
}
]
}

View file

@ -124,10 +124,6 @@ public class CreateJEI implements IModPlugin {
seqAssembly = register("sequenced_assembly", SequencedAssemblyCategory::new)
.recipes(AllRecipeTypes.SEQUENCED_ASSEMBLY::getType)
.catalyst(AllBlocks.MECHANICAL_PRESS::get)
.catalyst(AllBlocks.MECHANICAL_SAW::get)
.catalyst(AllBlocks.DEPLOYER::get)
.catalyst(AllBlocks.SPOUT::get)
.build(),
autoShapeless = register("automatic_shapeless", MixingCategory::autoShapeless)

View file

@ -89,6 +89,17 @@ public class SequencedAssemblyCategory extends CreateRecipeCategory<SequencedAss
fluidIndex += subCategory.addFluidIngredients(sequencedRecipe, fluidStacks, x, fluidIndex);
x += subCategory.getWidth() + margin;
}
// In case machines should be displayed as ingredients
// List<List<ItemStack>> inputs = ingredients.getInputs(VanillaTypes.ITEM);
// int catalystX = -2;
// int catalystY = 14;
// for (; index < inputs.size(); index++) {
// itemStacks.init(index, true, catalystX, catalystY);
// itemStacks.set(index, inputs.get(index));
// catalystY += 19;
// }
itemStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> {
if (slotIndex != 1)
@ -234,7 +245,7 @@ public class SequencedAssemblyCategory extends CreateRecipeCategory<SequencedAss
List<Ingredient> assemblyIngredients = new ArrayList<>();
assemblyIngredients.add(recipe.getIngredient());
assemblyIngredients.add(Ingredient.fromStacks(recipe.getTransitionalItem()));
recipe.addAdditionalIngredients(assemblyIngredients);
recipe.addAdditionalIngredientsAndMachines(assemblyIngredients);
return assemblyIngredients;
}

View file

@ -1,9 +1,11 @@
package com.simibubi.create.content.contraptions.components.deployer;
import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.Create;
@ -17,6 +19,7 @@ import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
@ -87,6 +90,11 @@ public class DeployerApplicationRecipe extends ProcessingRecipe<RecipeWrapper> i
return Lang.translate("recipe.assembly.deploying_item",
new TranslationTextComponent(matchingStacks[0].getTranslationKey()).getString());
}
@Override
public void addRequiredMachines(Set<IItemProvider> list) {
list.add(AllBlocks.DEPLOYER.get());
}
@Override
public Supplier<Supplier<SequencedAssemblySubCategory>> getJEISubCategory() {

View file

@ -1,10 +1,12 @@
package com.simibubi.create.content.contraptions.components.press;
import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
import javax.annotation.ParametersAreNonnullByDefault;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.compat.jei.category.sequencedAssembly.SequencedAssemblySubCategory;
import com.simibubi.create.content.contraptions.itemAssembly.IAssemblyRecipe;
@ -13,6 +15,7 @@ import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuild
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@ -53,6 +56,11 @@ public class PressingRecipe extends ProcessingRecipe<RecipeWrapper> implements I
return Lang.translate("recipe.assembly.pressing");
}
@Override
public void addRequiredMachines(Set<IItemProvider> list) {
list.add(AllBlocks.MECHANICAL_PRESS.get());
}
@Override
public Supplier<Supplier<SequencedAssemblySubCategory>> getJEISubCategory() {
return () -> SequencedAssemblySubCategory.AssemblyPressing::new;

View file

@ -1,10 +1,12 @@
package com.simibubi.create.content.contraptions.components.saw;
import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
import javax.annotation.ParametersAreNonnullByDefault;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.compat.jei.category.sequencedAssembly.SequencedAssemblySubCategory;
import com.simibubi.create.content.contraptions.itemAssembly.IAssemblyRecipe;
@ -13,6 +15,7 @@ import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuild
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@ -53,6 +56,11 @@ public class CuttingRecipe extends ProcessingRecipe<RecipeWrapper> implements IA
return Lang.translate("recipe.assembly.cutting");
}
@Override
public void addRequiredMachines(Set<IItemProvider> list) {
list.add(AllBlocks.MECHANICAL_SAW.get());
}
@Override
public Supplier<Supplier<SequencedAssemblySubCategory>> getJEISubCategory() {
return () -> SequencedAssemblySubCategory.AssemblyCutting::new;

View file

@ -1,8 +1,10 @@
package com.simibubi.create.content.contraptions.fluids.actors;
import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.compat.jei.category.sequencedAssembly.SequencedAssemblySubCategory;
import com.simibubi.create.content.contraptions.itemAssembly.IAssemblyRecipe;
@ -12,6 +14,7 @@ import com.simibubi.create.foundation.fluid.FluidIngredient;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
@ -74,6 +77,11 @@ public class FillingRecipe extends ProcessingRecipe<RecipeWrapper> implements IA
.getTranslationKey()).getString());
}
@Override
public void addRequiredMachines(Set<IItemProvider> list) {
list.add(AllBlocks.SPOUT.get());
}
@Override
public Supplier<Supplier<SequencedAssemblySubCategory>> getJEISubCategory() {
return () -> SequencedAssemblySubCategory.AssemblySpouting::new;

View file

@ -1,12 +1,14 @@
package com.simibubi.create.content.contraptions.itemAssembly;
import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
import com.simibubi.create.compat.jei.category.sequencedAssembly.SequencedAssemblySubCategory;
import com.simibubi.create.foundation.fluid.FluidIngredient;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@ -20,6 +22,8 @@ public interface IAssemblyRecipe {
@OnlyIn(Dist.CLIENT)
public ITextComponent getDescriptionForAssembly();
public void addRequiredMachines(Set<IItemProvider> list);
public void addAssemblyIngredients(List<Ingredient> list);
default void addAssemblyFluidIngredients(List<FluidIngredient> list) {}

View file

@ -1,8 +1,10 @@
package com.simibubi.create.content.contraptions.itemAssembly;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.Create;
@ -19,6 +21,7 @@ import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
@ -90,9 +93,15 @@ public class SequencedAssemblyRecipe implements IRecipe<RecipeWrapper> {
return loops;
}
public void addAdditionalIngredients(List<Ingredient> list) {
public void addAdditionalIngredientsAndMachines(List<Ingredient> list) {
sequence.forEach(sr -> sr.getAsAssemblyRecipe()
.addAssemblyIngredients(list));
Set<IItemProvider> machines = new HashSet<>();
sequence.forEach(sr -> sr.getAsAssemblyRecipe()
.addRequiredMachines(machines));
machines.stream()
.map(Ingredient::fromItems)
.forEach(list::add);
}
public void addAdditionalFluidIngredients(List<FluidIngredient> list) {

View file

@ -219,8 +219,7 @@ public class BlueprintOverlayRenderer {
RenderSystem.enableBlend();
(pair.getSecond() ? AllGuiTextures.HOTSLOT_ACTIVE : AllGuiTextures.HOTSLOT).draw(ms, x, y);
ItemStack itemStack = pair.getFirst();
String count = pair.getSecond() || itemStack.getCount() == 1 ? null
: TextFormatting.GOLD.toString() + itemStack.getCount();
String count = pair.getSecond() ? null : TextFormatting.GOLD.toString() + itemStack.getCount();
drawItemStack(ms, mc, x, y, itemStack, count);
x += 21;
}

View file

@ -17,9 +17,9 @@ public class MixingRecipeGen extends ProcessingRecipeGen {
GeneratedRecipe
TEMP_LAVA = create("lava_from_cobble", b -> b.require(Tags.Items.COBBLESTONE)
.output(Fluids.LAVA, 50)
.requiresHeat(HeatCondition.SUPERHEATED)),
TEMP_LAVA = create("lava_from_cobble", b -> b.require(Tags.Items.COBBLESTONE)
.output(Fluids.LAVA, 50)
.requiresHeat(HeatCondition.SUPERHEATED)),
TEA = create("tea", b -> b.require(Fluids.WATER, 250)
.require(Tags.Fluids.MILK, 250)
@ -41,6 +41,10 @@ public class MixingRecipeGen extends ProcessingRecipeGen {
.output(AllFluids.HONEY.get(), 1000)
.requiresHeat(HeatCondition.HEATED)),
DOUGH = create("dough_by_mixing", b -> b.require(AllItems.WHEAT_FLOUR.get())
.require(Fluids.WATER, 1000)
.output(AllItems.DOUGH.get(), 1)),
BRASS_INGOT = create("brass_ingot", b -> b.require(I.copper())
.require(I.zinc())
.output(AllItems.BRASS_INGOT.get(), 2)