Add option for disabling command suggestions; add config version (#598)

* Add option for disabling command suggestions; add config version

This commit adds an option for disabling command suggestions. If enabled, command suggestions will not be sent to the server so as to remove command freezing. This commit also adds a config version variable so users are notified when to regenerate their configs.

* Rename GeyserConfiguration.checkGeyserConfiguration()
This commit is contained in:
Camotoy 2020-05-20 23:43:22 -04:00 committed by GitHub
parent 83c7858a8c
commit a7f363ec09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 79 additions and 1 deletions

View file

@ -79,6 +79,11 @@ public class GeyserSpongeConfiguration implements GeyserConfiguration {
return userAuthInfo;
}
@Override
public boolean isCommandSuggestions() {
return node.getNode("command-suggestions").getBoolean(true);
}
@Override
public boolean isPingPassthrough() {
return node.getNode("ping-passthrough").getBoolean(false);
@ -202,4 +207,9 @@ public class GeyserSpongeConfiguration implements GeyserConfiguration {
return node.getNode("metrics").getNode("uuid").getString("generateduuid");
}
}
@Override
public int getConfigVersion() {
return node.getNode("config-version").getInt(0);
}
}

View file

@ -30,6 +30,7 @@ import ninja.leaping.configurate.ConfigurationNode;
import ninja.leaping.configurate.loader.ConfigurationLoader;
import ninja.leaping.configurate.yaml.YAMLConfigurationLoader;
import org.geysermc.common.PlatformType;
import org.geysermc.connector.GeyserConfiguration;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.bootstrap.GeyserBootstrap;
import org.geysermc.connector.command.CommandManager;
@ -105,6 +106,7 @@ public class GeyserSpongePlugin implements GeyserBootstrap {
}
this.geyserLogger = new GeyserSpongeLogger(logger, geyserConfig.isDebugMode());
GeyserConfiguration.checkGeyserConfiguration(geyserConfig, geyserLogger);
this.connector = GeyserConnector.start(PlatformType.SPONGE, this);
this.geyserCommandManager = new GeyserSpongeCommandManager(Sponge.getCommandManager(), connector);