add size limit to player images
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Has been cancelled
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Has been cancelled
This commit is contained in:
parent
bfbaf34b24
commit
977a1dcbc4
@ -124,6 +124,10 @@ public class PlayerService {
|
||||
* @return the skin part
|
||||
*/
|
||||
public CachedPlayerSkinPart getSkinPart(Player player, Skin.Parts part, boolean renderOverlay, int size) {
|
||||
if (size > 1024) {
|
||||
log.info("Size {} is too large, setting to 1024", size);
|
||||
size = 1024;
|
||||
}
|
||||
log.info("Getting skin part {} for player: {}", part.getName(), player.getUniqueId());
|
||||
String key = "%s-%s-%s".formatted(player.getUniqueId(), part.getName(), size);
|
||||
Optional<CachedPlayerSkinPart> cache = playerSkinPartCacheRepository.findById(key);
|
||||
|
@ -50,8 +50,8 @@ public class IsometricHeadRenderer extends SkinRenderer {
|
||||
x = xOffset;
|
||||
y = -0.5;
|
||||
z = zOffset;
|
||||
// The head is offset by 1 pixel for whatever reason
|
||||
drawPart(graphics, headTop, HEAD_TRANSFORM, y - z, x + z, headTop.getWidth(), headTop.getHeight() + 1);
|
||||
// The head is offset by 2 pixels for whatever reason
|
||||
drawPart(graphics, headTop, HEAD_TRANSFORM, y - z, x + z, headTop.getWidth(), headTop.getHeight() + 2);
|
||||
|
||||
// Draw the front of the head
|
||||
x = xOffset + 8 * scale;
|
||||
|
Loading…
Reference in New Issue
Block a user