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

49 lines
2.3 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.LivingEntityRenderer;
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.client.renderer.rendertype.RenderTypes;
import net.minecraft.resources.Identifier;
public class SheepWoolLayer
extends RenderLayer<SheepRenderState, SheepModel> {
private static final Identifier SHEEP_WOOL_LOCATION = Identifier.withDefaultNamespace("textures/entity/sheep/sheep_wool.png");
private final EntityModel<SheepRenderState> adultModel;
private final EntityModel<SheepRenderState> babyModel;
public SheepWoolLayer(RenderLayerParent<SheepRenderState, SheepModel> renderer, EntityModelSet modelSet) {
super(renderer);
this.adultModel = new SheepFurModel(modelSet.bakeLayer(ModelLayers.SHEEP_WOOL));
this.babyModel = new SheepFurModel(modelSet.bakeLayer(ModelLayers.SHEEP_BABY_WOOL));
}
@Override
public void submit(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, SheepRenderState state, float yRot, float xRot) {
EntityModel<SheepRenderState> model;
if (state.isSheared) {
return;
}
EntityModel<SheepRenderState> entityModel = model = state.isBaby ? this.babyModel : this.adultModel;
if (state.isInvisible) {
if (state.appearsGlowing()) {
submitNodeCollector.submitModel(model, state, poseStack, RenderTypes.outline(SHEEP_WOOL_LOCATION), lightCoords, LivingEntityRenderer.getOverlayCoords(state, 0.0f), -16777216, null, state.outlineColor, null);
}
return;
}
SheepWoolLayer.coloredCutoutModelCopyLayerRender(model, SHEEP_WOOL_LOCATION, poseStack, submitNodeCollector, lightCoords, state, state.getWoolColor(), 0);
}
}