mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 03:25:29 +01:00
Improve JavaDoc documentation of WrappedGameProfile.
This commit is contained in:
parent
ce216d0371
commit
c50bc55f77
@ -99,7 +99,40 @@ 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;
|
||||||
@ -129,33 +162,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.
|
||||||
|
Loading…
Reference in New Issue
Block a user