Skip to content

Commit c50f858

Browse files
committed
Cleanup ExprCustomEvent toString
1 parent 0ce9079 commit c50f858

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/main/java/org/skriptlang/reflect/syntax/custom/event/elements/ExprCustomEvent.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,10 @@ public Class<? extends Event> getReturnType() {
9595
@Override
9696
public String toString(@Nullable Event event, boolean debug) {
9797
SyntaxStringBuilder builder = new SyntaxStringBuilder(event, debug);
98-
builder.append("custom event", name);
99-
if (eventValues != null)
100-
builder.append("with event-values", eventValues);
101-
if (eventValues != null && dataValues != null)
102-
builder.append("and");
103-
if (dataValues != null)
104-
builder.append("with data", dataValues);
98+
builder.append("custom event", name)
99+
.appendIf(eventValues != null, "with event-values", eventValues)
100+
.appendIf(eventValues != null && dataValues != null, "and")
101+
.appendIf(dataValues != null, "with data", dataValues);
105102
return builder.toString();
106103
}
107104

0 commit comments

Comments
 (0)