fix skin part tests
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m44s

This commit is contained in:
Lee 2024-04-12 18:50:17 +01:00
parent a1ad295e0c
commit e788ae003f

@ -5,6 +5,7 @@ import cc.fascinated.common.PlayerUtils;
import cc.fascinated.common.Tuple; import cc.fascinated.common.Tuple;
import cc.fascinated.common.UUIDUtils; import cc.fascinated.common.UUIDUtils;
import cc.fascinated.config.Config; import cc.fascinated.config.Config;
import cc.fascinated.exception.impl.BadRequestException;
import cc.fascinated.exception.impl.MojangAPIRateLimitException; import cc.fascinated.exception.impl.MojangAPIRateLimitException;
import cc.fascinated.exception.impl.RateLimitException; import cc.fascinated.exception.impl.RateLimitException;
import cc.fascinated.exception.impl.ResourceNotFoundException; import cc.fascinated.exception.impl.ResourceNotFoundException;
@ -132,9 +133,8 @@ public class PlayerService {
size = 512; size = 512;
} }
ISkinPart part = ISkinPart.getByName(partName); // The skin part to get ISkinPart part = ISkinPart.getByName(partName); // The skin part to get
if (part == null) { // Default to the face if (part == null) {
part = ISkinPart.Vanilla.FACE; throw new BadRequestException("Invalid skin part: %s".formatted(partName));
log.warn("Invalid skin part {}, defaulting to {}", partName, part.name());
} }
log.info("Getting skin part {} for player: {}", part.name(), player.getUniqueId()); log.info("Getting skin part {} for player: {}", part.name(), player.getUniqueId());