From e1c8332dd355aae0c43cfcbc0746affcd6c01733 Mon Sep 17 00:00:00 2001 From: DilithiumThoride Date: Fri, 5 Dec 2025 22:23:28 -0600 Subject: [PATCH 1/7] Always copy recipes, even on ContentModifier.IDENTITY --- .../gregtechceu/gtceu/api/recipe/content/ContentModifier.java | 2 +- .../gtceu/api/recipe/modifier/ModifierFunction.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java index 3ec1fb025fe..01003c75221 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java @@ -42,7 +42,7 @@ public double apply(double number) { * @return A new Content map that is the modified version of the argument */ public Map, List> applyContents(Map, List> contents) { - if (this == IDENTITY) return new HashMap<>(contents); +// if (this == IDENTITY) return new HashMap<>(contents); Map, List> copyContents = new HashMap<>(); for (var entry : contents.entrySet()) { var contentList = entry.getValue(); diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/ModifierFunction.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/ModifierFunction.java index a5c670f6500..492e757a098 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/ModifierFunction.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/modifier/ModifierFunction.java @@ -42,7 +42,7 @@ public interface ModifierFunction { /** * Use this static to denote that the recipe doesn't get modified */ - ModifierFunction IDENTITY = recipe -> recipe; + ModifierFunction IDENTITY = ModifierFunction.builder().build(); /** * Applies this modifier to the passed recipe @@ -159,7 +159,7 @@ public ModifierFunction build() { new HashMap<>(recipe.inputChanceLogics), new HashMap<>(recipe.outputChanceLogics), new HashMap<>(recipe.tickInputChanceLogics), new HashMap<>(recipe.tickOutputChanceLogics), newConditions, new ArrayList<>(recipe.ingredientActions), - recipe.data, recipe.duration, recipe.recipeCategory); + recipe.data, recipe.duration, recipe.recipeCategory, recipe.groupColor); copied.parallels = recipe.parallels * parallels; copied.subtickParallels = recipe.subtickParallels * subtickParallels; copied.ocLevel = recipe.ocLevel + addOCs; From 3c0e80c6cc7b518f1ad4a9ead8e1f7a1d8b1e270 Mon Sep 17 00:00:00 2001 From: DilithiumThoride Date: Fri, 5 Dec 2025 22:44:04 -0600 Subject: [PATCH 2/7] On successful RecipeRunner.handle on IO.IN, save Bus Color to the active recipe. Retain that bus color for isTick=True and IO.OUT, enforcing color matching throughout the recipe run. --- .../com/gregtechceu/gtceu/api/recipe/GTRecipe.java | 11 +++++++---- .../gtceu/api/recipe/GTRecipeSerializer.java | 14 +++++++++----- .../gregtechceu/gtceu/api/recipe/RecipeHelper.java | 5 ++++- .../gregtechceu/gtceu/api/recipe/RecipeRunner.java | 12 ++++++++++++ .../gtceu/api/recipe/content/ContentModifier.java | 2 +- .../electric/DistillationTowerMachine.java | 2 +- .../gtceu/data/recipe/builder/GTRecipeBuilder.java | 2 +- 7 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipe.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipe.java index e065d5d7010..f2eac17a5f3 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipe.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipe.java @@ -60,6 +60,7 @@ public class GTRecipe implements net.minecraft.world.item.crafting.Recipe, List> inputs, @@ -74,10 +75,11 @@ public GTRecipe(GTRecipeType recipeType, List ingredientActions, @NotNull CompoundTag data, int duration, - @NotNull GTRecipeCategory recipeCategory) { + @NotNull GTRecipeCategory recipeCategory, + int groupColor) { this(recipeType, null, inputs, outputs, tickInputs, tickOutputs, inputChanceLogics, outputChanceLogics, tickInputChanceLogics, tickOutputChanceLogics, - conditions, ingredientActions, data, duration, recipeCategory); + conditions, ingredientActions, data, duration, recipeCategory, groupColor); } public GTRecipe(GTRecipeType recipeType, @@ -94,7 +96,7 @@ public GTRecipe(GTRecipeType recipeType, List ingredientActions, @NotNull CompoundTag data, int duration, - @NotNull GTRecipeCategory recipeCategory) { + @NotNull GTRecipeCategory recipeCategory, int groupColor) { this.recipeType = recipeType; this.id = id; @@ -113,6 +115,7 @@ public GTRecipe(GTRecipeType recipeType, this.data = data; this.duration = duration; this.recipeCategory = (recipeCategory != GTRecipeCategory.DEFAULT) ? recipeCategory : recipeType.getCategory(); + this.groupColor = groupColor; } public GTRecipe copy() { @@ -130,7 +133,7 @@ public GTRecipe copy(ContentModifier modifier, boolean modifyDuration) { new HashMap<>(inputChanceLogics), new HashMap<>(outputChanceLogics), new HashMap<>(tickInputChanceLogics), new HashMap<>(tickOutputChanceLogics), new ArrayList<>(conditions), - new ArrayList<>(ingredientActions), data, duration, recipeCategory); + new ArrayList<>(ingredientActions), data, duration, recipeCategory, groupColor); if (modifyDuration) { copied.duration = modifier.apply(this.duration); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeSerializer.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeSerializer.java index 457bfd0c435..55410cb9bfe 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeSerializer.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeSerializer.java @@ -134,6 +134,7 @@ public GTRecipe fromNetwork(@NotNull ResourceLocation id, @NotNull FriendlyByteB if (data == null) { data = new CompoundTag(); } + int groupColor = buf.readInt(); ResourceLocation categoryLoc = buf.readResourceLocation(); GTRecipeType type = (GTRecipeType) BuiltInRegistries.RECIPE_TYPE.get(recipeType); @@ -142,7 +143,7 @@ public GTRecipe fromNetwork(@NotNull ResourceLocation id, @NotNull FriendlyByteB GTRecipe recipe = new GTRecipe(type, id, inputs, outputs, tickInputs, tickOutputs, inputChanceLogics, outputChanceLogics, tickInputChanceLogics, tickOutputChanceLogics, - conditions, ingredientActions, data, duration, category); + conditions, ingredientActions, data, duration, category, groupColor); recipe.recipeCategory.addRecipe(recipe); @@ -185,6 +186,7 @@ public void toNetwork(FriendlyByteBuf buf, GTRecipe recipe) { KJSCallWrapper.writeIngredientActions(recipe.ingredientActions, buf); } buf.writeNbt(recipe.data); + buf.writeInt(recipe.groupColor); buf.writeResourceLocation(recipe.recipeCategory.registryKey); } @@ -208,14 +210,15 @@ private static Codec makeCodec(boolean isKubeLoaded) { RecipeCondition.CODEC.listOf().optionalFieldOf("recipeConditions", List.of()).forGetter(val -> val.conditions), CompoundTag.CODEC.optionalFieldOf("data", new CompoundTag()).forGetter(val -> val.data), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("duration").forGetter(val -> val.duration), - GTRegistries.RECIPE_CATEGORIES.codec().optionalFieldOf("category", GTRecipeCategory.DEFAULT).forGetter(val -> val.recipeCategory)) + GTRegistries.RECIPE_CATEGORIES.codec().optionalFieldOf("category", GTRecipeCategory.DEFAULT).forGetter(val -> val.recipeCategory), + Codec.INT.fieldOf("groupColor").forGetter(val -> val.groupColor)) .apply(instance, (type, inputs, outputs, tickInputs, tickOutputs, inputChanceLogics, outputChanceLogics, tickInputChanceLogics, tickOutputChanceLogics, - conditions, data, duration, recipeCategory) -> + conditions, data, duration, recipeCategory,groupColor) -> new GTRecipe(type, inputs, outputs, tickInputs, tickOutputs, inputChanceLogics, outputChanceLogics, tickInputChanceLogics, tickOutputChanceLogics, - conditions, List.of(), data, duration, recipeCategory))); + conditions, List.of(), data, duration, recipeCategory, groupColor))); } else { return RecordCodecBuilder.create(instance -> instance.group( GTRegistries.RECIPE_TYPES.codec().fieldOf("type").forGetter(val -> val.recipeType), @@ -235,7 +238,8 @@ private static Codec makeCodec(boolean isKubeLoaded) { KJSCallWrapper.INGREDIENT_ACTION_CODEC.optionalFieldOf("kubejs:actions", List.of()).forGetter(val -> (List) val.ingredientActions), CompoundTag.CODEC.optionalFieldOf("data", new CompoundTag()).forGetter(val -> val.data), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("duration").forGetter(val -> val.duration), - GTRegistries.RECIPE_CATEGORIES.codec().optionalFieldOf("category", GTRecipeCategory.DEFAULT).forGetter(val -> val.recipeCategory)) + GTRegistries.RECIPE_CATEGORIES.codec().optionalFieldOf("category", GTRecipeCategory.DEFAULT).forGetter(val -> val.recipeCategory), + Codec.INT.fieldOf("groupColor").forGetter(val -> val.groupColor)) .apply(instance, GTRecipe::new)); } // spotless:on diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeHelper.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeHelper.java index 110305d2ecd..fb84163e48e 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeHelper.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeHelper.java @@ -222,7 +222,10 @@ public static ActionResult handleRecipe(IRecipeCapabilityHolder holder, GTRecipe RecipeRunner runner = new RecipeRunner(recipe, io, isTick, holder, chanceCaches, simulated); var result = runner.handle(contents); - if (result.isSuccess() || result.capability() == null) return result; + if (result.isSuccess() || result.capability() == null) { + recipe.groupColor = runner.getGroupColor(); + return result; + } if (!simulated && ConfigHolder.INSTANCE.dev.debug) { GTCEu.LOGGER.warn("IO {} Error while handling recipe {} outputs for {}", diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeRunner.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeRunner.java index 806378f1b06..ad0a66100a2 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeRunner.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeRunner.java @@ -5,6 +5,7 @@ import com.gregtechceu.gtceu.api.capability.recipe.RecipeCapability; import com.gregtechceu.gtceu.api.machine.feature.IVoidable; import com.gregtechceu.gtceu.api.machine.trait.RecipeHandlerGroup; +import com.gregtechceu.gtceu.api.machine.trait.RecipeHandlerGroupColor; import com.gregtechceu.gtceu.api.machine.trait.RecipeHandlerList; import com.gregtechceu.gtceu.api.recipe.chance.boost.ChanceBoostFunction; import com.gregtechceu.gtceu.api.recipe.chance.logic.ChanceLogic; @@ -12,6 +13,7 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap; +import lombok.Getter; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -36,6 +38,8 @@ public class RecipeRunner { private Map, List> recipeContents; private final Map, List> searchRecipeContents; private final Predicate> outputVoid; + @Getter + private int groupColor; public RecipeRunner(GTRecipe recipe, IO io, boolean isTick, IRecipeCapabilityHolder holder, Map, Object2IntMap> chanceCaches, @@ -49,6 +53,7 @@ public RecipeRunner(GTRecipe recipe, IO io, boolean isTick, this.searchRecipeContents = simulated ? recipeContents : new Reference2ObjectOpenHashMap<>(); this.simulated = simulated; this.outputVoid = cap -> holder instanceof IVoidable voidable && voidable.canVoidRecipeOutputs(cap); + this.groupColor = recipe.groupColor; } @NotNull @@ -163,6 +168,13 @@ private ActionResult handleContents() { for (Map.Entry> handlerListEntry : handlerGroups.entrySet()) { if (handlerListEntry.getKey().equals(BUS_DISTINCT)) continue; + if (handlerListEntry.getKey() instanceof RecipeHandlerGroupColor coloredGroup) { + if (io == IO.IN && !isTick) { + groupColor = coloredGroup.color(); + } else if (coloredGroup.color() != -1 && coloredGroup.color() != groupColor) { + continue; + } + } // List to keep track of the remaining items for this RecipeHandlerGroup Map, List> copiedRecipeContents = searchRecipeContents; diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java index 01003c75221..d2cb293cbaf 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java @@ -42,7 +42,7 @@ public double apply(double number) { * @return A new Content map that is the modified version of the argument */ public Map, List> applyContents(Map, List> contents) { -// if (this == IDENTITY) return new HashMap<>(contents); + // if (this == IDENTITY) return new HashMap<>(contents); Map, List> copyContents = new HashMap<>(); for (var entry : contents.entrySet()) { var contentList = entry.getValue(); diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/DistillationTowerMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/DistillationTowerMachine.java index 84c490f2cda..a9c29977bfa 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/DistillationTowerMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/DistillationTowerMachine.java @@ -166,7 +166,7 @@ private static GTRecipe modifyOutputs(GTRecipe recipe, ContentModifier cm) { recipe.outputChanceLogics, recipe.tickInputChanceLogics, recipe.tickOutputChanceLogics, recipe.conditions, recipe.ingredientActions, - recipe.data, recipe.duration, recipe.recipeCategory); + recipe.data, recipe.duration, recipe.recipeCategory, recipe.groupColor); } public static class DistillationTowerLogic extends RecipeLogic { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java index 08a634c4ecc..df5161f9531 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java @@ -1683,7 +1683,7 @@ public GTRecipe buildRawRecipe() { return new GTRecipe(recipeType, id.withPrefix(recipeType.registryName.getPath() + "/"), input, output, tickInput, tickOutput, inputChanceLogic, outputChanceLogic, tickInputChanceLogic, tickOutputChanceLogic, - conditions, List.of(), data, duration, recipeCategory); + conditions, List.of(), data, duration, recipeCategory, -1); } protected void warnTooManyIngredients(RecipeCapability capability, From 61299fe67decafdb473073cf7decd8e31b320622 Mon Sep 17 00:00:00 2001 From: DilithiumThoride Date: Fri, 5 Dec 2025 23:06:15 -0600 Subject: [PATCH 3/7] simulate fix and migration doc --- docs/content/Modpacks/Changes/v7.4.1.md | 15 +++++++++++++++ .../gtceu/api/recipe/RecipeRunner.java | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 docs/content/Modpacks/Changes/v7.4.1.md diff --git a/docs/content/Modpacks/Changes/v7.4.1.md b/docs/content/Modpacks/Changes/v7.4.1.md new file mode 100644 index 00000000000..3d78069fc01 --- /dev/null +++ b/docs/content/Modpacks/Changes/v7.4.1.md @@ -0,0 +1,15 @@ +--- +title: "Version 7.4.0" +--- + + +# Updating from `7.4.0` to `7.4.1` + +## Change to GTRecipe constructor +GTRecipe has had one new field added to it and its constructors: `int groupColor`. For new recipes, this parameter +is set to `-1`; however for recipes that are being prepared and run, this field holds the Paint color of the +Painted Input Group that the recipe drew its inputs from. + +Addon mods which explicitly attempt to construct, copy, or apply their own ModifierFunctions to a GTRecipe +(not using the standard builder or kjs functions) will need to either add the additional `int` parameter to the end of +their constructor calls, or the additional `recipe.groupColor` to their copy calls. diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeRunner.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeRunner.java index ad0a66100a2..5627b677728 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeRunner.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/RecipeRunner.java @@ -169,7 +169,7 @@ private ActionResult handleContents() { if (handlerListEntry.getKey().equals(BUS_DISTINCT)) continue; if (handlerListEntry.getKey() instanceof RecipeHandlerGroupColor coloredGroup) { - if (io == IO.IN && !isTick) { + if (io == IO.IN && simulated && !isTick) { groupColor = coloredGroup.color(); } else if (coloredGroup.color() != -1 && coloredGroup.color() != groupColor) { continue; From c081edd1605480fb883dfd30ff2fcd69f1c3d334 Mon Sep 17 00:00:00 2001 From: DilithiumThoride Date: Fri, 5 Dec 2025 23:06:51 -0600 Subject: [PATCH 4/7] why- --- docs/content/Modpacks/Changes/v7.4.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/Modpacks/Changes/v7.4.1.md b/docs/content/Modpacks/Changes/v7.4.1.md index 3d78069fc01..bd814f291d9 100644 --- a/docs/content/Modpacks/Changes/v7.4.1.md +++ b/docs/content/Modpacks/Changes/v7.4.1.md @@ -1,5 +1,5 @@ --- -title: "Version 7.4.0" +title: "Version 7.4.1" --- From 8edb058732352eb30ba290465b77ff4e640cdd64 Mon Sep 17 00:00:00 2001 From: DilithiumThoride Date: Sun, 7 Dec 2025 12:33:00 -0600 Subject: [PATCH 5/7] rename migration docs file to 7.5.0 since this is a Major now. Add User Wiki section on Distinct, Painted, and Filtered Inputs and Outputs --- docs/content/Gameplay/Logistics/Machines.md | 31 +++++++++++++++++++++ docs/content/Modpacks/Changes/v7.4.1.md | 15 ---------- docs/content/Modpacks/Changes/v7.5.0.md | 25 +++++++++++++++++ 3 files changed, 56 insertions(+), 15 deletions(-) delete mode 100644 docs/content/Modpacks/Changes/v7.4.1.md create mode 100644 docs/content/Modpacks/Changes/v7.5.0.md diff --git a/docs/content/Gameplay/Logistics/Machines.md b/docs/content/Gameplay/Logistics/Machines.md index 8cfe69a4bdd..6dcc68d5d20 100644 --- a/docs/content/Gameplay/Logistics/Machines.md +++ b/docs/content/Gameplay/Logistics/Machines.md @@ -42,6 +42,37 @@ the power button in its UI or by right-clicking it with a Soft Mallet. Buses and Hatches can accept automated import or export from other sides, so long as something else is causing it. +### Distinct, Painted, and Filtered Inputs and Outputs +Under normal circumstances, **all** input Buses and Hatches and on a multiblock machine will be checked for recipe +inputs, and all output buses and hatches will be used to place recipe outputs. However, this can lead to unwanted behavior +where a user wants a single machine to do multiple recipes, but the ingredients to those recipes can conflict and be used +to run an unwanted third recipe. Additionally, when a machine is being used like this, the output bus/hatch to which +produced items/fluids are delivered is chosen somewhat arbitrarily, making it difficult or unwieldy to plan pipes to carry +specific output products away. + +GTM offers three tools for this problem: Fluid Hatch Filter Locking, Distinct Buses and Painted Buses/Hatches. + +* Fluid Hatch Filter Locking is a simple system for resolving the problem of deciding what output hatches receive what +produced fluids. Using the same interface as a Super Tank, a Fluid Output Hatch can have its current contained fluid +Locked, meaning that only that fluid will ever be placed in it; or the Hatch can be pre-emptively locked to a fluid by +dragging that fluid from JEI/EMI into the Hatch's output slot. +* Filter Locking only works with standard *single* fluid hatches, and cannot be done to the higher-tier Quadruple or +Nonuple Fluid Hatches. (However, those Hatches also cannot contain a single fluid in more than one slot, so they do +still allow for some degree of output separation when used with Quadruple or Nonuple Fluid Pipes.) +* Distinct Buses is a toggle used on Input Buses (not Hatches), which causes the machine to look at this bus as being +separate from all other Distinct Buses. (One distinct bus has no meaning, but two distinct buses on one machine will +cause the machine to search each distinct bus separately). +* Painted Buses/Hatches are hatches which have been Painted using a can of spray paint. Input Buses/Hatches which have been +Painted in the same color are looked at together by the machine searching for recipe inputs, but any items/fluids stored +in buses/hatches with a different color are not used for the search. The isolation works the same as for Distinct Buses, +but it allows for multiple buses/hatches to be searched together as a group. +* Prior to version 7.5.0, painting **Output** Buses/Hatches had no effect. Version 7.5.0 introduced machines pairing their +Painted Outputs to their Painted Inputs, such that if a recipe pulls items from a Painted Input, it can only output the +products of that recipe to a Painted Output of the same color (or an unpainted output). +* Buses and Hatches that are not painted, or not set to Distinct, are always fair game for the machine - Distinct and +Painted Inputs can always pull from other non-distinct and non-painted inputs; and recipes that used ingredients from +Painted Inputs can always send their products to non-painted outputs. + ## Passthrough Hatches and the Cleanroom The Cleanroom is a unique multiblock with unique restrictions. Because the Cleanroom must have solid walls, pipes, cables, and inventories outside cannot directly connect to machines inside. For this purpose, Passthrough Hatches exist. diff --git a/docs/content/Modpacks/Changes/v7.4.1.md b/docs/content/Modpacks/Changes/v7.4.1.md deleted file mode 100644 index bd814f291d9..00000000000 --- a/docs/content/Modpacks/Changes/v7.4.1.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Version 7.4.1" ---- - - -# Updating from `7.4.0` to `7.4.1` - -## Change to GTRecipe constructor -GTRecipe has had one new field added to it and its constructors: `int groupColor`. For new recipes, this parameter -is set to `-1`; however for recipes that are being prepared and run, this field holds the Paint color of the -Painted Input Group that the recipe drew its inputs from. - -Addon mods which explicitly attempt to construct, copy, or apply their own ModifierFunctions to a GTRecipe -(not using the standard builder or kjs functions) will need to either add the additional `int` parameter to the end of -their constructor calls, or the additional `recipe.groupColor` to their copy calls. diff --git a/docs/content/Modpacks/Changes/v7.5.0.md b/docs/content/Modpacks/Changes/v7.5.0.md new file mode 100644 index 00000000000..4a05c5dafe3 --- /dev/null +++ b/docs/content/Modpacks/Changes/v7.5.0.md @@ -0,0 +1,25 @@ +--- +title: "Version 7.5.0" +--- + + +# Updating from `7.4.0` to `7.5.0` + +## Painted Output Buses/Hatches +For some time, Spray Paint cans could be used to paint Input and Output Buses/Hatches on multiblock machines. +Version 7.0.0 added the feature that Painted Input Buses/Hatches of different colors would not share their ingredients with +each other when the machine ran recipes. This system is more fully explained at [Painted Inputs and Outputs](../../Gameplay/Logistics/Machines.md#distinct-painted-and-filtered-inputs-and-outputs). + +7.5.0 also applies this logic to Output Buses/Hatches as well. Input Buses/Hatches which have been painted are now only +allowed to send their outputs to Output Buses/Hatches that are of the same paint color, or unpainted. This may cause +existing setups to stop running, if they had painted Output Buses/hatches on them. + + +## Change to GTRecipe constructor +GTRecipe has had one new field added to it and its constructors: `int groupColor`. For new recipes, this parameter +is set to `-1`; however for recipes that are being prepared and run, this field holds the Paint color of the +Painted Input Group that the recipe drew its inputs from. + +Addon mods which explicitly attempt to construct, copy, or apply their own ModifierFunctions to a GTRecipe +(not using the standard builder or kjs functions) will need to either add the additional `int` parameter to the end of +their constructor calls, or the additional `recipe.groupColor` to their copy calls. From 64c256677b555ac212bf99ff82b36fa88576ebda Mon Sep 17 00:00:00 2001 From: jurrejelle Date: Sun, 8 Feb 2026 07:13:50 +0100 Subject: [PATCH 6/7] uncomment out identity check --- .../gregtechceu/gtceu/api/recipe/content/ContentModifier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java index d2cb293cbaf..3ec1fb025fe 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/content/ContentModifier.java @@ -42,7 +42,7 @@ public double apply(double number) { * @return A new Content map that is the modified version of the argument */ public Map, List> applyContents(Map, List> contents) { - // if (this == IDENTITY) return new HashMap<>(contents); + if (this == IDENTITY) return new HashMap<>(contents); Map, List> copyContents = new HashMap<>(); for (var entry : contents.entrySet()) { var contentList = entry.getValue(); From 9e2f1c966a85efd05b525029325bfd72d6a420d1 Mon Sep 17 00:00:00 2001 From: jurrejelle Date: Sun, 8 Feb 2026 07:14:45 +0100 Subject: [PATCH 7/7] Formatting --- .../com/gregtechceu/gtceu/api/recipe/GTRecipeSerializer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeSerializer.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeSerializer.java index 17925219b6d..633001d17cd 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeSerializer.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/GTRecipeSerializer.java @@ -212,7 +212,7 @@ private static Codec makeCodec(boolean isKubeLoaded) { .apply(instance, (type, inputs, outputs, tickInputs, tickOutputs, inputChanceLogics, outputChanceLogics, tickInputChanceLogics, tickOutputChanceLogics, - conditions, data, duration, recipeCategory,groupColor) -> + conditions, data, duration, recipeCategory, groupColor) -> new GTRecipe(type, inputs, outputs, tickInputs, tickOutputs, inputChanceLogics, outputChanceLogics, tickInputChanceLogics, tickOutputChanceLogics, conditions, List.of(), data, duration, recipeCategory, groupColor)));