Class ConfigEditSession
java.lang.Object
net.ixdarklord.coolcatcore.internal.config.client.gui.ConfigEditSession
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccess()voidapplyPreset(ConfigPreset preset) booleancanRedo()booleancanUndo()config()voiddiscard(Collection<ConfigValueImpl<?>> values) Drops pending changes, as if nothing had been edited.Optional<net.minecraft.network.chat.Component>error(ConfigValueImpl<?> value) Collection<net.minecraft.network.chat.Component>errors()get(ConfigValueImpl<?> value) booleanbooleanisActive(ConfigValueImpl<?> value) Whether the value's dependency is met by the pending values.booleanisDefault(ConfigValueImpl<?> value) booleanisEditable(ConfigValueImpl<?> value) Whether the player may change the value: the config is editable here, and a server-only value is visible.booleanisModified(ConfigValueImpl<?> value) booleanisVisible(ConfigValueImpl<?> value) Whether a remote player sees this value at all: server-only values aren't sent to them.intvoidDrops pending values that the config now holds anyway (after the server's values arrived).voidredo()voidresetToDefaults(Collection<ConfigValueImpl<?>> values) save()Applies the pending values: locally (and saves the file), or by sending them to the server.voidSaves assave()does, and tells the player: a toast for a local save, and what must restart.voidset(ConfigValueImpl<?> value, Object newValue) Sets a pending value, checked by the value's validators; invalid values are reported instead.voidsetAll(Map<ConfigValueImpl<?>, Object> values) Sets several pending values as one undoable step.voidsetError(ConfigValueImpl<?> value, net.minecraft.network.chat.Component error) <T> EditSlot<T>slot(ConfigValueImpl<T> value) A slot for one of this config's values.voidundo()
-
Constructor Details
-
ConfigEditSession
-
-
Method Details
-
config
-
access
-
get
-
isModified
-
isDefault
-
error
-
modifiedCount
public int modifiedCount() -
hasErrors
public boolean hasErrors() -
errors
-
isEditable
Whether the player may change the value: the config is editable here, and a server-only value is visible. -
isActive
Whether the value's dependency is met by the pending values. -
isVisible
Whether a remote player sees this value at all: server-only values aren't sent to them. -
set
Sets a pending value, checked by the value's validators; invalid values are reported instead. -
setError
-
setAll
Sets several pending values as one undoable step. -
resetToDefaults
-
discard
Drops pending changes, as if nothing had been edited. -
applyPreset
-
canUndo
public boolean canUndo() -
canRedo
public boolean canRedo() -
undo
public void undo() -
redo
public void redo() -
onConfigChanged
public void onConfigChanged()Drops pending values that the config now holds anyway (after the server's values arrived). -
save
Applies the pending values: locally (and saves the file), or by sending them to the server.- Returns:
- the strictest restart the changes need
-
saveAndNotify
public void saveAndNotify()Saves assave()does, and tells the player: a toast for a local save, and what must restart. -
slot
A slot for one of this config's values.
-