Fix events not working when no formatting is used

This commit is contained in:
Thinkofdeath
2013-12-07 13:59:00 +00:00
parent 60e2e6bfa4
commit 0040955204
5 changed files with 22 additions and 13 deletions

View File

@@ -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() );
}
}

View File

@@ -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 );
}
}

View File

@@ -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 );
}
}