NoiseColumn .java

net.minecraft.world.level.NoiseColumn (class, 32 lines): implements BlockColumn. members: column, getBlock, setBlock, minY. imports: BlockColumn, Blocks.

net.minecraft.world.levelclass32 linescommon924 B

Implements

API Surface (2)

BlockState getBlock(final int blockY)
void setBlock(final int blockY, final BlockState state)

Fields & Constants (2)

minY
column

String literals (1)

"Outside of column height: "

Code Graph: Dependencies (3)

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

Full Source

NoiseColumn.java32 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level;
2
3
import net.minecraft.world.level.block.Blocks;
4
import net.minecraft.world.level.block.state.BlockState;
5
import net.minecraft.world.level.chunk.BlockColumn;
6
7
public final class NoiseColumn implements BlockColumn {
8
	private final int minY;
9
	private final BlockState[] column;
10
11
	public NoiseColumn(final int minY, final BlockState[] column) {
12
		this.minY = minY;
13
		this.column = column;
14
	}
15
16
	@Override
17
	public BlockState getBlock(final int blockY) {
18
		int yIndex = blockY - this.minY;
19
		return yIndex >= 0 && yIndex < this.column.length ? this.column[yIndex] : Blocks.AIR.defaultBlockState();
20
	}
21
22
	@Override
23
	public void setBlock(final int blockY, final BlockState state) {
24
		int yIndex = blockY - this.minY;
25
		if (yIndex >= 0 && yIndex < this.column.length) {
26
			this.column[yIndex] = state;
27
		} else {
28
			throw new IllegalArgumentException("Outside of column height: " + blockY);
29
		}
30
	}
31
}
32

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