forked from GeyserMC/Geyser
Pull command descriptions from Bukkit and Sponge versions when listing commands
This allows the description of the commands to display when listing the commands in bedrock by tab-completing. This is currently only available on Sponge and Bukkit versions as there is no support in BungeeCord and Velocity to get these values. This data is also not sent in any packet, so we cannot retrieve that from standalone either.
This commit is contained in:
parent
672024c718
commit
bab2b4a420
22 changed files with 340 additions and 23 deletions
|
@ -38,6 +38,7 @@ import org.geysermc.common.bootstrap.IGeyserBootstrap;
|
|||
import org.geysermc.connector.GeyserConnector;
|
||||
import org.geysermc.connector.utils.FileUtils;
|
||||
import org.geysermc.platform.velocity.command.GeyserVelocityCommandExecutor;
|
||||
import org.geysermc.platform.velocity.command.GeyserVelocityCommandManager;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -53,6 +54,7 @@ public class GeyserVelocityPlugin implements IGeyserBootstrap {
|
|||
@Inject
|
||||
private CommandManager commandManager;
|
||||
|
||||
private GeyserVelocityCommandManager geyserCommandManager;
|
||||
private GeyserVelocityConfiguration geyserConfig;
|
||||
private GeyserVelocityLogger geyserLogger;
|
||||
|
||||
|
@ -74,6 +76,7 @@ public class GeyserVelocityPlugin implements IGeyserBootstrap {
|
|||
this.geyserLogger = new GeyserVelocityLogger(logger, geyserConfig.isDebugMode());
|
||||
this.connector = GeyserConnector.start(PlatformType.VELOCITY, this);
|
||||
|
||||
this.geyserCommandManager = new GeyserVelocityCommandManager(connector);
|
||||
this.commandManager.register(new GeyserVelocityCommandExecutor(connector), "geyser");
|
||||
}
|
||||
|
||||
|
@ -92,6 +95,11 @@ public class GeyserVelocityPlugin implements IGeyserBootstrap {
|
|||
return geyserLogger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.geysermc.connector.command.CommandManager getGeyserCommandManager() {
|
||||
return this.geyserCommandManager;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onInit(ProxyInitializeEvent event) {
|
||||
onEnable();
|
||||
|
|
|
@ -57,6 +57,6 @@ public class GeyserVelocityCommandExecutor implements Command {
|
|||
}
|
||||
|
||||
private GeyserCommand getCommand(String label) {
|
||||
return connector.getCommandMap().getCommands().get(label);
|
||||
return connector.getCommandManager().getCommands().get(label);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* @author GeyserMC
|
||||
* @link https://github.com/GeyserMC/Geyser
|
||||
*/
|
||||
|
||||
package org.geysermc.platform.velocity.command;
|
||||
|
||||
import org.geysermc.connector.GeyserConnector;
|
||||
import org.geysermc.connector.command.CommandManager;
|
||||
|
||||
public class GeyserVelocityCommandManager extends CommandManager {
|
||||
|
||||
public GeyserVelocityCommandManager(GeyserConnector connector) {
|
||||
super(connector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(String command) {
|
||||
return ""; // no support for command descriptions in velocity
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue