TemperatureCondition .java

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

net.minecraft.world.level.levelgen.material.conditionenum21 linescommon612 B

Implements

API Surface (2)

MapCodec<TemperatureCondition> codec()
ConditionEvaluator compile(final MaterialRuleContext context)

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

TemperatureCondition.java21 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 TemperatureCondition implements MaterialCondition {
7
	INSTANCE;
8
9
	public static final MapCodec<TemperatureCondition> CODEC = MapCodec.unit(INSTANCE);
10
11
	@Override
12
	public MapCodec<TemperatureCondition> codec() {
13
		return CODEC;
14
	}
15
16
	@Override
17
	public ConditionEvaluator compile(final MaterialRuleContext context) {
18
		return () -> context.getBiome().value().coldEnoughToSnow(context.blockPos(), context.getSeaLevel());
19
	}
20
}
21

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