File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
src/main/java/dev/hause/squeakerbot/command/commands Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 11package dev .hause .squeakerbot .command .commands ;
22
33import java .util .Random ;
4-
54import dev .hause .squeakerbot .command .Command ;
6- import net . minecraft . network . play . client . CPacketChatMessage ;
5+ import dev . hause . squeakerbot . util . ChatUtil ;
76
87public class CoinFlip extends Command {
98
9+ private static String [] outcomes = {"> [SqueakerBot] The coin flip results in Heads!" , "> [SqueakerBot] The coin flip results in Tails!" };
10+
1011 public CoinFlip () {
1112 super ("CoinFlip" , new String [] {"CoinFlip" , "Coin" , "Flip" });
1213 }
1314
1415 @ Override
1516 public void onRun () {
1617 Random random = new Random ();
17- int randomNum = random .nextInt ((1 + 0 ) + 1 ) + 0 ;
18- if (randomNum == 1 ) {
19- mc .player .connection .sendPacket (new CPacketChatMessage ("> [SqueakerBot] The coin flip results in Heads!" ));
20- } else if (randomNum == 0 ){
21- mc .player .connection .sendPacket (new CPacketChatMessage ("> [SqueakerBot] The coin flip results in Tails!" ));
22- }
18+ ChatUtil .sendChatMessage (outcomes [random .nextInt (2 )]);
2319 }
2420
2521
You can’t perform that action at this time.
0 commit comments