InsideWorldBoundsPredicate .java

net.minecraft.world.level.levelgen.blockpredicates.InsideWorldBoundsPredicate (class, 28 lines): members: offset, test, type, CODEC. strings: "offset".

net.minecraft.world.level.levelgen.blockpredicatesclass28 linescommon973 B

Implements

API Surface (2)

boolean test(final LevelAccessor worldGenLevel, final BlockPos blockPos)
BlockPredicateType<?> type()

Fields & Constants (2)

CODEC
offset

String literals (1)

"offset"

Code Graph: Dependencies (5)

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

Full Source

InsideWorldBoundsPredicate.java28 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.core.Vec3i;
7
import net.minecraft.world.level.LevelAccessor;
8
9
public class InsideWorldBoundsPredicate implements BlockPredicate {
10
	public static final MapCodec<InsideWorldBoundsPredicate> CODEC = RecordCodecBuilder.mapCodec(
11
		i -> i.group(Vec3i.offsetCodec(16).optionalFieldOf("offset", BlockPos.ZERO).forGetter(c -> c.offset)).apply(i, InsideWorldBoundsPredicate::new)
12
	);
13
	private final Vec3i offset;
14
15
	public InsideWorldBoundsPredicate(final Vec3i offset) {
16
		this.offset = offset;
17
	}
18
19
	public boolean test(final LevelAccessor worldGenLevel, final BlockPos blockPos) {
20
		return worldGenLevel.isInsideBuildHeight(blockPos.offset(this.offset));
21
	}
22
23
	@Override
24
	public BlockPredicateType<?> type() {
25
		return BlockPredicateType.INSIDE_WORLD_BOUNDS;
26
	}
27
}
28

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