diff --git a/src/main/java/me/braydon/mc/controller/PlayerController.java b/src/main/java/me/braydon/mc/controller/PlayerController.java index 056487a..a02af13 100644 --- a/src/main/java/me/braydon/mc/controller/PlayerController.java +++ b/src/main/java/me/braydon/mc/controller/PlayerController.java @@ -2,6 +2,7 @@ package me.braydon.mc.controller; import lombok.NonNull; import lombok.extern.log4j.Log4j2; +import me.braydon.mc.common.EnumUtils; import me.braydon.mc.common.PlayerUtils; import me.braydon.mc.exception.impl.BadRequestException; import me.braydon.mc.exception.impl.ResourceNotFoundException; @@ -24,8 +25,8 @@ import org.springframework.web.bind.annotation.*; @RequestMapping(value = "/player", produces = MediaType.APPLICATION_JSON_VALUE) @Log4j2(topic = "Player Controller") public final class PlayerController { - private static final int DEFAULT_HEAD_SIZE = 128; - private static final int MAX_HEAD_SIZE = 512; + private static final int DEFAULT_PART_TEXTURE_SIZE = 128; + private static final int MAX_PART_TEXTURE_SIZE = 512; /** * The Mojang service to use for player information. @@ -42,7 +43,7 @@ public final class PlayerController { * * @param query the query to search for the player by * @return the player response - * @throws BadRequestException if the UUID is malformed + * @throws BadRequestException if the UUID is malformed * @throws ResourceNotFoundException if the player is not found */ @GetMapping("/{query}") @@ -52,34 +53,39 @@ public final class PlayerController { } /** - * Get the head texture of a player - * by their username or UUID. + * Get the part of a skin texture for + * a player by their username or UUID. *
* If the player being searched is * invalid, the default Steve skin * will be used. *
* - * @param query the query to search for the player by - * @param extension the head image extension - * @param size the size of the head image - * @return the head texture + * @param partName the part of the player's skin texture to get + * @param query the query to search for the player by + * @param extension the skin part image extension + * @param size the size of the skin part image + * @return the skin part texture * @throws BadRequestException if the extension is invalid */ - @GetMapping("/head/{query}.{extension}") + @GetMapping("/{partName}/{query}.{extension}") @ResponseBody - public ResponseEntity