mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2025-07-04 04:51:26 +00:00
Added a safeguard to the celebration style
For some reason the task gets frozen in the last state and endlessly spawns the bursts, this fixes that rare condition
This commit is contained in:
parent
9a6f33f2f1
commit
f06b81a54d
1 changed files with 8 additions and 2 deletions
|
@ -122,8 +122,14 @@ public class ParticleStyleCelebration extends DefaultParticleStyle {
|
|||
private Location location = loc;
|
||||
private int fuseLength = fuse;
|
||||
private int fuseTimer = 0;
|
||||
private boolean finished = false;
|
||||
|
||||
public void run() {
|
||||
if (this.finished) {
|
||||
this.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.fuseTimer < this.fuseLength) {
|
||||
ParticlePair trail = ParticlePair.getNextDefault(pplayer);
|
||||
trail.setEffect(ParticleStyleCelebration.this.fuseEffect);
|
||||
|
@ -148,7 +154,7 @@ public class ParticleStyleCelebration extends DefaultParticleStyle {
|
|||
}
|
||||
particleManager.displayParticles(pplayer, this.location.getWorld(), particle, particles, true);
|
||||
|
||||
this.cancel();
|
||||
this.finished = true;
|
||||
}
|
||||
this.fuseTimer++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue