Fix command registration

This commit is contained in:
Alexander Söderberg 2020-08-17 04:39:59 +02:00
parent 457f3e25cc
commit 7cd1e8ea76
No known key found for this signature in database
GPG Key ID: C0207FF7EA146678
2 changed files with 11 additions and 2 deletions

View File

@ -42,6 +42,8 @@ import com.plotsquared.core.util.Expression;
import com.plotsquared.core.util.Permissions;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.LinkedList;
@ -55,6 +57,8 @@ import java.util.concurrent.CompletableFuture;
aliases = {"plots", "p", "plotsquared", "plot2", "p2", "ps", "2", "plotme", "plotz", "ap"})
public class MainCommand extends Command {
private static final Logger logger = LoggerFactory.getLogger("P2/" + MainCommand.class.getSimpleName());
private static MainCommand instance;
public Help help;
public Toggle toggle;
@ -144,7 +148,12 @@ public class MainCommand extends Command {
}
for (final Class<? extends Command> command : commands) {
try {
injector.getInstance(command);
} catch (final Exception e) {
logger.error("Failed to register command {}", command.getCanonicalName());
e.printStackTrace();
}
}
// Referenced commands

View File

@ -158,7 +158,7 @@ public class ConsolePlayer extends PlotPlayer<Actor> {
lastPlot.set(location.getPlot());
}
}
try (final MetaDataAccess<Location> locationMetaDataAccess = accessPersistentMetaData(PlayerMetaDataKeys.TEMPORARY_LOCATION)) {
try (final MetaDataAccess<Location> locationMetaDataAccess = accessTemporaryMetaData(PlayerMetaDataKeys.TEMPORARY_LOCATION)) {
locationMetaDataAccess.set(location);
}
}