Skip to content

Commit da4c8a4

Browse files
hacky fix for getUUIDFromName, will be better once we get libUsernames
1 parent 28347f6 commit da4c8a4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/java/org/retrohaven/mc/notes/commands/NoteCommand.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ public Object getUUIDFromName(String playerName) {
9494
JSONObject jsonobj = new JSONObject(content.toString());
9595
if (jsonobj.has("errorMessage")) {
9696
// couldn't find a profile with this name
97-
return null;
97+
return "null";
9898
}
9999
return jsonobj.getString("id");
100100
} catch (Exception e) {
101101
// probably network error. nothing we can do.
102102
// unlikely to happen realistically though
103-
return null;
103+
return "null";
104104
}
105105
});
106106
} catch (ExecutionException e) {
107-
return null;
107+
return "null";
108108
}
109109
}
110110

@@ -119,7 +119,7 @@ public boolean NoteAdd(CommandSender sender, String[] args, String type) {
119119
}
120120
String requestSubject = args[1];
121121
Object subjectUUID = this.getUUIDFromName(requestSubject);
122-
if (subjectUUID == null) {
122+
if (subjectUUID == "null") {
123123
sender.sendMessage(errorColorCode+"Player doesn't exist.");
124124
return false;
125125
}
@@ -231,7 +231,7 @@ public boolean NoteRemove(CommandSender sender, String[] args) {
231231

232232
String requestSubject = args[1];
233233
Object subjectUUID = this.getUUIDFromName(requestSubject);
234-
if (subjectUUID == null) {
234+
if (subjectUUID == "null") {
235235
sender.sendMessage(errorColorCode+"Player doesn't exist.");
236236
return true;
237237
}
@@ -356,7 +356,7 @@ public boolean NoteList(CommandSender sender, String[] args, boolean isListener)
356356
}
357357

358358
Object subjectUUID = this.getUUIDFromName(RequestSubject);
359-
if (subjectUUID == null) {
359+
if (subjectUUID == "null") {
360360
if (!isListener) sender.sendMessage(errorColorCode+"Player doesn't exist.");
361361
return true;
362362
}

0 commit comments

Comments
 (0)