forked from kaboomserver/extras
Use String#equals() instead of String == String in ServerCommand.java
This commit is contained in:
parent
55a34972cb
commit
a91c25f8c2
1 changed files with 7 additions and 8 deletions
|
@ -1,11 +1,5 @@
|
||||||
package pw.kaboom.extras.modules.server;
|
package pw.kaboom.extras.modules.server;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import org.bukkit.block.CommandBlock;
|
import org.bukkit.block.CommandBlock;
|
||||||
import org.bukkit.command.BlockCommandSender;
|
import org.bukkit.command.BlockCommandSender;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
@ -14,9 +8,14 @@ import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.server.ServerCommandEvent;
|
import org.bukkit.event.server.ServerCommandEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import pw.kaboom.extras.Main;
|
import pw.kaboom.extras.Main;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public final class ServerCommand implements Listener {
|
public final class ServerCommand implements Listener {
|
||||||
private static final Pattern AS_AT_PATTERN = Pattern.compile(
|
private static final Pattern AS_AT_PATTERN = Pattern.compile(
|
||||||
"\\b(as|at|facing entity) @[ae]\\b");
|
"\\b(as|at|facing entity) @[ae]\\b");
|
||||||
|
@ -117,7 +116,7 @@ public final class ServerCommand implements Listener {
|
||||||
String.join(" ", executeCommand), true, depth + 1);
|
String.join(" ", executeCommand), true, depth + 1);
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
continue;
|
continue;
|
||||||
} else if (result == "cancel") {
|
} else if (result.equals("cancel")) {
|
||||||
return "cancel";
|
return "cancel";
|
||||||
}
|
}
|
||||||
final String pureExecute = String.join(
|
final String pureExecute = String.join(
|
||||||
|
|
Loading…
Reference in a new issue