Fixed blending on the player's reflection when rendering as a pony

This commit is contained in:
Sollace 2019-07-14 15:01:31 +02:00
parent 13ff5def65
commit c42dcfb14f
2 changed files with 12 additions and 4 deletions

View file

@ -24,11 +24,15 @@ public class RenderPony<T extends LivingEntity, M extends EntityModel<T> & IPony
private final IPonyRender<T, M> renderer; private final IPonyRender<T, M> renderer;
private boolean skipBlend;
private final FrustrumCheck<T> frustrum = new FrustrumCheck<>(this); private final FrustrumCheck<T> frustrum = new FrustrumCheck<>(this);
public static void enableModelRenderProfile() { public static void enableModelRenderProfile(boolean skipBlend) {
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); if (!skipBlend) {
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
}
GlStateManager.alphaFunc(516, 0.003921569F); GlStateManager.alphaFunc(516, 0.003921569F);
} }
@ -40,6 +44,10 @@ public class RenderPony<T extends LivingEntity, M extends EntityModel<T> & IPony
this.renderer = renderer; this.renderer = renderer;
} }
public void setSkipBlend() {
skipBlend = true;
}
public VisibleRegion getFrustrum(T entity, VisibleRegion vanilla) { public VisibleRegion getFrustrum(T entity, VisibleRegion vanilla) {
if (entity.isSleeping() || !MineLittlePony.getInstance().getConfig().frustrum.get()) { if (entity.isSleeping() || !MineLittlePony.getInstance().getConfig().frustrum.get()) {
return vanilla; return vanilla;
@ -52,7 +60,7 @@ public class RenderPony<T extends LivingEntity, M extends EntityModel<T> & IPony
float s = getScaleFactor(); float s = getScaleFactor();
GlStateManager.scalef(s, s, s); GlStateManager.scalef(s, s, s);
enableModelRenderProfile(); enableModelRenderProfile(skipBlend);
translateRider(entity, ticks); translateRider(entity, ticks);
} }

View file

@ -28,7 +28,7 @@ public class PlayerSkullRenderer extends PonySkull {
GlStateManager.setProfile(GlStateManager.RenderMode.PLAYER_SKIN); GlStateManager.setProfile(GlStateManager.RenderMode.PLAYER_SKIN);
if (!transparency) { if (!transparency) {
RenderPony.enableModelRenderProfile(); RenderPony.enableModelRenderProfile(false);
} }
} }