Interface SettingGroup
- All Known Subinterfaces:
AdvancedSettings, GeneralSettings, VisualSettings
public interface SettingGroup
A group of settings.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.Componentname()The name of the group.voidread(com.google.gson.JsonObject object) Reads the settings from the given JsonObject.Registers a new setting.registerBoolean(String key, boolean defaultValue) Registers a new setting.<T extends Enum<T> & EnumSetting.EnumValue>
EnumSetting<T> registerEnum(String key, T defaultValue) Registers a new enum setting.registerVersionedBoolean(String key, com.viaversion.viaversion.api.protocol.version.ProtocolVersionRange versionRange, boolean defaultValue) Registers a new versioned boolean setting.settings()All settings in the group.voidwrite(com.google.gson.JsonObject object) Writes the settings to the given JsonObject.
-
Method Details
-
name
net.minecraft.network.chat.Component name()The name of the group. Used for displaying the group in the settings menu.- Returns:
- The name of the group
-
settings
-
registerBoolean
Registers a new setting.- Parameters:
key- The translation key of the setting. Requires all settings to be prefixed with this key as well.defaultValue- The default value of the setting.- Returns:
- The newly created setting
-
registerEnum
Registers a new enum setting.- Type Parameters:
T- The type of the enum- Parameters:
key- The translation key of the setting. Requires all settings to be prefixed with this key as well.defaultValue- The default value of the setting.- Returns:
- The newly created enum setting
-
registerVersionedBoolean
VersionedBooleanSetting registerVersionedBoolean(String key, com.viaversion.viaversion.api.protocol.version.ProtocolVersionRange versionRange, boolean defaultValue) Registers a new versioned boolean setting.- Parameters:
key- The translation key of the setting. Requires all settings to be prefixed with this key as well.versionRange- The version range the setting is valid for.defaultValue- The default value of the setting.- Returns:
- The newly created versioned boolean setting
-
register
Registers a new setting. This is useful for custom settings that are not part of the default settings.- Parameters:
key- The translation key of the setting. Requires all settings to be prefixed with this key as well.setting- The setting to register- Returns:
- The registered setting
-
write
void write(com.google.gson.JsonObject object) Writes the settings to the given JsonObject.- Parameters:
object- The JsonObject to write to
-
read
void read(com.google.gson.JsonObject object) Reads the settings from the given JsonObject.- Parameters:
object- The JsonObject to read from
-