File tree Expand file tree Collapse file tree
src/main/java/com/nextplugins/sorteios/executor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ plugins {
77}
88
99group = ' com.nextplugins'
10- version = ' 1.0.2 '
10+ version = ' 1.0.3 '
1111
1212tasks. build. dependsOn(' shadowJar' )
1313
Original file line number Diff line number Diff line change 44import com .nextplugins .sorteios .api .events .sorted .AsyncSortedPlayerEvent ;
55import com .nextplugins .sorteios .api .prize .Prize ;
66import com .nextplugins .sorteios .manager .PrizeManager ;
7+ import com .nextplugins .sorteios .utils .MessageUtils ;
78import lombok .NoArgsConstructor ;
89import org .bukkit .Bukkit ;
10+ import org .bukkit .Sound ;
911import org .bukkit .entity .Player ;
1012import org .bukkit .plugin .PluginManager ;
1113
@@ -36,6 +38,18 @@ public void run() {
3638 .filter (value -> !value .hasPermission (prize .getSortBanPermission ()))
3739 .collect (Collectors .toList ());
3840
41+ if (onlinePlayers .isEmpty ()) {
42+
43+ MessageUtils .sendSoundAndTitle (
44+ "&c&LERRO{nl}&fNão tem nenhum jogador elegível para o prêmio" ,
45+ Sound .ENTITY_CREEPER_HURT ,
46+ 90
47+ );
48+
49+ return ;
50+
51+ }
52+
3953 int randomNumberPlayer = RANDOM .nextInt (onlinePlayers .size ());
4054 Player player = (Player ) onlinePlayers .toArray ()[randomNumberPlayer ];
4155
You can’t perform that action at this time.
0 commit comments