Fixed various bugs with skin uploading

This commit is contained in:
Sollace 2018-07-03 19:06:14 +02:00
parent ec8efcaa76
commit 5e371b2037
3 changed files with 5 additions and 2 deletions

View file

@ -88,6 +88,7 @@ public class GuiSkins extends GuiScreen implements FutureCallback<SkinUploadResp
Minecraft minecraft = Minecraft.getMinecraft();
// this.screenTitle = manager;
GameProfile profile = minecraft.getSession().getProfile();
this.localPlayer = getModel(profile);
this.remotePlayer = getModel(profile);
RenderManager rm = Minecraft.getMinecraft().getRenderManager();

View file

@ -106,7 +106,7 @@ public class LegacySkinServer implements SkinServer {
private static Map<String, ?> getData(Session session, MinecraftProfileTexture.Type type, String model, String param, Object val) {
return ImmutableMap.of(
"user", session.getUsername(),
"uuid", session.getPlayerID(),
"uuid", UUIDTypeAdapter.fromUUID(session.getProfile().getId()),
"type", type.toString().toLowerCase(Locale.US),
"model", model,
param, val);

View file

@ -80,11 +80,13 @@ public class ThreadMultipartPostUpload {
if (paramData instanceof Path) {
Path uploadPath = (Path) paramData;
outputStream.writeBytes("Content-Disposition: form-data; name=\"" + paramName + "\"; filename=\"" + uploadPath.getFileName() + "\"" + CRLF + CRLF);
outputStream.writeBytes("Content-Disposition: form-data; name=\"" + paramName + "\"; filename=\"" + uploadPath.getFileName() + "\"" + CRLF);
outputStream.writeBytes("Content-Type: image/png" + CRLF + CRLF);
Files.copy(uploadPath, outputStream);
} else {
outputStream.writeBytes("Content-Disposition: form-data; name=\"" + paramName + "\"" + CRLF + CRLF);
outputStream.writeBytes(paramData.toString());
}