mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Clean up a bunch
Mostly checked with IntelliJ, but manually performed. The only issue I possibly anticipate is item name/lore issues, but the new method should be technically better.
This commit is contained in:
parent
683ac1c763
commit
3a2cff7864
43 changed files with 125 additions and 190 deletions
|
@ -36,13 +36,12 @@ import java.util.List;
|
|||
|
||||
@Getter
|
||||
public class GeyserSpongeDumpInfo extends BootstrapDumpInfo {
|
||||
|
||||
private String platformName;
|
||||
private String platformVersion;
|
||||
private boolean onlineMode;
|
||||
private String serverIP;
|
||||
private int serverPort;
|
||||
private List<PluginInfo> plugins;
|
||||
private final String platformName;
|
||||
private final String platformVersion;
|
||||
private final boolean onlineMode;
|
||||
private final String serverIP;
|
||||
private final int serverPort;
|
||||
private final List<PluginInfo> plugins;
|
||||
|
||||
GeyserSpongeDumpInfo() {
|
||||
super();
|
||||
|
|
|
@ -33,7 +33,6 @@ import org.geysermc.connector.common.ChatColor;
|
|||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
import org.geysermc.connector.utils.LanguageUtils;
|
||||
import org.spongepowered.api.command.CommandCallable;
|
||||
import org.spongepowered.api.command.CommandException;
|
||||
import org.spongepowered.api.command.CommandResult;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.text.Text;
|
||||
|
@ -81,7 +80,7 @@ public class GeyserSpongeCommandExecutor extends CommandExecutor implements Comm
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSuggestions(CommandSource source, String arguments, @Nullable Location<World> targetPosition) throws CommandException {
|
||||
public List<String> getSuggestions(CommandSource source, String arguments, @Nullable Location<World> targetPosition) {
|
||||
if (arguments.split(" ").length == 1) {
|
||||
return connector.getCommandManager().getCommandNames();
|
||||
}
|
||||
|
|
|
@ -32,8 +32,7 @@ import org.spongepowered.api.command.CommandMapping;
|
|||
import org.spongepowered.api.text.Text;
|
||||
|
||||
public class GeyserSpongeCommandManager extends CommandManager {
|
||||
|
||||
private org.spongepowered.api.command.CommandManager handle;
|
||||
private final org.spongepowered.api.command.CommandManager handle;
|
||||
|
||||
public GeyserSpongeCommandManager(org.spongepowered.api.command.CommandManager handle, GeyserConnector connector) {
|
||||
super(connector);
|
||||
|
@ -43,6 +42,8 @@ public class GeyserSpongeCommandManager extends CommandManager {
|
|||
|
||||
@Override
|
||||
public String getDescription(String command) {
|
||||
return handle.get(command).map(CommandMapping::getCallable).map(callable -> callable.getShortDescription(Sponge.getServer().getConsole()).orElse(Text.EMPTY)).orElse(Text.EMPTY).toPlain();
|
||||
return handle.get(command).map(CommandMapping::getCallable)
|
||||
.map(callable -> callable.getShortDescription(Sponge.getServer().getConsole()).orElse(Text.EMPTY))
|
||||
.orElse(Text.EMPTY).toPlain();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue