Fixed model flickering in first person

This commit is contained in:
Sollace 2023-03-27 17:04:53 +01:00
parent 92688f986c
commit 11c5af9c3f
2 changed files with 10 additions and 2 deletions

View file

@ -1,6 +1,7 @@
package com.minelittlepony.client.render;
import com.minelittlepony.api.model.ModelAttributes;
import com.minelittlepony.api.model.RenderPass;
import com.minelittlepony.api.pony.IPony;
import com.minelittlepony.api.pony.network.MsgPonyData;
import com.minelittlepony.api.pony.network.fabric.Channel;
@ -11,8 +12,6 @@ import com.minelittlepony.client.model.ModelWrapper;
import com.minelittlepony.client.transform.PonyPosture;
import com.minelittlepony.mson.api.ModelKey;
import com.minelittlepony.util.MathUtil;
import com.mojang.blaze3d.platform.GlStateManager.DstFactor;
import com.mojang.blaze3d.platform.GlStateManager.SrcFactor;
import com.mojang.blaze3d.systems.RenderSystem;
import java.util.Objects;
@ -46,6 +45,10 @@ public class EquineRenderManager<T extends LivingEntity, M extends EntityModel<T
}
public Frustum getFrustrum(T entity, Frustum vanilla) {
if (RenderPass.getCurrent() == RenderPass.HUD) {
return FrustrumCheck.ALWAYS_VISIBLE;
}
if (entity.isSleeping() || !MineLittlePony.getInstance().getConfig().frustrum.get()) {
return vanilla;
}

View file

@ -9,6 +9,11 @@ import org.joml.Matrix4f;
import com.minelittlepony.client.PonyBounds;
public class FrustrumCheck<T extends LivingEntity> extends Frustum {
public static final Frustum ALWAYS_VISIBLE = new Frustum(new Matrix4f(), new Matrix4f()) {
public boolean isVisible(Box bounds) {
return true;
}
};
private T entity;