Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9a2d7e9
Make new flag DISABLE_MATERIAL_RECIPES to replace NO_UNIFICATION.
Phoenixvine32908 Sep 30, 2025
3e5cba5
Merge remote-tracking branch 'origin/1.20.1' into 1.20.1
Phoenixvine32908 Oct 21, 2025
93281db
Recipe conditon docu update.
Phoenixvine32908 Oct 22, 2025
6d12b38
Merge branch '1.20.1' into 1.20.1
Phoenixvine32908 Oct 24, 2025
15180fa
Merge branch '1.20.1' into 1.20.1
Ghostipedia Oct 26, 2025
9f7a1ef
Update to 7.2.1
Phoenixvine32908 Oct 28, 2025
e83d237
Merge branch '1.20.1' into 1.20.1
Phoenixvine32908 Oct 28, 2025
8796917
Update docs/content/Modpacks/Recipes/Recipe-Conditions.md
Phoenixvine32908 Oct 29, 2025
73e5f90
Update docs/content/Modpacks/Recipes/Recipe-Conditions.md
Phoenixvine32908 Oct 29, 2025
67022fe
Update docs/content/Modpacks/Recipes/Recipe-Conditions.md
Phoenixvine32908 Oct 29, 2025
90b2f8d
Jurre requested fixes. As well as fixing the link.
Phoenixvine32908 Oct 29, 2025
8985074
Merge remote-tracking branch 'origin/1.20.1' into 1.20.1
Phoenixvine32908 Oct 29, 2025
46b6dfe
JurrThese fix.
Phoenixvine32908 Oct 29, 2025
cad6ccb
Update docs/content/Modpacks/Examples/Custom-Recipe-Condition.md
Phoenixvine32908 Oct 29, 2025
c5d37b2
Indentation.
Phoenixvine32908 Oct 29, 2025
576c806
Merge remote-tracking branch 'origin/1.20.1' into 1.20.1
Phoenixvine32908 Oct 29, 2025
666cf78
Removal of rpm recipe type and fixing the apperance block of example …
Phoenixvine32908 Nov 2, 2025
9d3f64f
Merge branch 'GregTechCEu:1.20.1' into 1.20.1
Phoenixvine32908 Nov 2, 2025
e56afe4
Merge branch 'GregTechCEu:1.20.1' into 1.20.1
Phoenixvine32908 Nov 2, 2025
5f74988
Custom sound example.
Phoenixvine32908 Nov 14, 2025
0619915
Merge remote-tracking branch 'origin/1.20.1' into 1.20.1
Phoenixvine32908 Nov 14, 2025
018a7d4
Rename method for adding tool enchantments
Phoenixvine32908 Jan 27, 2026
39f6487
Merge branch 'GregTechCEu:1.20.1' into 1.20.1
Phoenixvine32908 Jan 28, 2026
a1ad48b
Lamp predicates.
Phoenixvine32908 Jan 28, 2026
00cd20e
Merge remote-tracking branch 'origin/1.20.1' into 1.20.1
Phoenixvine32908 Jan 28, 2026
59b84c2
Refactor lampsByColor method to use computeIfAbsent
Phoenixvine32908 Jan 28, 2026
f4324a0
Refactor LAMPS_BY_COLOR initialization
gustovafing Jan 28, 2026
4c42023
Lamp predicate docs.
Phoenixvine32908 Jan 28, 2026
5ce6021
Merge remote-tracking branch 'origin/1.20.1' into 1.20.1
Phoenixvine32908 Jan 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/content/Modpacks/Changes/v7.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ You also need to adjust the generics of `getType()` and `createTemplate()` to ma
A new system for copying machines using the Machine Memory Card has been added, see [this page](../Other-Topics/Cover-Machine-Copy-Paste-Support.md) if you want to add extra copy/paste behaviour to your own machines and covers.

## Mortar Recipe Fix
Previously, adding GTToolType.MORTAR to your tool did not automatically generate the recipe. This has been fixed. If you previously generated a recipe using this, you need to remove your manual recipe.
Previously, adding GTToolType.MORTAR to your tool did not automatically generate the recipe. This has been fixed. If you previously generated a recipe using this, you need to remove your manual recipe.

## Lamp Predicates
Previously, lamps were not useable with the terminal in multiblocks. There are new lamp predicates that will help solve this problem.
The predicate to use all lamps is: `Predicates.anyLamp()`
The predicate to use a specific color is: `Predicates.lampsByColor(DyeColor.DYE_COLOR)`. Where DYE_COLOR is the name of the color you want.
31 changes: 31 additions & 0 deletions src/main/java/com/gregtechceu/gtceu/api/pattern/Predicates.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
import com.gregtechceu.gtceu.common.block.BatteryBlock;
import com.gregtechceu.gtceu.common.block.CoilBlock;
import com.gregtechceu.gtceu.common.block.LampBlock;
import com.gregtechceu.gtceu.common.data.GTMaterialBlocks;
import com.gregtechceu.gtceu.common.machine.multiblock.electric.PowerSubstationMachine;
import com.gregtechceu.gtceu.config.ConfigHolder;
Expand All @@ -25,11 +26,13 @@

import net.minecraft.network.chat.Component;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid;

import com.tterrag.registrate.util.entry.BlockEntry;
import com.tterrag.registrate.util.entry.RegistryEntry;
import org.apache.commons.lang3.ArrayUtils;

Expand All @@ -38,6 +41,8 @@
import java.util.function.Supplier;

import static com.gregtechceu.gtceu.api.block.property.GTBlockStateProperties.ACTIVE;
import static com.gregtechceu.gtceu.common.data.GTBlocks.BORDERLESS_LAMPS;
import static com.gregtechceu.gtceu.common.data.GTBlocks.LAMPS;
import static com.gregtechceu.gtceu.common.machine.multiblock.electric.PowerSubstationMachine.PMC_BATTERY_HEADER;

public class Predicates {
Expand Down Expand Up @@ -100,6 +105,32 @@ public static TraceabilityPredicate air() {
return new TraceabilityPredicate(SimplePredicate.AIR);
}

@SafeVarargs
public static TraceabilityPredicate lamps(BlockEntry<LampBlock>... lampEntries) {
return new TraceabilityPredicate(blockWorldState -> {
BlockState state = blockWorldState.getBlockState();
for (BlockEntry<LampBlock> entry : lampEntries) {
if (state.is(entry.get())) return true;
}
return false;
}, () -> Arrays.stream(lampEntries)
.map(entry -> new BlockInfo(entry.get().defaultBlockState(), null))
.toArray(BlockInfo[]::new));
}

public static TraceabilityPredicate anyLamp() {
List<BlockEntry<LampBlock>> all = new ArrayList<>();
all.addAll(LAMPS.values());
all.addAll(BORDERLESS_LAMPS.values());
return lamps(all.toArray(BlockEntry[]::new));
}

private static final Map<DyeColor, TraceabilityPredicate> LAMPS_BY_COLOR = new EnumMap<>(DyeColor.class);

public static TraceabilityPredicate lampsByColor(DyeColor color) {
return LAMPS_BY_COLOR.computeIfAbsent(color, c -> lamps(LAMPS.get(c), BORDERLESS_LAMPS.get(c)));
}

public static TraceabilityPredicate abilities(PartAbility... abilities) {
return blocks(Arrays.stream(abilities).map(PartAbility::getAllBlocks).flatMap(Collection::stream)
.toArray(Block[]::new));
Expand Down