mirror of
https://github.com/GeyserMC/Geyser.git
synced 2026-01-04 15:31:36 +00:00
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:
@@ -86,6 +86,11 @@ public class GeyserBukkitConfiguration implements GeyserConfiguration {
|
||||
return userAuthInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCommandSuggestions() {
|
||||
return config.getBoolean("command-suggestions", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPingPassthrough() {
|
||||
return config.getBoolean("ping-passthrough", false);
|
||||
@@ -203,4 +208,9 @@ public class GeyserBukkitConfiguration implements GeyserConfiguration {
|
||||
return config.getString("metrics.uuid", "generateduuid");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getConfigVersion() {
|
||||
return config.getInt("config-version", 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ package org.geysermc.platform.bukkit;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
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;
|
||||
@@ -55,6 +56,7 @@ public class GeyserBukkitPlugin extends JavaPlugin implements GeyserBootstrap {
|
||||
saveDefaultConfig();
|
||||
|
||||
this.geyserConfig = new GeyserBukkitConfiguration(getDataFolder(), getConfig());
|
||||
GeyserConfiguration.checkGeyserConfiguration(geyserConfig, geyserLogger);
|
||||
if (geyserConfig.getMetrics().getUniqueId().equals("generateduuid")) {
|
||||
getConfig().set("metrics.uuid", UUID.randomUUID().toString());
|
||||
saveConfig();
|
||||
|
||||
Reference in New Issue
Block a user