mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Enable transparency on ponies' skins
This commit is contained in:
parent
472e048d26
commit
446a38b2fc
4 changed files with 16 additions and 1 deletions
|
@ -53,7 +53,6 @@ public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> implemen
|
|||
if (renderingAsHuman) {
|
||||
super.preRenderCallback(entity, ticks);
|
||||
} else {
|
||||
//GlStateManager.scale(1.1, 1.1, 1.1);
|
||||
renderPony.preRenderCallback(entity, ticks);
|
||||
|
||||
GlStateManager.translate(0, 0, -entity.width / 2); // move us to the center of the shadow
|
||||
|
|
|
@ -8,6 +8,8 @@ import com.minelittlepony.render.plane.PlaneRenderer;
|
|||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||
|
||||
public class SeaponyTail implements IModelPart {
|
||||
|
@ -54,9 +56,11 @@ public class SeaponyTail implements IModelPart {
|
|||
|
||||
@Override
|
||||
public void renderPart(float scale) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
GlStateManager.enableBlend();
|
||||
tailBase.render(scale);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.popAttrib();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,6 +19,16 @@ public class RenderPony<T extends EntityLivingBase> {
|
|||
|
||||
private IRenderPony<T> renderer;
|
||||
|
||||
public static void enableModelRenderProfile() {
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.alphaFunc(516, 0.003921569F);
|
||||
}
|
||||
|
||||
public static void disableModelRenderProfile() {
|
||||
GlStateManager.disableBlend();
|
||||
}
|
||||
|
||||
public RenderPony(IRenderPony<T> renderer) {
|
||||
this.renderer = renderer;
|
||||
}
|
||||
|
@ -30,6 +40,7 @@ public class RenderPony<T extends EntityLivingBase> {
|
|||
|
||||
float s = getScaleFactor();
|
||||
GlStateManager.scale(s, s, s);
|
||||
enableModelRenderProfile();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -50,6 +50,7 @@ public class RenderPonyPlayer extends RenderPlayer implements IRenderPony<Abstra
|
|||
@Override
|
||||
public void preRender(boolean transparency) {
|
||||
GlStateManager.enableBlendProfile(GlStateManager.Profile.PLAYER_SKIN);
|
||||
RenderPony.enableModelRenderProfile();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue