Class ConfigEntry<T>
java.lang.Object
net.glasslauncher.mods.api.gcapi.impl.config.ConfigBase
net.glasslauncher.mods.api.gcapi.impl.config.ConfigEntry<T>
- Direct Known Subclasses:
BaseListConfigEntry,BooleanConfigEntry,EnumConfigEntry,FloatConfigEntry,IntegerConfigEntry,StringConfigEntry
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Tprotected List<HasDrawable>protected MaxLengthbooleanprotected net.minecraft.client.gui.screen.ScreenFields inherited from class net.glasslauncher.mods.api.gcapi.impl.config.ConfigBase
description, id, multiplayerSynced, name, parentField, parentObject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Tvoidinit(net.minecraft.client.gui.screen.Screen parent, net.minecraft.client.font.TextRenderer textRenderer) abstract booleanabstract voidCalled when resetting the entry to the default value.voidabstract voidsetDrawableValue(T value) voidThis is called on all ConfigEntry objects when joining a vanilla server.Methods inherited from class net.glasslauncher.mods.api.gcapi.impl.config.ConfigBase
getDrawables
-
Field Details
-
value
-
defaultValue
-
parent
@Environment(CLIENT) protected net.minecraft.client.gui.screen.Screen parent -
multiplayerLoaded
public boolean multiplayerLoaded -
maxLength
-
drawableList
-
-
Constructor Details
-
ConfigEntry
-
-
Method Details
-
init
@Environment(CLIENT) public void init(net.minecraft.client.gui.screen.Screen parent, net.minecraft.client.font.TextRenderer textRenderer) -
getDrawableValue
-
setDrawableValue
-
isValueValid
public abstract boolean isValueValid() -
saveToField
- Throws:
IllegalAccessException
-
getMaxLength
-
reset
Called when resetting the entry to the default value. Yes, I'm making you write this part yourself, I don't know how your custom objects work and how to properly deep clone them.- Throws:
IllegalAccessException- Reflection can be used inside here without try/catch.
-
vanillaServerBehavior
public void vanillaServerBehavior()This is called on all ConfigEntry objects when joining a vanilla server. Things done in here probably shouldn't be saved, so make sure you set multiplayerLoaded to true if you do anything.
-