mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Fixed unicorn horns not rendering with the correct colour
This commit is contained in:
parent
8446ec3ca7
commit
db0e38678a
3 changed files with 5 additions and 16 deletions
|
@ -37,9 +37,10 @@ public class UnicornHorn implements IPart {
|
|||
.pitch = 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
|
||||
|
|
|
@ -3,8 +3,6 @@ package com.minelittlepony.client.util.render;
|
|||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.model.Model;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GlowRenderer extends AbstractRenderer<GlowRenderer> {
|
||||
|
||||
int tint;
|
||||
|
@ -26,10 +24,6 @@ public class GlowRenderer extends AbstractRenderer<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) {
|
||||
boxes.add(new HornGlow(this, textureOffsetX, textureOffsetY, offX, offY, offZ, width, height, depth, scaleFactor, alpha));
|
||||
|
@ -37,10 +31,10 @@ public class GlowRenderer extends AbstractRenderer<GlowRenderer> {
|
|||
|
||||
@Override
|
||||
public void render(float scale) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
MinecraftClient.getInstance().gameRenderer.disableLightmap();
|
||||
Color.glColor(tint, alpha);
|
||||
super.render(scale);
|
||||
GL11.glPopAttrib();
|
||||
MinecraftClient.getInstance().gameRenderer.enableLightmap();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,15 +7,11 @@ import net.minecraft.client.render.BufferBuilder;
|
|||
*/
|
||||
public class HornGlow extends Box<GlowRenderer> {
|
||||
|
||||
private final float alpha;
|
||||
|
||||
private Quad[] polygons;
|
||||
|
||||
public HornGlow(GlowRenderer renderer, int texX, int texY, float xMin, float yMin, float zMin, int w, int h, int d, float scale, float alpha) {
|
||||
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;
|
||||
|
@ -65,8 +61,6 @@ public class HornGlow extends Box<GlowRenderer> {
|
|||
|
||||
@Override
|
||||
public void render(BufferBuilder buffer, float scale) {
|
||||
parent.applyTint(alpha);
|
||||
|
||||
for (Quad i : polygons) {
|
||||
i.render(buffer, scale);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue