Fix particle vertex format (Fixes the color)

Fix alpha not being fed to the color int provided to the ParticleBeam
This commit is contained in:
Mrbysco 2024-11-05 19:32:29 +01:00
parent db1bb6e7eb
commit 7fb62cb859

View file

@ -37,9 +37,8 @@ public class ParticleBeam extends Particle {
public BufferBuilder begin(Tesselator tesselator, TextureManager textureManager) { public BufferBuilder begin(Tesselator tesselator, TextureManager textureManager) {
RenderSystem.disableCull(); RenderSystem.disableCull();
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 0.2F);
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE); RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
return tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.PARTICLE); return tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
} }
@Override @Override
@ -101,7 +100,7 @@ public class ParticleBeam extends Particle {
public static ParticleOptions createData(double endX, double endY, double endZ, int color, float alpha, public static ParticleOptions createData(double endX, double endY, double endZ, int color, float alpha,
int maxAge, double rotationTime, float size) { int maxAge, double rotationTime, float size) {
return new BeamParticleData(endX, endY, endZ, color, maxAge, rotationTime, size); return new BeamParticleData(endX, endY, endZ, FastColor.ARGB32.color((int)(alpha * 255F), color), maxAge, rotationTime, size);
} }
} }
} }