Skip to content

Commit

Permalink
Include destroyable sparks for disabled fireworks (#972)
Browse files Browse the repository at this point in the history
Signed-off-by: applenick <[email protected]>
  • Loading branch information
applenick authored Mar 19, 2022
1 parent f84a52c commit fdc17ea
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions core/src/main/java/tc/oc/pgm/destroyable/Destroyable.java
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,19 @@ public DestroyableHealthChange handleBlockChange(
this.lastSparkTime = now;

// Spawn a firework where the block was
Firework firework =
FireworkMatchModule.spawnFirework(
blockLocation,
FireworkEffect.builder()
.with(FireworkEffect.Type.BURST)
.withFlicker()
.withColor(this.getOwner().getFullColor())
.build(),
0);

NMSHacks.skipFireworksLaunch(firework);
if (PGM.get().getConfiguration().showFireworks()) {
Firework firework =
FireworkMatchModule.spawnFirework(
blockLocation,
FireworkEffect.builder()
.with(FireworkEffect.Type.BURST)
.withFlicker()
.withColor(this.getOwner().getFullColor())
.build(),
0);

NMSHacks.skipFireworksLaunch(firework);
}

// Players more than 64m away will not see or hear the fireworks, so just play the sound
// for them
Expand Down

0 comments on commit fdc17ea

Please sign in to comment.