From fdc17ea670fdf5e7cf476daa21f71204ac07c7e4 Mon Sep 17 00:00:00 2001 From: applenick Date: Fri, 18 Mar 2022 21:10:50 -0700 Subject: [PATCH] Include destroyable sparks for disabled fireworks (#972) Signed-off-by: applenick --- .../tc/oc/pgm/destroyable/Destroyable.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/tc/oc/pgm/destroyable/Destroyable.java b/core/src/main/java/tc/oc/pgm/destroyable/Destroyable.java index 76d321604d..17f5738d7e 100644 --- a/core/src/main/java/tc/oc/pgm/destroyable/Destroyable.java +++ b/core/src/main/java/tc/oc/pgm/destroyable/Destroyable.java @@ -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