NotPredicate .java

net.minecraft.world.level.levelgen.blockpredicates.NotPredicate (class, 27 lines): members: predicate, test, type, CODEC. strings: "predicate".

net.minecraft.world.level.levelgen.blockpredicatesclass27 linescommon842 B

Implements

API Surface (2)

boolean test(final LevelAccessor level, final BlockPos origin)
BlockPredicateType<?> type()

Fields & Constants (2)

CODEC
predicate

String literals (1)

"predicate"

Code Graph: Dependencies (4)

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

Full Source

NotPredicate.java27 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.levelgen.blockpredicates;
2
3
import com.mojang.serialization.MapCodec;
4
import com.mojang.serialization.codecs.RecordCodecBuilder;
5
import net.minecraft.core.BlockPos;
6
import net.minecraft.world.level.LevelAccessor;
7
8
public class NotPredicate implements BlockPredicate {
9
	public static final MapCodec<NotPredicate> CODEC = RecordCodecBuilder.mapCodec(
10
		i -> i.group(BlockPredicate.CODEC.fieldOf("predicate").forGetter(p -> p.predicate)).apply(i, NotPredicate::new)
11
	);
12
	private final BlockPredicate predicate;
13
14
	public NotPredicate(final BlockPredicate predicate) {
15
		this.predicate = predicate;
16
	}
17
18
	public boolean test(final LevelAccessor level, final BlockPos origin) {
19
		return !this.predicate.test(level, origin);
20
	}
21
22
	@Override
23
	public BlockPredicateType<?> type() {
24
		return BlockPredicateType.NOT;
25
	}
26
}
27

Decompiled Minecraft 26.3 source of NotPredicate (net/minecraft/world/level/levelgen/blockpredicates/NotPredicate.java) with Mojang official mappings, stored verbatim on the site.