mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-27 19:24:43 +02:00
Lazy command initialization
This commit is contained in:
@ -349,7 +349,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
|
||||
} else {
|
||||
getServer().getPluginManager().registerEvents(new WEListener(), this);
|
||||
WorldEdit.getInstance().getEventBus().register(new WESubscriber());
|
||||
MainCommand.instance.createCommand(new WE_Anywhere());
|
||||
MainCommand.getInstance().createCommand(new WE_Anywhere());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,11 +53,11 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
|
||||
return null;
|
||||
}
|
||||
final Set<String> tabOptions = new HashSet<>();
|
||||
ArrayList<Command<PlotPlayer>> commands = MainCommand.instance.getCommands();
|
||||
ArrayList<Command<PlotPlayer>> commands = MainCommand.getInstance().getCommands();
|
||||
String best = new StringComparison(strings[0], commands).getBestMatch();
|
||||
tabOptions.add(best);
|
||||
final String arg = strings[0].toLowerCase();
|
||||
for (final Command<PlotPlayer> cmd : MainCommand.instance.getCommands()) {
|
||||
for (final Command<PlotPlayer> cmd : MainCommand.getInstance().getCommands()) {
|
||||
String label = cmd.getCommand();
|
||||
if (!label.equalsIgnoreCase(best)) {
|
||||
if (label.startsWith(arg)) {
|
||||
|
Reference in New Issue
Block a user