@@ -289,10 +289,10 @@ index 0000000000000000000000000000000000000000..7b3b6ef533d32169fbeca389bd61cfc6
289
289
+ }
290
290
+ }
291
291
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
292
- index ece84330d2700db8708d2ae2ab7badf4acb428a8..621420d35378e0038c33892c185216894912f023 100644
292
+ index ece84330d2700db8708d2ae2ab7badf4acb428a8..90c875ad60e473c3ec25f209933d48615d0fd6c0 100644
293
293
--- a/src/main/java/org/bukkit/Bukkit.java
294
294
+++ b/src/main/java/org/bukkit/Bukkit.java
295
- @@ -2092,6 +2092,50 @@ public final class Bukkit {
295
+ @@ -2092,6 +2092,83 @@ public final class Bukkit {
296
296
public static boolean suggestPlayerNamesWhenNullTabCompletions() {
297
297
return server.suggestPlayerNamesWhenNullTabCompletions();
298
298
}
@@ -301,7 +301,7 @@ index ece84330d2700db8708d2ae2ab7badf4acb428a8..621420d35378e0038c33892c18521689
301
301
+ * Creates a PlayerProfile for the specified uuid, with name as null.
302
302
+ *
303
303
+ * If a player with the passed uuid exists on the server at the time of creation, the returned player profile will
304
- + * be populated with the properties of said player.
304
+ + * be populated with the properties of said player (including their uuid and name) .
305
305
+ *
306
306
+ * @param uuid UUID to create profile for
307
307
+ * @return A PlayerProfile object
@@ -315,7 +315,12 @@ index ece84330d2700db8708d2ae2ab7badf4acb428a8..621420d35378e0038c33892c18521689
315
315
+ * Creates a PlayerProfile for the specified name, with UUID as null.
316
316
+ *
317
317
+ * If a player with the passed name exists on the server at the time of creation, the returned player profile will
318
- + * be populated with the properties of said player.
318
+ + * be populated with the properties of said player (including their uuid and name).
319
+ + * <p>
320
+ + * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile("JEB_")} will
321
+ + * yield a profile with the name 'jeb_', their uuid and their textures.
322
+ + * To bypass this pre-population on a case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
323
+ + * <p>
319
324
+ *
320
325
+ * @param name Name to create profile for
321
326
+ * @return A PlayerProfile object
@@ -330,7 +335,15 @@ index ece84330d2700db8708d2ae2ab7badf4acb428a8..621420d35378e0038c33892c18521689
330
335
+ *
331
336
+ * Both UUID and Name can not be null at same time. One must be supplied.
332
337
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
333
- + * profile will be populated with the properties of said player.
338
+ + * profile will be populated with the properties of said player (including their uuid and name).
339
+ + * <p>
340
+ + * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile(null, "JEB_")} will
341
+ + * yield a profile with the name 'jeb_', their uuid and their textures.
342
+ + * To bypass this pre-population on an case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
343
+ + * <p>
344
+ + *
345
+ + * The name comparison will compare the {@link String#toLowerCase()} version of both the passed name parameter and
346
+ + * a players name to honour the case-insensitive nature of a mojang profile lookup.
334
347
+ *
335
348
+ * @param uuid UUID to create profile for
336
349
+ * @param name Name to create profile for
@@ -339,15 +352,35 @@ index ece84330d2700db8708d2ae2ab7badf4acb428a8..621420d35378e0038c33892c18521689
339
352
+ @NotNull
340
353
+ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name) {
341
354
+ return server.createProfile(uuid, name);
355
+ + }
356
+ +
357
+ + /**
358
+ + * Creates an exact PlayerProfile for the specified name/uuid
359
+ + *
360
+ + * Both UUID and Name can not be null at same time. One must be supplied.
361
+ + * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
362
+ + * profile will be populated with the properties of said player.
363
+ + * <p>
364
+ + * Compared to {@link #createProfile(UUID, String)}, this method will never mutate the passed uuid or name.
365
+ + * If a player with either the same uuid or a matching name (case-insensitive) is found on the server, their
366
+ + * properties, such as textures, will be pre-populated in the profile, however the passed uuid and name stay intact.
367
+ + *
368
+ + * @param uuid UUID to create profile for
369
+ + * @param name Name to create profile for
370
+ + * @return A PlayerProfile object
371
+ + */
372
+ + @NotNull
373
+ + public static com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name) {
374
+ + return server.createProfileExact(uuid, name);
342
375
+ }
343
376
// Paper end
344
377
345
378
@NotNull
346
379
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
347
- index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..58c8e74b61dd4d952919a854a374ae7b4c3e02c0 100644
380
+ index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..9796ae6fcf605af88c1e5c1d29d77ea6857632cc 100644
348
381
--- a/src/main/java/org/bukkit/Server.java
349
382
+++ b/src/main/java/org/bukkit/Server.java
350
- @@ -1838,5 +1838,43 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
383
+ @@ -1838,5 +1838,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
351
384
* @return true if player names should be suggested
352
385
*/
353
386
boolean suggestPlayerNamesWhenNullTabCompletions();
@@ -356,7 +389,7 @@ index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..58c8e74b61dd4d952919a854a374ae7b
356
389
+ * Creates a PlayerProfile for the specified uuid, with name as null.
357
390
+ *
358
391
+ * If a player with the passed uuid exists on the server at the time of creation, the returned player profile will
359
- + * be populated with the properties of said player.
392
+ + * be populated with the properties of said player (including their uuid and name) .
360
393
+ *
361
394
+ * @param uuid UUID to create profile for
362
395
+ * @return A PlayerProfile object
@@ -368,7 +401,12 @@ index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..58c8e74b61dd4d952919a854a374ae7b
368
401
+ * Creates a PlayerProfile for the specified name, with UUID as null.
369
402
+ *
370
403
+ * If a player with the passed name exists on the server at the time of creation, the returned player profile will
371
- + * be populated with the properties of said player.
404
+ + * be populated with the properties of said player (including their uuid and name).
405
+ + * <p>
406
+ + * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile("JEB_")} will
407
+ + * yield a profile with the name 'jeb_', their uuid and their textures.
408
+ + * To bypass this pre-population on a case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
409
+ + * <p>
372
410
+ *
373
411
+ * @param name Name to create profile for
374
412
+ * @return A PlayerProfile object
@@ -381,13 +419,39 @@ index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..58c8e74b61dd4d952919a854a374ae7b
381
419
+ *
382
420
+ * Both UUID and Name can not be null at same time. One must be supplied.
383
421
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
384
- + * profile will be populated with the properties of said player.
422
+ + * profile will be populated with the properties of said player (including their uuid and name).
423
+ + * <p>
424
+ + * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile(null, "JEB_")} will
425
+ + * yield a profile with the name 'jeb_', their uuid and their textures.
426
+ + * To bypass this pre-population on an case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
427
+ + * <p>
428
+ + *
429
+ + * The name comparison will compare the {@link String#toLowerCase()} version of both the passed name parameter and
430
+ + * a players name to honour the case-insensitive nature of a mojang profile lookup.
385
431
+ *
386
432
+ * @param uuid UUID to create profile for
387
433
+ * @param name Name to create profile for
388
434
+ * @return A PlayerProfile object
389
435
+ */
390
436
+ @NotNull
391
437
+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name);
438
+ +
439
+ + /**
440
+ + * Creates an exact PlayerProfile for the specified name/uuid
441
+ + *
442
+ + * Both UUID and Name can not be null at same time. One must be supplied.
443
+ + * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
444
+ + * profile will be populated with the properties of said player.
445
+ + * <p>
446
+ + * Compared to {@link #createProfile(UUID, String)}, this method will never mutate the passed uuid or name.
447
+ + * If a player with either the same uuid or a matching name (case-insensitive) is found on the server, their
448
+ + * properties, such as textures, will be pre-populated in the profile, however the passed uuid and name stay intact.
449
+ + *
450
+ + * @param uuid UUID to create profile for
451
+ + * @param name Name to create profile for
452
+ + * @return A PlayerProfile object
453
+ + */
454
+ + @NotNull
455
+ + com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name);
392
456
// Paper end
393
457
}
0 commit comments