Backport: Fixed horn glows not using the right colour

This commit is contained in:
Sollace 2019-07-06 15:43:19 +02:00
parent aee37fb92e
commit c19527d95e
3 changed files with 7 additions and 18 deletions

View file

@ -34,9 +34,10 @@ public class UnicornHorn implements IModelPart {
.rotateAngleX = 0.5F;
glow.offset(HORN_X + x, HORN_Y + y, HORN_Z + z)
.setAlpha(0.4F)
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
.setAlpha(0.4f).box(0, 0, 0, 1, 4, 1, stretch + 0.5F)
.setAlpha(0.2f).box(0, 0, 0, 1, 3, 1, stretch + 0.8F);
.box(0, 0, 0, 1, 4, 1, stretch + 0.5F)
.box(0, 0, 0, 1, 3, 1, stretch + 0.8F);
}
@Override

View file

@ -3,8 +3,6 @@ package com.minelittlepony.render.model;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import org.lwjgl.opengl.GL11;
import com.minelittlepony.util.render.AbstractBoxRenderer;
import com.minelittlepony.util.render.Color;
@ -29,21 +27,17 @@ public class GlowRenderer extends AbstractBoxRenderer<GlowRenderer> {
return this;
}
public void applyTint(float alpha) {
Color.glColor(tint, alpha);
}
@Override
public void createBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor, boolean mirrored) {
cubeList.add(new ModelGlow(this, textureOffsetX, textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor, alpha));
cubeList.add(new ModelGlow(this, textureOffsetX, textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor));
}
@Override
public void render(float scale) {
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
Minecraft.getMinecraft().entityRenderer.disableLightmap();
Color.glColor(tint, alpha);
super.render(scale);
GL11.glPopAttrib();
Minecraft.getMinecraft().entityRenderer.enableLightmap();
}
@Override

View file

@ -11,15 +11,11 @@ import com.minelittlepony.util.render.Vertex;
*/
public class ModelGlow extends Box<GlowRenderer> {
private final float alpha;
private Quad[] quadList;
public ModelGlow(GlowRenderer renderer, int texX, int texY, float xMin, float yMin, float zMin, int w, int h, int d, float scale, float alpha) {
public ModelGlow(GlowRenderer renderer, int texX, int texY, float xMin, float yMin, float zMin, int w, int h, int d, float scale) {
super(renderer, texX, texY, xMin, yMin, zMin, w, h, d, scale);
this.alpha = alpha;
float xMax = xMin + w + scale;
float yMax = yMin + h + scale;
float zMax = zMin + d + scale;
@ -69,8 +65,6 @@ public class ModelGlow extends Box<GlowRenderer> {
@Override
public void render(BufferBuilder buffer, float scale) {
parent.applyTint(alpha);
for (Quad i : quadList) {
i.draw(buffer, scale);
}