HoleCondition .java

net.minecraft.world.level.levelgen.material.condition.HoleCondition (enum, 26 lines): members: INSTANCE, compile, codec, CODEC. imports: MapCodec.

net.minecraft.world.level.levelgen.material.conditionenum26 linescommon649 B

Implements

API Surface (3)

MapCodec<HoleCondition> codec()
ConditionEvaluator compile(final MaterialRuleContext context)
boolean compute()

Fields & Constants (1)

CODEC

Code Graph: Dependencies (3)

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

Full Source

HoleCondition.java26 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.levelgen.material.condition;
2
3
import com.mojang.serialization.MapCodec;
4
import net.minecraft.world.level.levelgen.material.MaterialRuleContext;
5
6
public enum HoleCondition implements MaterialCondition {
7
	INSTANCE;
8
9
	public static final MapCodec<HoleCondition> CODEC = MapCodec.unit(INSTANCE);
10
11
	@Override
12
	public MapCodec<HoleCondition> codec() {
13
		return CODEC;
14
	}
15
16
	@Override
17
	public ConditionEvaluator compile(final MaterialRuleContext context) {
18
		return new MaterialRuleContext.LazyXZCondition(context) {
19
			@Override
20
			protected boolean compute() {
21
				return this.context.surfaceDepth() <= 0;
22
			}
23
		};
24
	}
25
}
26

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