Skip to content

Commit

Permalink
fix exception when spawning ink particles
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed Oct 3, 2022
1 parent 7c3a358 commit 112ca8b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ public Particle createParticle(DefaultParticleType defaultParticleType, ClientWo
// we preserve one decimal point of x precision, so we grab the particle index from the second and third decimal point
int colourIndex = (int) ((secondDecimalPoint + (thirdDecimalPoint / 10.0)) * 10);

SquidColour.RGB rgb = Rainglow.getInkRgb(colourIndex);
SquidColour.RGB rgb;
try {
rgb = Rainglow.getInkRgb(colourIndex);
} catch (Exception ignored) {
rgb = SquidColour.WHITE.getInkRgb();
}
return new SquidInkParticle(clientWorld, d, e, f, g, h, i, ColorUtil.ARGB32.getArgb(255, (int) rgb.r(), (int) rgb.g(), (int) rgb.b()), this.spriteProvider);
}
}

0 comments on commit 112ca8b

Please sign in to comment.