CustomDataPredicate .java

net.minecraft.core.component.predicates.CustomDataPredicate (record, 19 lines): members: value, customData, matches, CODEC. imports: NbtPredicate, Codec.

net.minecraft.core.component.predicatesrecord19 linescommon672 B

Implements

API Surface (2)

boolean matches(final DataComponentGetter components)
CustomDataPredicate customData(final NbtPredicate value)

Fields & Constants (1)

CODEC

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

CustomDataPredicate.java19 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.core.component.predicates;
2
3
import com.mojang.serialization.Codec;
4
import net.minecraft.advancements.predicates.NbtPredicate;
5
import net.minecraft.core.component.DataComponentGetter;
6
7
public record CustomDataPredicate(NbtPredicate value) implements DataComponentPredicate {
8
	public static final Codec<CustomDataPredicate> CODEC = NbtPredicate.CODEC.xmap(CustomDataPredicate::new, CustomDataPredicate::value);
9
10
	@Override
11
	public boolean matches(final DataComponentGetter components) {
12
		return this.value.matches(components);
13
	}
14
15
	public static CustomDataPredicate customData(final NbtPredicate value) {
16
		return new CustomDataPredicate(value);
17
	}
18
}
19

Decompiled Minecraft 26.3 source of CustomDataPredicate (net/minecraft/core/component/predicates/CustomDataPredicate.java) with Mojang official mappings, stored verbatim on the site.