Skip to content

Lamp predicates.#4511

Merged
jurrejelle merged 29 commits intoGregTechCEu:1.20.1from
Phoenixvine32908:1.20.1
Jan 28, 2026
Merged

Lamp predicates.#4511
jurrejelle merged 29 commits intoGregTechCEu:1.20.1from
Phoenixvine32908:1.20.1

Conversation

@Phoenixvine32908
Copy link
Copy Markdown
Contributor

@Phoenixvine32908 Phoenixvine32908 commented Jan 28, 2026

What

Adds an any lamps predicate and api for specific colors of lamps. Using the normal block predicate doesn't allow the terminal to place lamps.

Implementation Details

The predicate to use all lamps is: Predicates.anyLamp()
The predicate to use a specific color is : Predicates.lampsByColor(DyeColor.DYE_COLOR)

Outcome

A short description of what this PR added/fixed/changed/removed.
Adds lamp predicates, allowing lamps to be used in multiblocks. Without these, the terminal won't place lamps because of the nbt.

How Was This Tested

This section is for screenshots, code snippets or descriptions of how the PR was tested in code or in game to ensure correctness.
2026-01-27_21 50 37

Potential Compatibility Issues

Shouldn't be any.

Phoenixvine32908 and others added 25 commits September 30, 2025 13:56
# Conflicts:
#	src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/Material.java
#	src/main/java/com/gregtechceu/gtceu/api/data/chemical/material/info/MaterialFlags.java
#	src/main/java/com/gregtechceu/gtceu/common/data/GTRecipes.java
Co-authored-by: Jurre Groenendijk <jurre@jilles.com>
Co-authored-by: Jurre Groenendijk <jurre@jilles.com>
Co-authored-by: Jurre Groenendijk <jurre@jilles.com>
Co-authored-by: Jurre Groenendijk <jurre@jilles.com>
# Conflicts:
#	docs/content/Modpacks/Other-Topics/Custom-Sounds.md
@Phoenixvine32908 Phoenixvine32908 requested a review from a team as a code owner January 28, 2026 03:16
@gustovafing gustovafing added the Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. label Jan 28, 2026
}

public static TraceabilityPredicate lampsByColor(DyeColor color) {
return LAMPS_BY_COLOR.getOrDefault(color, anyLamp());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a static context to pre-load all lamps by colour, use Map.computeIfAbsent()

@jurrejelle jurrejelle merged commit 3f7e588 into GregTechCEu:1.20.1 Jan 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants