Change size type from int to float and remove validation for size greater than 1 in ParticleConfig
This commit is contained in:
parent
caebd1fed3
commit
f6ee8eacf5
|
|
@ -200,22 +200,18 @@ public class ParticleConfig {
|
||||||
String color = particleInfo.getColor();
|
String color = particleInfo.getColor();
|
||||||
if (dataType.equals(Particle.DustOptions.class)) {
|
if (dataType.equals(Particle.DustOptions.class)) {
|
||||||
if (color != null) {
|
if (color != null) {
|
||||||
if (particleInfo.getSize() <= 1) {
|
|
||||||
throw new IllegalArgumentException("Particle size must be greater than 1");
|
|
||||||
}
|
|
||||||
particleBuilder.color(getColor(color),
|
particleBuilder.color(getColor(color),
|
||||||
particleInfo.getSize());
|
particleInfo.getSize());
|
||||||
|
log.info("Dust particle color: {} with size: {}", color, particleInfo.getSize());
|
||||||
} else {
|
} else {
|
||||||
log.error("Dust particle must have a color");
|
log.error("Dust particle must have a color");
|
||||||
}
|
}
|
||||||
} else if (dataType.equals(Particle.DustTransition.class)) {
|
} else if (dataType.equals(Particle.DustTransition.class)) {
|
||||||
if (color == null || particleInfo.getColorGradientEnd() != null) {
|
if (color == null || particleInfo.getColorGradientEnd() != null) {
|
||||||
if (particleInfo.getSize() <= 1) {
|
|
||||||
throw new IllegalArgumentException("Particle size must be greater than 1");
|
|
||||||
}
|
|
||||||
particleBuilder.colorTransition(getColor(color),
|
particleBuilder.colorTransition(getColor(color),
|
||||||
getColor(particleInfo.getColorGradientEnd()),
|
getColor(particleInfo.getColorGradientEnd()),
|
||||||
particleInfo.getSize());
|
particleInfo.getSize());
|
||||||
|
log.info("Dust transition particle color start: {} with size: {}", color, particleInfo.getSize());
|
||||||
} else {
|
} else {
|
||||||
log.error("Dust transition particle must have a color gradient start and end");
|
log.error("Dust transition particle must have a color gradient start and end");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public class ParticleInfo {
|
||||||
// For DustOptions
|
// For DustOptions
|
||||||
|
|
||||||
@JsonProperty(value = "size", defaultValue = "1")
|
@JsonProperty(value = "size", defaultValue = "1")
|
||||||
private int size = 1;
|
private float size = 1;
|
||||||
|
|
||||||
// For other particle types
|
// For other particle types
|
||||||
private Double extra;
|
private Double extra;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user