NotCondition .java

net.minecraft.world.level.levelgen.material.condition.NotCondition (record): members: target, compile, codec, CODEC. strings: "invert". imports: MapCodec.

net.minecraft.world.level.levelgen.material.conditionrecord23 linescommon777 B

Implements

API Surface (2)

MapCodec<NotCondition> codec()
ConditionEvaluator compile(final MaterialRuleContext context)

Fields & Constants (1)

CODEC

String literals (1)

"invert"

Code Graph: Dependencies (3)

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

Full Source

NotCondition.java23 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.levelgen.material.condition;
2
3
import com.mojang.serialization.MapCodec;
4
import com.mojang.serialization.codecs.RecordCodecBuilder;
5
import net.minecraft.world.level.levelgen.material.MaterialRuleContext;
6
7
public record NotCondition(MaterialCondition target) implements MaterialCondition {
8
	public static final MapCodec<NotCondition> CODEC = RecordCodecBuilder.mapCodec(
9
		i -> i.group(MaterialCondition.CODEC.fieldOf("invert").forGetter(NotCondition::target)).apply(i, NotCondition::new)
10
	);
11
12
	@Override
13
	public MapCodec<NotCondition> codec() {
14
		return CODEC;
15
	}
16
17
	@Override
18
	public ConditionEvaluator compile(final MaterialRuleContext context) {
19
		ConditionEvaluator target = this.target.compile(context);
20
		return () -> !target.test();
21
	}
22
}
23

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