Validate particle size
This commit is contained in:
@@ -200,6 +200,9 @@ public class ParticleConfig {
|
||||
String color = particleInfo.getColor();
|
||||
if (dataType.equals(Particle.DustOptions.class)) {
|
||||
if (color != null) {
|
||||
if (particleInfo.getSize() <= 1) {
|
||||
throw new IllegalArgumentException("Particle size must be greater than 1");
|
||||
}
|
||||
particleBuilder.color(getColor(color),
|
||||
particleInfo.getSize());
|
||||
} else {
|
||||
@@ -207,6 +210,9 @@ public class ParticleConfig {
|
||||
}
|
||||
} else if (dataType.equals(Particle.DustTransition.class)) {
|
||||
if (color == null || particleInfo.getColorGradientEnd() != null) {
|
||||
if (particleInfo.getSize() <= 1) {
|
||||
throw new IllegalArgumentException("Particle size must be greater than 1");
|
||||
}
|
||||
particleBuilder.colorTransition(getColor(color),
|
||||
getColor(particleInfo.getColorGradientEnd()),
|
||||
particleInfo.getSize());
|
||||
|
||||
Reference in New Issue
Block a user