41 lines
2.0 KiB
Java
41 lines
2.0 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.client.renderer.entity.layers;
|
|
|
|
import com.mojang.blaze3d.vertex.PoseStack;
|
|
import net.minecraft.client.model.EntityModel;
|
|
import net.minecraft.client.model.SheepFurModel;
|
|
import net.minecraft.client.model.SheepModel;
|
|
import net.minecraft.client.model.geom.EntityModelSet;
|
|
import net.minecraft.client.model.geom.ModelLayers;
|
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
|
import net.minecraft.client.renderer.entity.RenderLayerParent;
|
|
import net.minecraft.client.renderer.entity.layers.RenderLayer;
|
|
import net.minecraft.client.renderer.entity.state.SheepRenderState;
|
|
import net.minecraft.resources.Identifier;
|
|
import net.minecraft.world.item.DyeColor;
|
|
|
|
public class SheepWoolUndercoatLayer
|
|
extends RenderLayer<SheepRenderState, SheepModel> {
|
|
private static final Identifier SHEEP_WOOL_UNDERCOAT_LOCATION = Identifier.withDefaultNamespace("textures/entity/sheep/sheep_wool_undercoat.png");
|
|
private final EntityModel<SheepRenderState> adultModel;
|
|
private final EntityModel<SheepRenderState> babyModel;
|
|
|
|
public SheepWoolUndercoatLayer(RenderLayerParent<SheepRenderState, SheepModel> renderer, EntityModelSet modelSet) {
|
|
super(renderer);
|
|
this.adultModel = new SheepFurModel(modelSet.bakeLayer(ModelLayers.SHEEP_WOOL_UNDERCOAT));
|
|
this.babyModel = new SheepFurModel(modelSet.bakeLayer(ModelLayers.SHEEP_BABY_WOOL_UNDERCOAT));
|
|
}
|
|
|
|
@Override
|
|
public void submit(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, SheepRenderState state, float yRot, float xRot) {
|
|
if (state.isInvisible || !state.isJebSheep && state.woolColor == DyeColor.WHITE) {
|
|
return;
|
|
}
|
|
EntityModel<SheepRenderState> model = state.isBaby ? this.babyModel : this.adultModel;
|
|
SheepWoolUndercoatLayer.coloredCutoutModelCopyLayerRender(model, SHEEP_WOOL_UNDERCOAT_LOCATION, poseStack, submitNodeCollector, lightCoords, state, state.getWoolColor(), 1);
|
|
}
|
|
}
|
|
|