From e788ae003fcf4c7c8004dafbbf587ff367318957 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 12 Apr 2024 18:50:17 +0100 Subject: [PATCH] fix skin part tests --- src/main/java/cc/fascinated/service/PlayerService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/cc/fascinated/service/PlayerService.java b/src/main/java/cc/fascinated/service/PlayerService.java index c2c404d..35efc13 100644 --- a/src/main/java/cc/fascinated/service/PlayerService.java +++ b/src/main/java/cc/fascinated/service/PlayerService.java @@ -5,6 +5,7 @@ import cc.fascinated.common.PlayerUtils; import cc.fascinated.common.Tuple; import cc.fascinated.common.UUIDUtils; import cc.fascinated.config.Config; +import cc.fascinated.exception.impl.BadRequestException; import cc.fascinated.exception.impl.MojangAPIRateLimitException; import cc.fascinated.exception.impl.RateLimitException; import cc.fascinated.exception.impl.ResourceNotFoundException; @@ -132,9 +133,8 @@ public class PlayerService { size = 512; } ISkinPart part = ISkinPart.getByName(partName); // The skin part to get - if (part == null) { // Default to the face - part = ISkinPart.Vanilla.FACE; - log.warn("Invalid skin part {}, defaulting to {}", partName, part.name()); + if (part == null) { + throw new BadRequestException("Invalid skin part: %s".formatted(partName)); } log.info("Getting skin part {} for player: {}", part.name(), player.getUniqueId());