UVPair .java

net.minecraft.client.model.geom.builders.UVPair (record, 28 lines): record with 2 components. members: unpackU, unpackV, pack. imports: EnvType.

net.minecraft.client.model.geom.buildersrecord28 linesclient704 B

API Surface (5)

record UVPair(float u, float v)
String toString()
long pack(final float u, final float v)
float unpackU(final long packedUV)
float unpackV(final long packedUV)

Full Source

UVPair.java28 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.model.geom.builders;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
6
@Environment(EnvType.CLIENT)
7
public record UVPair(float u, float v) {
8
	@Override
9
	public String toString() {
10
		return "(" + this.u + "," + this.v + ")";
11
	}
12
13
	public static long pack(final float u, final float v) {
14
		long high = Float.floatToIntBits(u) & 4294967295L;
15
		long low = Float.floatToIntBits(v) & 4294967295L;
16
		return high << 32 | low;
17
	}
18
19
	public static float unpackU(final long packedUV) {
20
		int bits = (int)(packedUV >> 32);
21
		return Float.intBitsToFloat(bits);
22
	}
23
24
	public static float unpackV(final long packedUV) {
25
		return Float.intBitsToFloat((int)packedUV);
26
	}
27
}
28

Decompiled Minecraft 26.3 source of UVPair (net/minecraft/client/model/geom/builders/UVPair.java) with Mojang official mappings, stored verbatim on the site.