Fix events not working when no formatting is used
This commit is contained in:
@@ -277,7 +277,8 @@ public abstract class BaseComponent
|
||||
{
|
||||
return color != null || bold != null ||
|
||||
italic != null || underlined != null ||
|
||||
strikethrough != null || obfuscated != null;
|
||||
strikethrough != null || obfuscated != null ||
|
||||
hoverEvent != null || clickEvent != null;
|
||||
}
|
||||
|
||||
public String toPlainText()
|
||||
@@ -320,6 +321,6 @@ public abstract class BaseComponent
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format( "BaseComponent{color=%s, bold=%b, italic=%b, underlined=%b, strikethrough=%b, obfuscated=%b}", getColor().getName(), isBold(), isItalic(), isUnderlined(), isStrikethrough(), isObfuscated() );
|
||||
return String.format( "BaseComponent{color=%s, bold=%b, italic=%b, underlined=%b, strikethrough=%b, obfuscated=%b, clickEvent=%s, hoverEvent=%s}", getColor().getName(), isBold(), isItalic(), isUnderlined(), isStrikethrough(), isObfuscated(), getClickEvent(), getHoverEvent() );
|
||||
}
|
||||
}
|
||||
|
@@ -22,4 +22,9 @@ public class ClickEvent
|
||||
RUN_COMMAND,
|
||||
SUGGEST_COMMAND
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format( "ClickEvent{action=%s, value=%s}", action, value );
|
||||
}
|
||||
}
|
||||
|
@@ -42,4 +42,9 @@ public class HoverEvent
|
||||
SHOW_ACHIEVEMENT,
|
||||
SHOW_ITEM
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format( "HoverEvent{action=%s, value=%s}", action, value );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user