add working skin layers and rename param for overlay
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m35s

This commit is contained in:
Lee
2024-04-11 06:33:51 +01:00
parent f63d1cc3ec
commit 9b7b761ffd
5 changed files with 18 additions and 21 deletions

View File

@ -49,7 +49,7 @@ public class PlayerController {
@Parameter(description = "The part of the skin", example = "head") @PathVariable String part,
@Parameter(description = "The UUID or Username of the player", example = "ImFascinated") @PathVariable String id,
@Parameter(description = "The size of the image", example = "256") @RequestParam(required = false, defaultValue = "256") int size,
@Parameter(description = "Whether to render the skin overlay (skin layers)", example = "false") @RequestParam(required = false, defaultValue = "false") boolean renderOverlay,
@Parameter(description = "Whether to render the skin overlay (skin layers)", example = "false") @RequestParam(required = false, defaultValue = "false") boolean overlay,
@Parameter(description = "Whether to download the image") @RequestParam(required = false, defaultValue = "false") boolean download) {
CachedPlayer player = playerService.getPlayer(id);
Skin.Parts skinPart = Skin.Parts.fromName(part);
@ -60,6 +60,6 @@ public class PlayerController {
.cacheControl(cacheControl)
.contentType(MediaType.IMAGE_PNG)
.header(HttpHeaders.CONTENT_DISPOSITION, dispositionHeader.formatted(player.getUsername()))
.body(playerService.getSkinPart(player, skinPart, renderOverlay, size).getBytes());
.body(playerService.getSkinPart(player, skinPart, overlay, size).getBytes());
}
}