Klasse AbstractSetting<T>
java.lang.Object
com.viaversion.viafabricplus.api.settings.AbstractSetting<T>
- Typparameter:
T- The type of the setting.
- Bekannte direkte Unterklassen:
BooleanSetting,ButtonSetting,ModeSetting,VersionedBooleanSetting
This class is the base for all settings. It contains the name, the default value and the current value.
Developer's should always use the implementations of this class, and not this class itself.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungAbstractSetting(SettingGroup parent, net.minecraft.network.chat.MutableComponent name, T defaultValue) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungnet.minecraft.network.chat.MutableComponentgetName()net.minecraft.network.chat.ComponentgetValue()voidLocks the setting so any change to the first value loaded will only be applied after restarting the game.static StringmapTranslationKey(String input) Cuts the name of a translation from its key / path.voidabstract voidread(com.google.gson.JsonObject object) voidsetTooltip(Supplier<net.minecraft.network.chat.Component> tooltip) voidsetTooltip(net.minecraft.network.chat.Component tooltip) voidabstract voidwrite(com.google.gson.JsonObject object)
-
Konstruktordetails
-
AbstractSetting
public AbstractSetting(SettingGroup parent, net.minecraft.network.chat.MutableComponent name, T defaultValue)
-
-
Methodendetails
-
write
public abstract void write(com.google.gson.JsonObject object) -
read
public abstract void read(com.google.gson.JsonObject object) -
onValueChanged
public void onValueChanged() -
getName
public net.minecraft.network.chat.MutableComponent getName() -
getTranslationKey
- Gibt zurück:
- The translation key of the name.
-
mapTranslationKey
Cuts the name of a translation from its key / path.- Parameter:
input- The translation key.- Gibt zurück:
- The name of the translation. (E. g: "viafabricplus.settings.base" -> "base")
-
getDefaultValue
-
getValue
-
getCurrentValue
-
setValue
-
getTooltip
public net.minecraft.network.chat.Component getTooltip() -
setTooltip
public void setTooltip(net.minecraft.network.chat.Component tooltip) -
setTooltip
-
lockValue
public void lockValue()Locks the setting so any change to the first value loaded will only be applied after restarting the game.
-