Skip to content

Commit

Permalink
Improve new line pattern. (#6733)
Browse files Browse the repository at this point in the history
* Make new line literal not silly.

* Clean init header.

---------

Co-authored-by: sovdee <[email protected]>
  • Loading branch information
Moderocky and sovdeeth authored Jul 1, 2024
1 parent 7d84902 commit 1d587d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/ch/njol/skript/expressions/LitNewLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package ch.njol.skript.expressions;

import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;

import ch.njol.skript.Skript;
import ch.njol.skript.doc.Description;
Expand All @@ -28,9 +27,10 @@
import ch.njol.skript.doc.Since;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleLiteral;
import ch.njol.util.Kleenean;
import org.jetbrains.annotations.Nullable;

@Name("New Line")
@Description("Returns a line break separator.")
Expand All @@ -39,20 +39,20 @@
public class LitNewLine extends SimpleLiteral<String> {

static {
Skript.registerExpression(LitNewLine.class, String.class, ExpressionType.SIMPLE, "n[ew]l[ine]", "line[ ]break");
Skript.registerExpression(LitNewLine.class, String.class, ExpressionType.SIMPLE, "nl", "new[ ]line", "line[ ]break");
}

public LitNewLine() {
super("\n", false);
}

@Override
public boolean init(final Expression<?>[] exprs, final int matchedPattern, final Kleenean isDelayed, final SkriptParser.ParseResult parseResult) {
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, ParseResult result) {
return true;
}

@Override
public String toString(@Nullable Event e, boolean debug) {
return "newline";
public String toString(@Nullable Event event, boolean debug) {
return "new line";
}
}

0 comments on commit 1d587d4

Please sign in to comment.