QuartPos .java

net.minecraft.core.QuartPos (class, 32 lines): members: SECTION_TO_QUARTS_BITS, fromSection, quartLocal, fromBlock, toSection, toBlock, BITS, MASK, SIZE.

net.minecraft.coreclass32 linescommon635 B

API Surface (5)

int fromBlock(final int blockCoord)
int quartLocal(final int blockCoord)
int toBlock(final int quart)
int fromSection(final int section)
int toSection(final int quart)

Fields & Constants (4)

BITS
SIZE
MASK
SECTION_TO_QUARTS_BITS

Full Source

QuartPos.java32 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.core;
2
3
public final class QuartPos {
4
	public static final int BITS = 2;
5
	public static final int SIZE = 4;
6
	public static final int MASK = 3;
7
	private static final int SECTION_TO_QUARTS_BITS = 2;
8
9
	private QuartPos() {
10
	}
11
12
	public static int fromBlock(final int blockCoord) {
13
		return blockCoord >> 2;
14
	}
15
16
	public static int quartLocal(final int blockCoord) {
17
		return blockCoord & 3;
18
	}
19
20
	public static int toBlock(final int quart) {
21
		return quart << 2;
22
	}
23
24
	public static int fromSection(final int section) {
25
		return section << 2;
26
	}
27
28
	public static int toSection(final int quart) {
29
		return quart >> 2;
30
	}
31
}
32

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