Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Aug 17, 2022
1 parent c12e39e commit fbdfe9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ default boolean showModelBackwards() {
return false;
}

default Property getExtendedProperty(Player player, MinecraftProfileTexture.Type type, String textureUrl, String metadata) {
default Property getExtendedProperty(Player player, MinecraftProfileTexture.Type type, String textureUrl, JsonObject metadata) {
var current = player.getGameProfile().getProperties().get(SkinManager.PROPERTY_TEXTURES).stream().findFirst();
String json;
if (current.isEmpty()) {
Expand Down Expand Up @@ -75,7 +75,7 @@ default Property getExtendedProperty(Player player, MinecraftProfileTexture.Type
}

if (metadata != null) {
texture.addProperty("metadata", metadata);
texture.add("metadata", metadata);
}

String value = new String(Base64.getEncoder().encode(jsonPayload.toString().getBytes()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.samo_lego.fabrictailor.client.screen.tabs;

import com.google.gson.JsonObject;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.properties.Property;
import com.mojang.datafixers.util.Pair;
Expand Down Expand Up @@ -71,8 +72,11 @@ public Optional<Pair<ResourceLocation, FriendlyByteBuf>> getSkinChangePacket(Loc
channel = FABRICTAILOR_VANILLA_CHANGE;
} else {
// HD skin (not vanilla compatible)
String metadata = null;
if (useSlim) metadata = "\"metadata\": {\"model\" : \"slim\"}";
JsonObject metadata = null;
if (useSlim) {
metadata = new JsonObject();
metadata.addProperty("model", "slim");
}

skinData = this.getExtendedProperty(player, MinecraftProfileTexture.Type.SKIN, url, metadata);
channel = FABRICTAILOR_HD_CHANGE;
Expand Down

0 comments on commit fbdfe9b

Please sign in to comment.