Fzzy Config

@RequiresAction

@RequiresAction indicates that the user will need to take a certain action if a relevant field is changed in order for the change to take full effect. The actions are prioritized based on their Enum ordinal; you can annotate a class with a certain action, but upgrade certain settings with a separate annotation of higher priority.

The available actions, from highest to lowest priority

  1. RESTART: Same action as @RequiresRestart. Prompts that a restart is needed, and will disconnect clients joining a server with a synced RESTART, prompting them to restart their client after the sync to apply the changes.
  2. RELOG: The user needs to disconnect and reconnect to their current world or server for changes to take effect.
  3. RELOAD_BOTH: Both data packs and assets need to be reloaded.
  4. RELOAD_DATA: Data packs need to be reloaded.
  5. RELOAD_RESOURCES: Resource packs need to be reloaded.
@RequiresAction(action = Action.RESTART)
public int myItemDurability = 250; // something like item durability would require a restart, as durabilities are immutable once an item is instantiated.
@RequiresAction(action = Action.RELOAD_RESOURCES)
public Identifier guiTheme = Identifier.of(MOD_ID, "default_theme"); // some sort of reloadable theme selector, that needs to reload resources to apply the new theme.

If Action.RESTART is used, a connecting client will see the same restart screen as shown with @RequiresRestart

image