mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Fix command registration
This commit is contained in:
parent
457f3e25cc
commit
7cd1e8ea76
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user