11package sh .okx .rankup .commands ;
22
3- import java .util .ArrayList ;
4- import java .util .Collections ;
5- import java .util .HashSet ;
6- import java .util .List ;
7- import java .util .Set ;
83import org .bukkit .Bukkit ;
94import org .bukkit .ChatColor ;
105import org .bukkit .Statistic ;
2419import sh .okx .rankup .ranks .Rankups ;
2520import sh .okx .rankup .util .UpdateNotifier ;
2621
22+ import java .util .*;
23+
2724public class InfoCommand implements TabExecutor {
2825 private final RankupPlugin plugin ;
2926
@@ -262,7 +259,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
262259 }
263260
264261 player .setStatistic (playOneTick , minutes * 20 * 60 );
265- player .sendMessage (ChatColor .LIGHT_PURPLE + "Updated playtime for " + player .getName () + " to " + minutes + " minutes" );
262+ sender .sendMessage (ChatColor .LIGHT_PURPLE + "Updated playtime for " + player .getName () + " to " + minutes + " minutes" );
266263 return true ;
267264 } else if (args [1 ].equalsIgnoreCase ("add" ) && sender .hasPermission ("rankup.playtime" )) {
268265 if (args .length < 4 ) {
@@ -289,13 +286,13 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
289286 player .incrementStatistic (playOneTick , minutes * 20 * 60 );
290287 } else if (minutes < 0 ) {
291288 if (oldMinutes + minutes < 0 ) {
292- player .sendMessage (ChatColor .GRAY + "Playtime cannot be negative" );
289+ sender .sendMessage (ChatColor .GRAY + "Playtime cannot be negative" );
293290 return true ;
294291 }
295292 player .decrementStatistic (playOneTick , -minutes * 20 * 60 );
296293 }
297294 int newMinutes = oldMinutes + minutes ;
298- player .sendMessage (ChatColor .LIGHT_PURPLE + "Increased playtime for " + player .getName () + " to " + oldMinutes + (minutes >= 0 ? "+" : "" ) + minutes + "=" + newMinutes + " minutes" );
295+ sender .sendMessage (ChatColor .LIGHT_PURPLE + "Increased playtime for " + player .getName () + " to " + oldMinutes + (minutes >= 0 ? "+" : "" ) + minutes + "=" + newMinutes + " minutes" );
299296 return true ;
300297 }
301298 }
0 commit comments