Skip to content

Commit 2ce8af6

Browse files
committedMar 7, 2025·
feat: Better checks on UserImpl#isConsole & UserImpl#isPlayer
1 parent bebaa8d commit 2ce8af6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎api/src/main/java/me/adrigamer2950/adriapi/api/user/UserImpl.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import me.adrigamer2950.adriapi.api.colors.Colors;
44
import net.kyori.adventure.text.Component;
5-
import org.bukkit.Bukkit;
65
import org.bukkit.command.CommandSender;
76
import org.bukkit.command.ConsoleCommandSender;
87
import org.bukkit.entity.Player;
@@ -28,12 +27,12 @@ public class UserImpl implements User {
2827

2928
@Override
3029
public boolean isConsole() {
31-
return Bukkit.getConsoleSender().equals(sender);
30+
return sender instanceof ConsoleCommandSender;
3231
}
3332

3433
@Override
3534
public boolean isPlayer() {
36-
return !isConsole();
35+
return sender instanceof Player;
3736
}
3837

3938
@Override

0 commit comments

Comments
 (0)
Please sign in to comment.