mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 22:38:00 +01:00
Fixed various bugs with skin uploading
This commit is contained in:
parent
ec8efcaa76
commit
5e371b2037
3 changed files with 5 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue