Change size type from int to float and remove validation for size greater than 1 in ParticleConfig

This commit is contained in:
akastijn 2026-02-07 23:25:32 +01:00
parent caebd1fed3
commit f6ee8eacf5
2 changed files with 3 additions and 7 deletions

View File

@ -200,22 +200,18 @@ 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());
log.info("Dust particle color: {} with size: {}", color, particleInfo.getSize());
} else {
log.error("Dust particle must have a color");
}
} 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());
log.info("Dust transition particle color start: {} with size: {}", color, particleInfo.getSize());
} else {
log.error("Dust transition particle must have a color gradient start and end");
}

View File

@ -37,7 +37,7 @@ public class ParticleInfo {
// For DustOptions
@JsonProperty(value = "size", defaultValue = "1")
private int size = 1;
private float size = 1;
// For other particle types
private Double extra;