Added method to quickly retrieve the prefix width in Chat API
This commit is contained in:
parent
f243a56af2
commit
152ae89024
@ -453,6 +453,10 @@ public abstract class Chat extends ChatStatic implements HoverEventSource<Compon
|
|||||||
public TextColor broadcastColor = NamedTextColor.YELLOW;
|
public TextColor broadcastColor = NamedTextColor.YELLOW;
|
||||||
public Supplier<Chat> prefix;
|
public Supplier<Chat> prefix;
|
||||||
|
|
||||||
|
public int getPrefixWidth(boolean console) {
|
||||||
|
Chat c = prefix == null ? null : prefix.get();
|
||||||
|
return c == null ? 0 : ChatUtil.componentWidth(c.getAdv(), console);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user