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:
Camotoy 2021-06-20 21:42:22 -04:00
parent 683ac1c763
commit 3a2cff7864
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
43 changed files with 125 additions and 190 deletions

View file

@ -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();

View file

@ -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();
}

View file

@ -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();
}
}