43 lines
2.0 KiB
Java
43 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.SlimeModel;
|
|
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.SlimeRenderer;
|
|
import net.minecraft.client.renderer.entity.layers.RenderLayer;
|
|
import net.minecraft.client.renderer.entity.state.SlimeRenderState;
|
|
import net.minecraft.client.renderer.rendertype.RenderTypes;
|
|
|
|
public class SlimeOuterLayer
|
|
extends RenderLayer<SlimeRenderState, SlimeModel> {
|
|
private final SlimeModel model;
|
|
|
|
public SlimeOuterLayer(RenderLayerParent<SlimeRenderState, SlimeModel> renderer, EntityModelSet modelSet) {
|
|
super(renderer);
|
|
this.model = new SlimeModel(modelSet.bakeLayer(ModelLayers.SLIME_OUTER));
|
|
}
|
|
|
|
@Override
|
|
public void submit(PoseStack poseStack, SubmitNodeCollector submitNodeCollector, int lightCoords, SlimeRenderState state, float yRot, float xRot) {
|
|
boolean appearsGlowingWithInvisibility;
|
|
boolean bl = appearsGlowingWithInvisibility = state.appearsGlowing() && state.isInvisible;
|
|
if (state.isInvisible && !appearsGlowingWithInvisibility) {
|
|
return;
|
|
}
|
|
int overlayCoords = LivingEntityRenderer.getOverlayCoords(state, 0.0f);
|
|
if (appearsGlowingWithInvisibility) {
|
|
submitNodeCollector.order(1).submitModel(this.model, state, poseStack, RenderTypes.outline(SlimeRenderer.SLIME_LOCATION), lightCoords, overlayCoords, -1, null, state.outlineColor, null);
|
|
} else {
|
|
submitNodeCollector.order(1).submitModel(this.model, state, poseStack, RenderTypes.entityTranslucent(SlimeRenderer.SLIME_LOCATION), lightCoords, overlayCoords, -1, null, state.outlineColor, null);
|
|
}
|
|
}
|
|
}
|
|
|