Enum Class SyncBehavior

java.lang.Object
java.lang.Enum<SyncBehavior>
net.frozenblock.lib.config.api.sync.SyncBehavior
All Implemented Interfaces:
Serializable, Comparable<SyncBehavior>, Constable

public enum SyncBehavior extends Enum<SyncBehavior>
Used to provide the behavior for a config entry when syncing is in action. See FrozenLibConfig for an example.
Since:
1.5.2
  • Enum Constant Details

    • SYNCABLE

      public static final SyncBehavior SYNCABLE
      The default behavior for all entries. Operators of the server and LAN hosts will be able to set the config values, and all others will see that value update on their client. Non-operator/host clients will not be able to modify these values, as they will be locked in the GUI (currently we provide native support for Cloth Config only,) and display the reason why it can't be modified. The values synced to the client will not save to their config, as this is simply a temporary modification.
    • UNSYNCABLE

      public static final SyncBehavior UNSYNCABLE
      The config entry will not sync, and will be modifiable to anyone's client. This should be used for client-only options, for instance, whether or not you want a specific particle to spawn.
    • LOCK_WHEN_SYNCED

      public static final SyncBehavior LOCK_WHEN_SYNCED
      The config entry will be locked whilst connected to the server or LAN world, but will respect the client's value as it will not sync. Anyone will be able to leave, change the value, then rejoin and have their own option enabled. This is recommended to be used for client-only options that may cause bugs or other issues if changed during gameplay. Keep in mind that operators/hosts will be able to modify this entry at any time for themselves.
  • Method Details

    • values

      public static SyncBehavior[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SyncBehavior valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • canSync

      public boolean canSync()