Hotfix xsome exceptions
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-03-03 09:42:39 +01:00
parent 0a60654a28
commit b4eab65757
3 changed files with 32 additions and 24 deletions

View File

@ -32,6 +32,13 @@ public class Gradient {
} }
public Color getColor(double value, double maxValue) { public Color getColor(double value, double maxValue) {
if (colors.isEmpty()) {
return Color.BLACK;
}
if (colors.size() == 1) {
return colors.get(0);
}
value /= maxValue / (double) (colors.size() - 1); value /= maxValue / (double) (colors.size() - 1);
return lerpColor( return lerpColor(

View File

@ -24,6 +24,7 @@ public class TrippleCircle extends Circle {
public TrippleCircle(ParticleElement first, ParticleElement second, ParticleElement third, double distance, double speed) { public TrippleCircle(ParticleElement first, ParticleElement second, ParticleElement third, double distance, double speed) {
super(first); super(first);
this.second = second; this.second = second;
this.third = third;
this.distance = distance; this.distance = distance;
this.speed = speed; this.speed = speed;
} }

View File

@ -28,25 +28,25 @@ public enum CustomEasterParticle implements ParticleEnum {
), ),
PLAYER_10916(new ParticleData(Material.TORCHFLOWER, "PARTICLE_PLAYER_10916_AURA", ParticleRequirement.easterEventSpecificPlayer(10916), PLAYER_10916(new ParticleData(Material.TORCHFLOWER, "PARTICLE_PLAYER_10916_AURA", ParticleRequirement.easterEventSpecificPlayer(10916),
new Always(new NonMoving(new Group( new Always(new NonMoving(new Group(
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 0.2, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 0.2, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 0.3, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 0.3, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 0.4, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 0.4, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 0.5, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 0.5, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 0.6, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 0.6, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 0.7, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 0.7, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 0.8, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 0.8, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 0.9, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 0.9, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.0, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.0, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.1, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.1, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.2, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.2, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.3, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.3, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.4, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.4, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.5, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.5, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.6, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.6, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.7, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.7, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.8, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.8, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 1.9, 0)), new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 1.9, 0)),
new LocationMutator(new Circle(new SimpleParticle(Particle.REDSTONE, 0, 0, 0, 0, 1), 0.1, 1), location -> location.add(0, 2.0, 0)) new LocationMutator(new Circle(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.RED)), 0.1, 1), location -> location.add(0, 2.0, 0))
)))) ))))
), ),
PLAYER_10697(new ParticleData(Material.GUNPOWDER, "PARTICLE_PLAYER_10697_AURA", ParticleRequirement.easterEventSpecificPlayer(10697), PLAYER_10697(new ParticleData(Material.GUNPOWDER, "PARTICLE_PLAYER_10697_AURA", ParticleRequirement.easterEventSpecificPlayer(10697),
@ -66,9 +66,9 @@ public enum CustomEasterParticle implements ParticleEnum {
), ),
PLAYER_153(new ParticleData(Material.OAK_SIGN, "PARTICLE_PLAYER_153", ParticleRequirement.easterEventSpecificPlayer(153), PLAYER_153(new ParticleData(Material.OAK_SIGN, "PARTICLE_PLAYER_153", ParticleRequirement.easterEventSpecificPlayer(153),
new Always(new Delayed(new NonFlying(new Group( new Always(new Delayed(new NonFlying(new Group(
new Wing(new SimpleParticle(Particle.VILLAGER_ANGRY, 0, 0, 0, 0, 1), 0.15, WingDesign.ELY_E), new Wing(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.DARK_GRAY)), 0.15, WingDesign.ELY_E),
new Wing(new SimpleParticle(Particle.COMPOSTER, 0, 0, 0, 0, 1), 0.15, WingDesign.ELY_L), new Wing(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.GREEN)), 0.15, WingDesign.ELY_L),
new Wing(new SimpleParticle(Particle.CRIT, 0, 0, 0, 0, 1), 0.15, WingDesign.ELY_Y) new Wing(new DustParticle(Particle.REDSTONE, 0, 0, 0, 0, 1, new Gradient(Color.GRAY)), 0.15, WingDesign.ELY_Y)
)), 80))) )), 80)))
), ),
// TODO: Implement zSalos! -> Team // TODO: Implement zSalos! -> Team
@ -90,10 +90,10 @@ public enum CustomEasterParticle implements ParticleEnum {
// TODO: Implement SchwarzerFuerst // TODO: Implement SchwarzerFuerst
// TODO: Implement byVallu // TODO: Implement byVallu
TEAM_158_1(new ParticleData(Material.ENCHANTED_BOOK, "PARTICLE_TEAM_158_1", ParticleRequirement.easterEventSpecificTeam(158), TEAM_158_1(new ParticleData(Material.ENCHANTED_BOOK, "PARTICLE_TEAM_158_1", ParticleRequirement.easterEventSpecificTeam(158),
new Always(new NonFlying(new Delayed(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.2, WingDesign.EV), 80)))) new Always(new NonFlying(new Delayed(new Wing(new SimpleParticle(Particle.CRIT_MAGIC, 0, 0, 0, 0, 1), 0.2, WingDesign.EV), 20))))
), ),
TEAM_158_2(new ParticleData(Material.ENDER_EYE, "PARTICLE_TEAM_158_2", ParticleRequirement.easterEventSpecificTeam(158), TEAM_158_2(new ParticleData(Material.ENDER_EYE, "PARTICLE_TEAM_158_2", ParticleRequirement.easterEventSpecificTeam(158),
new Always(new NonFlying(new YOffset(new DoubleCircle(new SimpleParticle(Particle.SPORE_BLOSSOM_AIR, 0, 0, 0, 0, 1), new SimpleParticle(Particle.SPORE_BLOSSOM_AIR, 0, 0, 0, 0, 1), 0.5, 1), 1, 0, 2, false, false)))) new Always(new NonFlying(new YOffset(new DoubleCircle(new SimpleParticle(Particle.SPORE_BLOSSOM_AIR, 0.01f, 0.01f, 0.01f, 0.1, 1), new SimpleParticle(Particle.SPORE_BLOSSOM_AIR, 0.01f, 0.01f, 0.01f, 0.1, 1), 0.5, 1), 1, 0, 2, false, false))))
), ),
; ;
public static ParticleEnum[] particles = values(); public static ParticleEnum[] particles = values();