43 lines
1.9 KiB
Java
43 lines
1.9 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.HappyGhastModel;
|
|
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.HappyGhastRenderState;
|
|
import net.minecraft.client.renderer.rendertype.RenderType;
|
|
import net.minecraft.client.renderer.rendertype.RenderTypes;
|
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
|
import net.minecraft.resources.Identifier;
|
|
import net.minecraft.tags.ItemTags;
|
|
|
|
public class RopesLayer<M extends HappyGhastModel>
|
|
extends RenderLayer<HappyGhastRenderState, M> {
|
|
private final RenderType ropes;
|
|
private final HappyGhastModel adultModel;
|
|
private final HappyGhastModel babyModel;
|
|
|
|
public RopesLayer(RenderLayerParent<HappyGhastRenderState, M> renderer, EntityModelSet modelSet, Identifier ropesTexture) {
|
|
super(renderer);
|
|
this.ropes = RenderTypes.entityCutoutNoCull(ropesTexture);
|
|
this.adultModel = new HappyGhastModel(modelSet.bakeLayer(ModelLayers.HAPPY_GHAST_ROPES));
|
|
this.babyModel = new HappyGhastModel(modelSet.bakeLayer(ModelLayers.HAPPY_GHAST_BABY_ROPES));
|
|
}
|
|
|
|
@Override
|
|
public void submit(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, HappyGhastRenderState state, float yRot, float xRot) {
|
|
if (!state.isLeashHolder || !state.bodyItem.is(ItemTags.HARNESSES)) {
|
|
return;
|
|
}
|
|
HappyGhastModel model = state.isBaby ? this.babyModel : this.adultModel;
|
|
submitNodeCollector.submitModel(model, state, poseStack, this.ropes, lightCoords, OverlayTexture.NO_OVERLAY, state.outlineColor, null);
|
|
}
|
|
}
|
|
|