/* * Decompiled with CFR 0.152. */ package net.minecraft.client.renderer.entity.layers; import com.mojang.blaze3d.vertex.PoseStack; import java.util.function.Function; import net.minecraft.client.model.EntityModel; 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.LivingEntityRenderState; import net.minecraft.client.renderer.feature.ModelFeatureRenderer; import net.minecraft.client.renderer.rendertype.RenderType; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.resources.Identifier; import net.minecraft.util.ARGB; public class LivingEntityEmissiveLayer> extends RenderLayer { private final Function textureProvider; private final AlphaFunction alphaFunction; private final M model; private final Function bufferProvider; private final boolean alwaysVisible; public LivingEntityEmissiveLayer(RenderLayerParent renderer, Function textureProvider, AlphaFunction alphaFunction, M model, Function bufferProvider, boolean alwaysVisible) { super(renderer); this.textureProvider = textureProvider; this.alphaFunction = alphaFunction; this.model = model; this.bufferProvider = bufferProvider; this.alwaysVisible = alwaysVisible; } @Override public void submit(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, S state, float yRot, float xRot) { if (((LivingEntityRenderState)state).isInvisible && !this.alwaysVisible) { return; } float alpha = this.alphaFunction.apply(state, ((LivingEntityRenderState)state).ageInTicks); if (alpha <= 1.0E-5f) { return; } int color = ARGB.white(alpha); RenderType renderType = this.bufferProvider.apply(this.textureProvider.apply(state)); submitNodeCollector.order(1).submitModel(this.model, state, poseStack, renderType, lightCoords, LivingEntityRenderer.getOverlayCoords(state, 0.0f), color, (TextureAtlasSprite)null, ((LivingEntityRenderState)state).outlineColor, (ModelFeatureRenderer.CrumblingOverlay)null); } public static interface AlphaFunction { public float apply(S var1, float var2); } }