mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 11:36:51 +01:00
Improve JavaDoc documentation of WrappedGameProfile.
This commit is contained in:
parent
ce216d0371
commit
c50bc55f77
@ -100,6 +100,39 @@ public class WrappedGameProfile extends AbstractWrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a new game profile with the given properties.
|
||||||
|
* <p>
|
||||||
|
* Note that at least one of the parameters must be non-null.
|
||||||
|
* @param uuid - the UUID of the player, or NULL.
|
||||||
|
* @param name - the name of the player, or NULL.
|
||||||
|
*/
|
||||||
|
public WrappedGameProfile(UUID uuid, String name) {
|
||||||
|
super(GameProfile.class);
|
||||||
|
|
||||||
|
if (CREATE_STRING_STRING != null) {
|
||||||
|
setHandle(CREATE_STRING_STRING.invoke(uuid != null ? uuid.toString() : null, name));
|
||||||
|
} else {
|
||||||
|
setHandle(new GameProfile(uuid, name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a wrapper around an existing game profile.
|
||||||
|
* @param profile - the underlying profile, or NULL.
|
||||||
|
*/
|
||||||
|
public static WrappedGameProfile fromHandle(Object handle) {
|
||||||
|
if (handle == null)
|
||||||
|
return null;
|
||||||
|
return new WrappedGameProfile(handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse an UUID using very lax rules, as specified in {@link #WrappedGameProfile(UUID, String)}.
|
||||||
|
* @param id - text.
|
||||||
|
* @return The corresponding UUID.
|
||||||
|
* @throws IllegalArgumentException If we cannot parse the text.
|
||||||
|
*/
|
||||||
private static UUID parseUUID(String id) {
|
private static UUID parseUUID(String id) {
|
||||||
if (id == null)
|
if (id == null)
|
||||||
return null;
|
return null;
|
||||||
@ -130,33 +163,6 @@ public class WrappedGameProfile extends AbstractWrapper {
|
|||||||
return UUID.fromString(id);
|
return UUID.fromString(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct a new game profile with the given properties.
|
|
||||||
* <p>
|
|
||||||
* Note that at least one of the parameters must be non-null.
|
|
||||||
* @param uuid - the UUID of the player, or NULL.
|
|
||||||
* @param name - the name of the player, or NULL.
|
|
||||||
*/
|
|
||||||
public WrappedGameProfile(UUID uuid, String name) {
|
|
||||||
super(GameProfile.class);
|
|
||||||
|
|
||||||
if (CREATE_STRING_STRING != null) {
|
|
||||||
setHandle(CREATE_STRING_STRING.invoke(uuid != null ? uuid.toString() : null, name));
|
|
||||||
} else {
|
|
||||||
setHandle(new GameProfile(uuid, name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Construct a wrapper around an existing game profile.
|
|
||||||
* @param profile - the underlying profile, or NULL.
|
|
||||||
*/
|
|
||||||
public static WrappedGameProfile fromHandle(Object handle) {
|
|
||||||
if (handle == null)
|
|
||||||
return null;
|
|
||||||
return new WrappedGameProfile(handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the UUID of the player.
|
* Retrieve the UUID of the player.
|
||||||
* <p>
|
* <p>
|
||||||
|
Loading…
Reference in New Issue
Block a user