Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CCE due to console literal #4259

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/main/java/ch/njol/skript/expressions/LitConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,25 @@
"send \"message to console\" to the console"})
@Since("1.3.1")
public class LitConsole extends SimpleLiteral<ConsoleCommandSender> {

static {
Skript.registerExpression(LitConsole.class, ConsoleCommandSender.class, ExpressionType.SIMPLE, "[the] (console|server)");
}
private final static ConsoleCommandSender console = Bukkit.getConsoleSender();

private static final ConsoleCommandSender console = Bukkit.getConsoleSender();

public LitConsole() {
super(console, false);
super(new ConsoleCommandSender[]{console}, ConsoleCommandSender.class, true);
}

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

@Override
public String toString(final @Nullable Event e, final boolean debug) {
public String toString(@Nullable Event e, boolean debug) {
return "the console";
}

}