BlockStateModelSet .java

net.minecraft.client.renderer.block.BlockStateModelSet (class, 33 lines): members: getParticleMaterial, modelByState, missingModel, get. imports: Material.

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

Implements

API Surface (3)

BlockStateModel get(final BlockState state)
BlockStateModel missingModel()
Material.Baked getParticleMaterial(final BlockState blockState)

Fields & Constants (2)

modelByState
missingModel

Code Graph: Dependencies (3)

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

Full Source

BlockStateModelSet.java33 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.renderer.block;
2
3
import java.util.Map;
4
import net.fabricmc.api.EnvType;
5
import net.fabricmc.api.Environment;
6
import net.fabricmc.fabric.api.client.renderer.v1.model.FabricBlockStateModelSet;
7
import net.minecraft.client.renderer.block.dispatch.BlockStateModel;
8
import net.minecraft.client.resources.model.sprite.Material;
9
import net.minecraft.world.level.block.state.BlockState;
10
11
@Environment(EnvType.CLIENT)
12
public class BlockStateModelSet implements FabricBlockStateModelSet {
13
	private final Map<BlockState, BlockStateModel> modelByState;
14
	private final BlockStateModel missingModel;
15
16
	public BlockStateModelSet(final Map<BlockState, BlockStateModel> modelByState, final BlockStateModel missingModel) {
17
		this.modelByState = modelByState;
18
		this.missingModel = missingModel;
19
	}
20
21
	public BlockStateModel get(final BlockState state) {
22
		return this.modelByState.getOrDefault(state, this.missingModel);
23
	}
24
25
	public BlockStateModel missingModel() {
26
		return this.missingModel;
27
	}
28
29
	public Material.Baked getParticleMaterial(final BlockState blockState) {
30
		return this.get(blockState).particleMaterial();
31
	}
32
}
33

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