MultiblockChestResources .java

net.minecraft.client.renderer.MultiblockChestResources (record): members: single, left, right, select, map. imports: ChestType, EnvType, Environment.

net.minecraft.client.rendererrecord22 linesclient690 B

API Surface (2)

T select(final ChestType chestType)
<S> MultiblockChestResources<S> map(final Function<T, S> mapper)

Code Graph: Dependencies (1)

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

Full Source

MultiblockChestResources.java22 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.renderer;
2
3
import java.util.function.Function;
4
import net.fabricmc.api.EnvType;
5
import net.fabricmc.api.Environment;
6
import net.minecraft.world.level.block.state.properties.ChestType;
7
8
@Environment(EnvType.CLIENT)
9
public record MultiblockChestResources<T>(T single, T left, T right) {
10
	public T select(final ChestType chestType) {
11
		return (T)(switch (chestType) {
12
			case SINGLE -> this.single;
13
			case LEFT -> this.left;
14
			case RIGHT -> this.right;
15
		});
16
	}
17
18
	public <S> MultiblockChestResources<S> map(final Function<T, S> mapper) {
19
		return new MultiblockChestResources<>(mapper.apply(this.single), mapper.apply(this.left), mapper.apply(this.right));
20
	}
21
}
22

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