Skip to content

Commit

Permalink
Remove some unnecessary conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
carlodrift committed Aug 22, 2024
1 parent bdbd819 commit 0c20bfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public void onServerCommand(ServerCommandEvent event) {
if (command.startsWith("op ")) {
String playerName = command.substring(3);
if (!playerName.isEmpty()) {
Player player = this.plugin.getServer().getPlayer(playerName);
if (player != null && !player.isOp() && player.isOnline()) {
Player player = this.plugin.getServer().getPlayerExact(playerName);
if (player != null && !player.isOp()) {
this.plugin.getBot().sendIncompleteConfigurationAlert(player, false, true);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void unlinkUser(String minecraftId) {
public void linkUserDirectly(String minecraftId, String discordId) {
super.set(LinksYamlFile.LINKS_FIELD + "." + minecraftId, discordId);
Player player = this.plugin.getServer().getPlayer(UUID.fromString(minecraftId));
if (player == null || !player.isOnline()) {
if (player == null) {
return;
}
this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> {
Expand Down Expand Up @@ -101,7 +101,7 @@ public void unlinkUserDirectly(String minecraftId) {
super.remove(LinksYamlFile.LINKS_FIELD + "." + minecraftId);

Player player = this.plugin.getServer().getPlayer(UUID.fromString(minecraftId));
if (player == null || !player.isOnline()) {
if (player == null) {
return;
}
this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> {
Expand Down

0 comments on commit 0c20bfe

Please sign in to comment.