BlockAndLightGetter .java

net.minecraft.world.level.BlockAndLightGetter (interface): members: getRawBrightness, getBrightness, canSeeSky, getLightEngine. imports: LevelLightEngine.

net.minecraft.world.levelinterface21 linescommonextends BlockGetter633 B

API Surface (0)

No public/protected methods detected (fields or constants only).

Code Graph: Dependencies (4)

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

Full Source

BlockAndLightGetter.java21 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.world.level.lighting.LevelLightEngine;
5
6
public interface BlockAndLightGetter extends BlockGetter {
7
	LevelLightEngine getLightEngine();
8
9
	default int getBrightness(final LightLayer layer, final BlockPos pos) {
10
		return this.getLightEngine().getLayerListener(layer).getLightValue(pos);
11
	}
12
13
	default int getRawBrightness(final BlockPos pos, final int darkening) {
14
		return this.getLightEngine().getRawBrightness(pos, darkening);
15
	}
16
17
	default boolean canSeeSky(final BlockPos pos) {
18
		return this.getBrightness(LightLayer.SKY, pos) >= 15;
19
	}
20
}
21

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