mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 23:48:00 +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 javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.logging.log4j.util.Strings;
|
import org.apache.logging.log4j.util.Strings;
|
||||||
|
|
||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
|
@ -64,7 +63,7 @@ public abstract class AbstractSkinServer implements SkinServer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, IndentedToStringStyle.INSTANCE)
|
return new IndentedToStringStyle.Builder(this)
|
||||||
.append("address", address)
|
.append("address", address)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
@ -76,11 +75,4 @@ public class BethlehemSkinServer extends AbstractSkinServer {
|
||||||
private String getPath(GameProfile profile) {
|
private String getPath(GameProfile profile) {
|
||||||
return String.format("%s/profile/%s", address, UUIDTypeAdapter.fromUUID(profile.getId()));
|
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;
|
package com.voxelmodpack.hdskins.skins;
|
||||||
|
|
||||||
import org.apache.commons.lang3.SystemUtils;
|
import org.apache.commons.lang3.SystemUtils;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import static net.minecraft.util.text.TextFormatting.*;
|
||||||
|
|
||||||
public class IndentedToStringStyle extends ToStringStyle {
|
public class IndentedToStringStyle extends ToStringStyle {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2031593562293731492L;
|
private static final long serialVersionUID = 2031593562293731492L;
|
||||||
|
|
||||||
public static final ToStringStyle INSTANCE = new IndentedToStringStyle();
|
private static final ToStringStyle INSTANCE = new IndentedToStringStyle();
|
||||||
|
|
||||||
private IndentedToStringStyle() {
|
private IndentedToStringStyle() {
|
||||||
|
this.setFieldNameValueSeparator(": " + RESET + ITALIC);
|
||||||
this.setContentStart(null);
|
this.setContentStart(null);
|
||||||
this.setFieldSeparator(SystemUtils.LINE_SEPARATOR + " ");
|
this.setFieldSeparator(SystemUtils.LINE_SEPARATOR + " " + RESET + YELLOW);
|
||||||
this.setFieldSeparatorAtStart(true);
|
this.setFieldSeparatorAtStart(true);
|
||||||
this.setContentEnd(null);
|
this.setContentEnd(null);
|
||||||
this.setUseIdentityHashCode(false);
|
this.setUseIdentityHashCode(false);
|
||||||
this.setUseShortClassName(true);
|
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 com.mojang.util.UUIDTypeAdapter;
|
||||||
|
|
||||||
import net.minecraft.util.Session;
|
import net.minecraft.util.Session;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
@ -130,7 +129,7 @@ public class LegacySkinServer extends AbstractSkinServer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, IndentedToStringStyle.INSTANCE)
|
return new IndentedToStringStyle.Builder(this)
|
||||||
.append("address", address)
|
.append("address", address)
|
||||||
.append("gateway", gateway)
|
.append("gateway", gateway)
|
||||||
.build();
|
.build();
|
||||||
|
|
Loading…
Reference in a new issue