mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-25 13:57:59 +01:00
Add toString method to Pony classes.
This commit is contained in:
parent
29f2f5ee58
commit
4950ba2161
2 changed files with 21 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
package com.minelittlepony;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.minelittlepony.model.PMAPI;
|
||||
import com.minelittlepony.model.PlayerModel;
|
||||
import com.minelittlepony.util.PonyFields;
|
||||
|
@ -155,4 +156,12 @@ public class Pony {
|
|||
public PonyData getMetadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return MoreObjects.toStringHelper(this)
|
||||
.add("texture", texture)
|
||||
.add("metadata", metadata)
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.minelittlepony;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.collect.ImmutableBiMap;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
@ -70,6 +71,17 @@ public class PonyData implements IPonyData {
|
|||
return this.race != null && this.race.hasHorn() && this.glowColor != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return MoreObjects.toStringHelper(this)
|
||||
.add("race", race)
|
||||
.add("tailSize", tailSize)
|
||||
.add("gender", gender)
|
||||
.add("size", size)
|
||||
.add("glowColor", "#" + Integer.toHexString(glowColor))
|
||||
.toString();
|
||||
}
|
||||
|
||||
static PonyData parse(BufferedImage image) {
|
||||
int racePx = TriggerPixels.RACE.readColor(image);
|
||||
PonyRace race = RACE_COLORS.getOrDefault(racePx, PonyRace.HUMAN);
|
||||
|
|
Loading…
Reference in a new issue