mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-22 04:13:10 +01:00
Backport: Fixed horn glows not using the right colour
This commit is contained in:
parent
aee37fb92e
commit
c19527d95e
3 changed files with 7 additions and 18 deletions
|
@ -34,9 +34,10 @@ public class UnicornHorn implements IModelPart {
|
||||||
.rotateAngleX = 0.5F;
|
.rotateAngleX = 0.5F;
|
||||||
|
|
||||||
glow.offset(HORN_X + x, HORN_Y + y, HORN_Z + z)
|
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)
|
.around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z)
|
||||||
.setAlpha(0.4f).box(0, 0, 0, 1, 4, 1, stretch + 0.5F)
|
.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, 3, 1, stretch + 0.8F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,8 +3,6 @@ package com.minelittlepony.render.model;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.ModelBase;
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
|
|
||||||
import com.minelittlepony.util.render.AbstractBoxRenderer;
|
import com.minelittlepony.util.render.AbstractBoxRenderer;
|
||||||
import com.minelittlepony.util.render.Color;
|
import com.minelittlepony.util.render.Color;
|
||||||
|
|
||||||
|
@ -29,21 +27,17 @@ public class GlowRenderer extends AbstractBoxRenderer<GlowRenderer> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyTint(float alpha) {
|
|
||||||
Color.glColor(tint, alpha);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createBox(float offX, float offY, float offZ, int width, int height, int depth, float scaleFactor, boolean mirrored) {
|
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
|
@Override
|
||||||
public void render(float scale) {
|
public void render(float scale) {
|
||||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
|
||||||
Minecraft.getMinecraft().entityRenderer.disableLightmap();
|
Minecraft.getMinecraft().entityRenderer.disableLightmap();
|
||||||
|
Color.glColor(tint, alpha);
|
||||||
super.render(scale);
|
super.render(scale);
|
||||||
GL11.glPopAttrib();
|
Minecraft.getMinecraft().entityRenderer.enableLightmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,15 +11,11 @@ import com.minelittlepony.util.render.Vertex;
|
||||||
*/
|
*/
|
||||||
public class ModelGlow extends Box<GlowRenderer> {
|
public class ModelGlow extends Box<GlowRenderer> {
|
||||||
|
|
||||||
private final float alpha;
|
|
||||||
|
|
||||||
private Quad[] quadList;
|
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);
|
super(renderer, texX, texY, xMin, yMin, zMin, w, h, d, scale);
|
||||||
|
|
||||||
this.alpha = alpha;
|
|
||||||
|
|
||||||
float xMax = xMin + w + scale;
|
float xMax = xMin + w + scale;
|
||||||
float yMax = yMin + h + scale;
|
float yMax = yMin + h + scale;
|
||||||
float zMax = zMin + d + scale;
|
float zMax = zMin + d + scale;
|
||||||
|
@ -69,8 +65,6 @@ public class ModelGlow extends Box<GlowRenderer> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(BufferBuilder buffer, float scale) {
|
public void render(BufferBuilder buffer, float scale) {
|
||||||
parent.applyTint(alpha);
|
|
||||||
|
|
||||||
for (Quad i : quadList) {
|
for (Quad i : quadList) {
|
||||||
i.draw(buffer, scale);
|
i.draw(buffer, scale);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue