Class EnumConfigEntry<T extends Enum<?>>
java.lang.Object
net.glasslauncher.mods.api.gcapi.impl.config.ConfigBase
net.glasslauncher.mods.api.gcapi.impl.config.ConfigEntry<Integer>
net.glasslauncher.mods.api.gcapi.impl.config.entry.EnumConfigEntry<T>
- Type Parameters:
T- The enum you want to use. Must have toString implemented. Also must be passed into the constructor.
- All Implemented Interfaces:
ConfigEntryWithButton
public class EnumConfigEntry<T extends Enum<?>>
extends ConfigEntry<Integer>
implements ConfigEntryWithButton
This class is a bit of a crapshoot cause java's generic type handling is pitifully bad.
-
Field Summary
FieldsFields inherited from class net.glasslauncher.mods.api.gcapi.impl.config.ConfigEntry
defaultValue, drawableList, maxLength, multiplayerLoaded, parent, valueFields inherited from class net.glasslauncher.mods.api.gcapi.impl.config.ConfigBase
description, id, multiplayerSynced, name, parentField, parentObject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull List<HasDrawable>voidinit(net.minecraft.client.gui.screen.Screen parent, net.minecraft.client.font.TextRenderer textRenderer) booleanvoidonClick()Fired when someone clicks a button for your config category.voidCalled when resetting the entry to the default value.voidvoidsetDrawableValue(Integer value) Methods inherited from class net.glasslauncher.mods.api.gcapi.impl.config.ConfigEntry
getMaxLength, vanillaServerBehavior
-
Field Details
-
parentEnumArray
-
-
Constructor Details
-
EnumConfigEntry
-
-
Method Details
-
init
public void init(net.minecraft.client.gui.screen.Screen parent, net.minecraft.client.font.TextRenderer textRenderer) - Overrides:
initin classConfigEntry<Integer>
-
getDrawableValue
- Specified by:
getDrawableValuein classConfigEntry<Integer>
-
setDrawableValue
- Specified by:
setDrawableValuein classConfigEntry<Integer>
-
isValueValid
public boolean isValueValid()- Specified by:
isValueValidin classConfigEntry<Integer>
-
getDrawables
- Specified by:
getDrawablesin classConfigBase
-
onClick
@Environment(CLIENT) public void onClick()Description copied from interface:ConfigEntryWithButtonFired when someone clicks a button for your config category.- Specified by:
onClickin interfaceConfigEntryWithButton
-
reset
Description copied from class:ConfigEntryCalled 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.- Specified by:
resetin classConfigEntry<Integer>- Throws:
IllegalAccessException- Reflection can be used inside here without try/catch.
-
saveToField
- Overrides:
saveToFieldin classConfigEntry<Integer>- Throws:
IllegalAccessException
-
getButtonText
-