diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/BethlehemSkinServer.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/BethlehemSkinServer.java index 5d5667b3..0ae82762 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/BethlehemSkinServer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/BethlehemSkinServer.java @@ -8,7 +8,6 @@ import com.mojang.authlib.yggdrasil.response.MinecraftTexturesPayload; import com.mojang.util.UUIDTypeAdapter; import com.voxelmodpack.hdskins.HDSkinManager; import net.minecraft.util.Session; -import org.apache.commons.lang3.builder.ToStringBuilder; import java.io.IOException; import java.util.Locale; @@ -29,8 +28,8 @@ public class BethlehemSkinServer implements SkinServer { @Override public MinecraftTexturesPayload loadProfileData(GameProfile profile) throws IOException { + // TODO: Fix this try (MoreHttpResponses response = new NetClient("GET", getPath(profile)).send()) { - if (!response.ok()) { throw new IOException(response.getResponse().getStatusLine().getReasonPhrase()); } @@ -85,7 +84,7 @@ public class BethlehemSkinServer implements SkinServer { @Override public String toString() { - return new ToStringBuilder(this, IndentedToStringStyle.INSTANCE) + return new IndentedToStringStyle.Builder(this) .append("address", address) .build(); } diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/IndentedToStringStyle.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/IndentedToStringStyle.java index 44255b78..44d1d521 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/IndentedToStringStyle.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/IndentedToStringStyle.java @@ -1,20 +1,34 @@ package com.voxelmodpack.hdskins.skins; import org.apache.commons.lang3.SystemUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import static net.minecraft.util.text.TextFormatting.*; + public class IndentedToStringStyle extends ToStringStyle { private static final long serialVersionUID = 2031593562293731492L; - public static final ToStringStyle INSTANCE = new IndentedToStringStyle(); + private static final ToStringStyle INSTANCE = new IndentedToStringStyle(); private IndentedToStringStyle() { + this.setFieldNameValueSeparator(": " + RESET + ITALIC); this.setContentStart(null); - this.setFieldSeparator(SystemUtils.LINE_SEPARATOR + " "); + this.setFieldSeparator(SystemUtils.LINE_SEPARATOR + " " + RESET + YELLOW); this.setFieldSeparatorAtStart(true); this.setContentEnd(null); this.setUseIdentityHashCode(false); this.setUseShortClassName(true); } + + public static class Builder extends ToStringBuilder { + public Builder(Object o) { + super(o, IndentedToStringStyle.INSTANCE); + } + + public String build() { + return YELLOW + super.build(); + } + } } diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/LegacySkinServer.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/LegacySkinServer.java index ef177030..9ea4318b 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/LegacySkinServer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/LegacySkinServer.java @@ -10,7 +10,6 @@ import com.mojang.util.UUIDTypeAdapter; import com.voxelmodpack.hdskins.HDSkinManager; import com.voxelmodpack.hdskins.upload.ThreadMultipartPostUpload; import net.minecraft.util.Session; -import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -140,9 +139,9 @@ public class LegacySkinServer implements SkinServer { @Override public String toString() { - return new ToStringBuilder(this, IndentedToStringStyle.INSTANCE) - .append("address", this.address) - .append("gateway", this.gateway) + return new IndentedToStringStyle.Builder(this) + .append("address", address) + .append("gateway", gateway) .build(); } } diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/NetClient.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/NetClient.java index cfce636d..8f7a54c1 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/NetClient.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/NetClient.java @@ -49,5 +49,4 @@ public class NetClient { return MoreHttpResponses.execute(HDSkinManager.httpClient, request); } - } diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/ValhallaSkinServer.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/ValhallaSkinServer.java index c8af92dd..4271d36f 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/ValhallaSkinServer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/ValhallaSkinServer.java @@ -11,7 +11,6 @@ import com.mojang.util.UUIDTypeAdapter; import com.voxelmodpack.hdskins.HDSkinManager; import net.minecraft.client.Minecraft; import net.minecraft.util.Session; -import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.http.HttpHeaders; import org.apache.http.NameValuePair; import org.apache.http.client.methods.HttpGet; @@ -208,8 +207,8 @@ public class ValhallaSkinServer implements SkinServer { @Override public String toString() { - return new ToStringBuilder(this, IndentedToStringStyle.INSTANCE) - .append("address", this.address) + return new IndentedToStringStyle.Builder(this) + .append("address", address) .toString(); }