more cleanup

This commit is contained in:
Lee
2024-04-08 06:13:03 +01:00
parent 1f45d26f53
commit 4cdffd47fd
10 changed files with 186 additions and 183 deletions

View File

@ -1,5 +1,6 @@
package cc.fascinated.model.player;
import com.google.gson.JsonObject;
import lombok.AllArgsConstructor;
import lombok.Getter;
@ -10,4 +11,17 @@ public class Cape {
* The URL of the cape
*/
private final String url;
/**
* Gets the cape from a {@link JsonObject}.
*
* @param json the JSON object
* @return the cape
*/
public static Cape fromJson(JsonObject json) {
if (json == null) {
return null;
}
return new Cape(json.get("url").getAsString());
}
}