mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
feat: Display explosion particles even after the event got canceled (with setting to control behavior) (#3436)
* feat: display explosion particles even after event cancel And add settings option to change behavior * refactor * refactor: Change settings comment to clearer connect to it's purpose.
This commit is contained in:
@ -48,6 +48,7 @@ import com.plotsquared.core.util.Permissions;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Ageable;
|
||||
@ -323,6 +324,10 @@ public class EntityEventListener implements Listener {
|
||||
}
|
||||
}
|
||||
event.setCancelled(true);
|
||||
//Spawn Explosion Particles when enabled in settings
|
||||
if (Settings.General.ALWAYS_SHOW_EXPLOSIONS) {
|
||||
event.getLocation().getWorld().spawnParticle(Particle.EXPLOSION_HUGE, event.getLocation(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
|
Reference in New Issue
Block a user