Skip to content

Commit 0f2b73a

Browse files
committed
fix pru playtime commands
1 parent ae21b68 commit 0f2b73a

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pitest {
1414
}
1515

1616
group 'sh.okx'
17-
version '3.14.3'
17+
version '3.14.4'
1818

1919
java {
2020
sourceCompatibility = JavaVersion.VERSION_1_8

src/main/java/sh/okx/rankup/commands/InfoCommand.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package 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;
83
import org.bukkit.Bukkit;
94
import org.bukkit.ChatColor;
105
import org.bukkit.Statistic;
@@ -24,6 +19,8 @@
2419
import sh.okx.rankup.ranks.Rankups;
2520
import sh.okx.rankup.util.UpdateNotifier;
2621

22+
import java.util.*;
23+
2724
public 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

Comments
 (0)