Check if array is empty in disabled effect (closes #50)

This commit is contained in:
Allink 2022-08-02 02:47:03 +01:00
parent d896179f47
commit a014a38e2f
No known key found for this signature in database
GPG key ID: 6C2F7CE6E0519E14

View file

@ -53,9 +53,14 @@ public class PlexUtils implements PlexBase
public static void disabledEffectMultiple(Player[] players, Location location) public static void disabledEffectMultiple(Player[] players, Location location)
{ {
if (players.length < 1) {
return;
}
Particle.CLOUD.builder().location(location).receivers(players).extra(0).offset(0.5, 0.5, 0.5).count(5).spawn(); Particle.CLOUD.builder().location(location).receivers(players).extra(0).offset(0.5, 0.5, 0.5).count(5).spawn();
Particle.FLAME.builder().location(location).receivers(players).extra(0).offset(0.5, 0.5, 0.5).count(3).spawn(); Particle.FLAME.builder().location(location).receivers(players).extra(0).offset(0.5, 0.5, 0.5).count(3).spawn();
Particle.SOUL_FIRE_FLAME.builder().location(location).receivers(players).offset(0.5, 0.5, 0.5).extra(0).count(2).spawn(); Particle.SOUL_FIRE_FLAME.builder().location(location).receivers(players).offset(0.5, 0.5, 0.5).extra(0).count(2)
.spawn();
// note that the sound is played to everyone who is close enough to hear it // note that the sound is played to everyone who is close enough to hear it
players[0].getWorld().playSound(location, org.bukkit.Sound.BLOCK_FIRE_EXTINGUISH, 0.5f, 0.5f); players[0].getWorld().playSound(location, org.bukkit.Sound.BLOCK_FIRE_EXTINGUISH, 0.5f, 0.5f);
} }