AnyOfPredicate .java

net.minecraft.world.level.levelgen.blockpredicates.AnyOfPredicate (class, 30 lines): members: test, type, CODEC. imports: LevelAccessor.

net.minecraft.world.level.levelgen.blockpredicatesclass30 linescommonextends CombiningPredicate744 B

API Surface (2)

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

Fields & Constants (1)

CODEC

Code Graph: Dependencies (5)

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

Full Source

AnyOfPredicate.java30 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.levelgen.blockpredicates;
2
3
import com.mojang.serialization.MapCodec;
4
import java.util.List;
5
import net.minecraft.core.BlockPos;
6
import net.minecraft.world.level.LevelAccessor;
7
8
public class AnyOfPredicate extends CombiningPredicate {
9
	public static final MapCodec<AnyOfPredicate> CODEC = codec(AnyOfPredicate::new);
10
11
	public AnyOfPredicate(final List<BlockPredicate> predicates) {
12
		super(predicates);
13
	}
14
15
	public boolean test(final LevelAccessor level, final BlockPos origin) {
16
		for (BlockPredicate predicate : this.predicates) {
17
			if (predicate.test(level, origin)) {
18
				return true;
19
			}
20
		}
21
22
		return false;
23
	}
24
25
	@Override
26
	public BlockPredicateType<?> type() {
27
		return BlockPredicateType.ANY_OF;
28
	}
29
}
30

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