EmptyLevelChunk .java

net.minecraft.world.level.chunk.EmptyLevelChunk (class): members: addAndRegisterBlockEntity, getLightEmission, isYSpaceEmpty, getFullStatus, setBlockState.

net.minecraft.world.level.chunkclass82 linescommonextends LevelChunk2.1 KB

API Surface (10)

BlockState getBlockState(final BlockPos pos)
FluidState getFluidState(final BlockPos pos)
int getLightEmission(final BlockPos pos)
void addAndRegisterBlockEntity(final BlockEntity blockEntity)
void setBlockEntity(final BlockEntity blockEntity)
void removeBlockEntity(final BlockPos pos)
boolean isEmpty()
boolean isYSpaceEmpty(final int yStartInclusive, final int yEndInclusive)
FullChunkStatus getFullStatus()
Holder<Biome> getNoiseBiome(final int quartX, final int quartY, final int quartZ)

Fields & Constants (1)

biome

Full Source

EmptyLevelChunk.java82 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.chunk;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.core.Holder;
5
import net.minecraft.server.level.FullChunkStatus;
6
import net.minecraft.world.level.ChunkPos;
7
import net.minecraft.world.level.Level;
8
import net.minecraft.world.level.biome.Biome;
9
import net.minecraft.world.level.block.Block;
10
import net.minecraft.world.level.block.Blocks;
11
import net.minecraft.world.level.block.entity.BlockEntity;
12
import net.minecraft.world.level.block.state.BlockState;
13
import net.minecraft.world.level.material.FluidState;
14
import net.minecraft.world.level.material.Fluids;
15
import org.jspecify.annotations.Nullable;
16
17
public class EmptyLevelChunk extends LevelChunk {
18
	private final Holder<Biome> biome;
19
20
	public EmptyLevelChunk(final Level level, final ChunkPos pos, final Holder<Biome> biome) {
21
		super(level, pos);
22
		this.biome = biome;
23
	}
24
25
	@Override
26
	public BlockState getBlockState(final BlockPos pos) {
27
		return Blocks.VOID_AIR.defaultBlockState();
28
	}
29
30
	@Override
31
	public @Nullable BlockState setBlockState(final BlockPos pos, final BlockState state, final @Block.UpdateFlags int flags) {
32
		return null;
33
	}
34
35
	@Override
36
	public FluidState getFluidState(final BlockPos pos) {
37
		return Fluids.EMPTY.defaultFluidState();
38
	}
39
40
	@Override
41
	public int getLightEmission(final BlockPos pos) {
42
		return 0;
43
	}
44
45
	@Override
46
	public @Nullable BlockEntity getBlockEntity(final BlockPos pos, final LevelChunk.EntityCreationType creationType) {
47
		return null;
48
	}
49
50
	@Override
51
	public void addAndRegisterBlockEntity(final BlockEntity blockEntity) {
52
	}
53
54
	@Override
55
	public void setBlockEntity(final BlockEntity blockEntity) {
56
	}
57
58
	@Override
59
	public void removeBlockEntity(final BlockPos pos) {
60
	}
61
62
	@Override
63
	public boolean isEmpty() {
64
		return true;
65
	}
66
67
	@Override
68
	public boolean isYSpaceEmpty(final int yStartInclusive, final int yEndInclusive) {
69
		return true;
70
	}
71
72
	@Override
73
	public FullChunkStatus getFullStatus() {
74
		return FullChunkStatus.FULL;
75
	}
76
77
	@Override
78
	public Holder<Biome> getNoiseBiome(final int quartX, final int quartY, final int quartZ) {
79
		return this.biome;
80
	}
81
}
82

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