Register `/geyser stop` only on standalone (#2569)

We don't want to condone stopping Geyser in the middle of a plugin session, especially when there's no way to start it back up again.
This commit is contained in:
Jens Collaert 2021-10-13 19:09:19 +02:00 committed by GitHub
parent 52ef3d392a
commit 7454033277
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -22,8 +22,6 @@ permissions:
description: Puts an items in your offhand.
geyser.command.reload:
description: Reloads the Geyser configurations. Kicks all players when used!
geyser.command.shutdown:
description: Shuts down Geyser.
geyser.command.statistics:
description: Shows the statistics of the player on the server.
geyser.command.version:

View File

@ -27,6 +27,7 @@ package org.geysermc.connector.command;
import lombok.Getter;
import org.geysermc.common.PlatformType;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.command.defaults.*;
import org.geysermc.connector.network.session.GeyserSession;
@ -47,13 +48,15 @@ public abstract class CommandManager {
registerCommand(new HelpCommand(connector, "help", "geyser.commands.help.desc", "geyser.command.help"));
registerCommand(new ListCommand(connector, "list", "geyser.commands.list.desc", "geyser.command.list"));
registerCommand(new ReloadCommand(connector, "reload", "geyser.commands.reload.desc", "geyser.command.reload"));
registerCommand(new StopCommand(connector, "stop", "geyser.commands.stop.desc", "geyser.command.stop"));
registerCommand(new OffhandCommand(connector, "offhand", "geyser.commands.offhand.desc", "geyser.command.offhand"));
registerCommand(new DumpCommand(connector, "dump", "geyser.commands.dump.desc", "geyser.command.dump"));
registerCommand(new VersionCommand(connector, "version", "geyser.commands.version.desc", "geyser.command.version"));
registerCommand(new SettingsCommand(connector, "settings", "geyser.commands.settings.desc", "geyser.command.settings"));
registerCommand(new StatisticsCommand(connector, "statistics", "geyser.commands.statistics.desc", "geyser.command.statistics"));
registerCommand(new AdvancementsCommand("advancements", "geyser.commands.advancements.desc", "geyser.command.advancements"));
if (GeyserConnector.getInstance().getPlatformType() == PlatformType.STANDALONE) {
registerCommand(new StopCommand(connector, "stop", "geyser.commands.stop.desc", "geyser.command.stop"));
}
}
public void registerCommand(GeyserCommand command) {

View File

@ -54,4 +54,4 @@ public class StopCommand extends GeyserCommand {
connector.getBootstrap().onDisable();
}
}
}