mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 15:37:59 +01:00
Add some colour to the skin server info window
This commit is contained in:
parent
834c5c6daa
commit
c1676bf778
4 changed files with 18 additions and 14 deletions
|
@ -9,7 +9,6 @@ import java.util.concurrent.CompletableFuture;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
|
||||
import com.google.gson.JsonParseException;
|
||||
|
@ -64,7 +63,7 @@ public abstract class AbstractSkinServer implements SkinServer {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, IndentedToStringStyle.INSTANCE)
|
||||
return new IndentedToStringStyle.Builder(this)
|
||||
.append("address", address)
|
||||
.build();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.io.IOException;
|
|||
import java.net.URI;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
@ -76,11 +75,4 @@ public class BethlehemSkinServer extends AbstractSkinServer {
|
|||
private String getPath(GameProfile profile) {
|
||||
return String.format("%s/profile/%s", address, UUIDTypeAdapter.fromUUID(profile.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, IndentedToStringStyle.INSTANCE)
|
||||
.append("address", address)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import com.mojang.authlib.yggdrasil.response.MinecraftTexturesPayload;
|
|||
import com.mojang.util.UUIDTypeAdapter;
|
||||
|
||||
import net.minecraft.util.Session;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
@ -130,7 +129,7 @@ public class LegacySkinServer extends AbstractSkinServer {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, IndentedToStringStyle.INSTANCE)
|
||||
return new IndentedToStringStyle.Builder(this)
|
||||
.append("address", address)
|
||||
.append("gateway", gateway)
|
||||
.build();
|
||||
|
|
Loading…
Reference in a new issue