minecraft_25w45a_unobfuscated/net/minecraft/client/renderer/SpecialBlockModelRenderer.java
2025-11-24 22:52:51 +03:00

34 lines
1.4 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.client.renderer;
import com.mojang.blaze3d.vertex.PoseStack;
import java.util.Map;
import net.minecraft.client.renderer.SubmitNodeCollector;
import net.minecraft.client.renderer.special.SpecialModelRenderer;
import net.minecraft.client.renderer.special.SpecialModelRenderers;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.level.block.Block;
public class SpecialBlockModelRenderer {
public static final SpecialBlockModelRenderer EMPTY = new SpecialBlockModelRenderer(Map.of());
private final Map<Block, SpecialModelRenderer<?>> renderers;
public SpecialBlockModelRenderer(Map<Block, SpecialModelRenderer<?>> renderers) {
this.renderers = renderers;
}
public static SpecialBlockModelRenderer vanilla(SpecialModelRenderer.BakingContext context) {
return new SpecialBlockModelRenderer(SpecialModelRenderers.createBlockRenderers(context));
}
public void renderByBlock(Block block, ItemDisplayContext type, PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, int overlayCoords, int outlineColor) {
SpecialModelRenderer<?> specialRenderer = this.renderers.get(block);
if (specialRenderer != null) {
specialRenderer.submit(null, type, poseStack, submitNodeCollector, lightCoords, overlayCoords, false, outlineColor);
}
}
}