WallAndGroundTransformations .java

net.minecraft.client.renderer.blockentity.WallAndGroundTransformations (class, 33 lines): members: freeTransformations, wallTransformation, wallTransforms.

net.minecraft.client.renderer.blockentityclass33 linesclient1.1 KB

API Surface (2)

T wallTransformation(final Direction facing)
T freeTransformations(final int segment)

Fields & Constants (2)

wallTransforms
freeTransformations

Code Graph: Dependencies (2)

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

Full Source

WallAndGroundTransformations.java33 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.renderer.blockentity;
2
3
import java.util.Map;
4
import java.util.function.Function;
5
import java.util.function.IntFunction;
6
import net.fabricmc.api.EnvType;
7
import net.fabricmc.api.Environment;
8
import net.minecraft.core.Direction;
9
import net.minecraft.util.Util;
10
11
@Environment(EnvType.CLIENT)
12
public class WallAndGroundTransformations<T> {
13
	private final Map<Direction, T> wallTransforms;
14
	private final T[] freeTransformations;
15
16
	public WallAndGroundTransformations(final Function<Direction, T> wallTransformationFactory, final IntFunction<T> freeTransformationFactory, final int segments) {
17
		this.wallTransforms = Util.makeEnumMap(Direction.class, wallTransformationFactory);
18
		this.freeTransformations = (T[])(new Object[segments]);
19
20
		for (int segment = 0; segment < segments; segment++) {
21
			this.freeTransformations[segment] = freeTransformationFactory.apply(segment);
22
		}
23
	}
24
25
	public T wallTransformation(final Direction facing) {
26
		return this.wallTransforms.get(facing);
27
	}
28
29
	public T freeTransformations(final int segment) {
30
		return this.freeTransformations[segment];
31
	}
32
}
33

Decompiled Minecraft 26.3 source of WallAndGroundTransformations (net/minecraft/client/renderer/blockentity/WallAndGroundTransformations.java) with Mojang official mappings, stored verbatim on the site.