SteepCondition .java

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

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

Implements

API Surface (3)

MapCodec<SteepCondition> 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

SteepCondition.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 SteepCondition implements MaterialCondition {
7
	INSTANCE;
8
9
	public static final MapCodec<SteepCondition> CODEC = MapCodec.unit(INSTANCE);
10
11
	@Override
12
	public MapCodec<SteepCondition> 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.surfaceGradientX() <= -4 || this.context.surfaceGradientZ() >= 4;
22
			}
23
		};
24
	}
25
}
26

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