@@ -57,28 +57,28 @@ public void perform(CommandSender commandSender, String[] args) {
5757 if (target .isOnline ()) {
5858 Player targetPlayer = target .getPlayer ();
5959
60- long min ;
61- long max ;
62- long amount ;
60+ double min ;
61+ double max ;
62+ double amount ;
6363
6464 try {
65- min = Long . parseLong (args [2 ]);
66- max = Long . parseLong (args [3 ]);
67- amount = ThreadLocalRandom .current ().nextLong (min , max );
65+ min = Double . parseDouble (args [2 ]);
66+ max = Double . parseDouble (args [3 ]);
67+ amount = ThreadLocalRandom .current ().nextDouble (min , max );
6868 } catch (NumberFormatException exception ) {
6969 RyMessageUtils .sendSender (commandSender , "invalid-number" );
7070 return ;
7171 }
7272
73- if (amount <= 0 ) {
73+ if (amount < 0 ) {
7474 RyMessageUtils .sendPluginMessage (commandSender , "invalid-number" , Placeholders .setPlaceholders (commandSender ));
7575 return ;
7676 }
7777
7878 if (commandSender instanceof Player player )
79- SimpleGems .getInstance ().getGemsAPI ().giveGems (player , targetPlayer , ( double ) amount );
79+ SimpleGems .getInstance ().getGemsAPI ().giveGems (player , targetPlayer , amount );
8080 else
81- SimpleGems .getInstance ().getGemsAPI ().giveGems (targetPlayer , ( double ) amount );
81+ SimpleGems .getInstance ().getGemsAPI ().giveGems (targetPlayer , amount );
8282
8383 StringPlaceholders placeholders = StringPlaceholders .builder ()
8484 .addAll (Placeholders .setPlaceholders (targetPlayer ))
@@ -94,25 +94,25 @@ public void perform(CommandSender commandSender, String[] args) {
9494 RyMessageUtils .sendPluginMessage (commandSender , "gems-given" , placeholders );
9595 RyMessageUtils .sendPluginMessage (targetPlayer , "gems-gained" , placeholders );
9696 } else if (target .hasPlayedBefore ()) {
97- long min ;
98- long max ;
99- long amount ;
97+ double min ;
98+ double max ;
99+ double amount ;
100100
101101 try {
102- min = Long . parseLong (args [2 ]);
103- max = Long . parseLong (args [3 ]);
104- amount = ThreadLocalRandom .current ().nextLong (min , max );
102+ min = Double . parseDouble (args [2 ]);
103+ max = Double . parseDouble (args [3 ]);
104+ amount = ThreadLocalRandom .current ().nextDouble (min , max );
105105 } catch (NumberFormatException exception ) {
106106 RyMessageUtils .sendSender (commandSender , "invalid-number" );
107107 return ;
108108 }
109109
110- if (amount <= 0 ) {
110+ if (amount < 0 ) {
111111 RyMessageUtils .sendPluginMessage (commandSender , "invalid-number" , Placeholders .setPlaceholders (commandSender ));
112112 return ;
113113 }
114114
115- SimpleGems .getInstance ().getGemsAPI ().giveOfflineGems (target , ( double ) amount );
115+ SimpleGems .getInstance ().getGemsAPI ().giveOfflineGems (target , amount );
116116
117117 StringPlaceholders placeholders = StringPlaceholders .builder ()
118118 .addAll (Placeholders .setPlaceholders (commandSender ))
0 commit comments