NotRuleTest .java

net.minecraft.world.level.levelgen.structure.templatesystem.NotRuleTest (class, 26 lines): members: rule, test, getType, CODEC. strings: "rule".

net.minecraft.world.level.levelgen.structure.templatesystemclass26 linescommonextends RuleTest759 B

API Surface (2)

boolean test(final BlockState blockState, final BlockPos pos, final RandomSource random)
RuleTestType<?> getType()

Fields & Constants (2)

CODEC
rule

String literals (1)

"rule"

Code Graph: Dependencies (5)

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

Full Source

NotRuleTest.java26 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.levelgen.structure.templatesystem;
2
3
import com.mojang.serialization.MapCodec;
4
import net.minecraft.core.BlockPos;
5
import net.minecraft.util.RandomSource;
6
import net.minecraft.world.level.block.state.BlockState;
7
8
public class NotRuleTest extends RuleTest {
9
	public static final MapCodec<NotRuleTest> CODEC = RuleTest.CODEC.fieldOf("rule").xmap(NotRuleTest::new, t -> t.rule);
10
	private final RuleTest rule;
11
12
	public NotRuleTest(final RuleTest rule) {
13
		this.rule = rule;
14
	}
15
16
	@Override
17
	public boolean test(final BlockState blockState, final BlockPos pos, final RandomSource random) {
18
		return !this.rule.test(blockState, pos, random);
19
	}
20
21
	@Override
22
	protected RuleTestType<?> getType() {
23
		return RuleTestType.NOT_TEST;
24
	}
25
}
26

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