2025-11-24 22:52:51 +03:00

64 lines
2.4 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.mojang.serialization.MapCodec
* org.joml.Vector3f
*/
package net.minecraft.client.renderer.special;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.serialization.MapCodec;
import java.util.Set;
import net.minecraft.client.model.geom.ModelLayers;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.renderer.SubmitNodeCollector;
import net.minecraft.client.renderer.blockentity.ConduitRenderer;
import net.minecraft.client.renderer.rendertype.RenderTypes;
import net.minecraft.client.renderer.special.NoDataSpecialModelRenderer;
import net.minecraft.client.renderer.special.SpecialModelRenderer;
import net.minecraft.client.resources.model.MaterialSet;
import net.minecraft.world.item.ItemDisplayContext;
import org.joml.Vector3f;
public class ConduitSpecialRenderer
implements NoDataSpecialModelRenderer {
private final MaterialSet materials;
private final ModelPart model;
public ConduitSpecialRenderer(MaterialSet materials, ModelPart model) {
this.materials = materials;
this.model = model;
}
@Override
public void submit(ItemDisplayContext type, PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, int overlayCoords, boolean hasFoil, int outlineColor) {
poseStack.pushPose();
poseStack.translate(0.5f, 0.5f, 0.5f);
submitNodeCollector.submitModelPart(this.model, poseStack, ConduitRenderer.SHELL_TEXTURE.renderType(RenderTypes::entitySolid), lightCoords, overlayCoords, this.materials.get(ConduitRenderer.SHELL_TEXTURE), false, false, -1, null, outlineColor);
poseStack.popPose();
}
@Override
public void getExtents(Set<Vector3f> result) {
PoseStack poseStack = new PoseStack();
poseStack.translate(0.5f, 0.5f, 0.5f);
this.model.getExtentsForGui(poseStack, result);
}
public record Unbaked() implements SpecialModelRenderer.Unbaked
{
public static final MapCodec<Unbaked> MAP_CODEC = MapCodec.unit((Object)new Unbaked());
public MapCodec<Unbaked> type() {
return MAP_CODEC;
}
@Override
public SpecialModelRenderer<?> bake(SpecialModelRenderer.BakingContext context) {
return new ConduitSpecialRenderer(context.materials(), context.entityModelSet().bakeLayer(ModelLayers.CONDUIT_SHELL));
}
}
}