old-beta/Configuration

Configuration

SaplingAssists configuration is split into two yml files:

  • config.yml
    for the plugin itself, and
  • sapling.yml
    for all the replant settings.


config.yml

Example:

MinDelay: 1
MaxDelay: 300
UseCurrentWorldAsDefault: true
PlayerDefaultOverridesWorldDefault: false
UseExtraSafeLoading: false
ValidateOnLoad: true
MergeOnSave: true
DiscChangesTakePrecedence1: true
DiscChangesTakePrecedence2: false
AutoSaveToDefault: true

Explanation:

Min-/MaxDelay
If a user changes a replant [delay] (required permission depends on target), then this is the lower/upper limit to which the user can change the delay.
UseCurrentWorldAsDefault
Affects what happens when using a command that has a world-argument but not specifying it.
If true then it will use the world the target-player/you is/are currently in (or server-default as last resort).
if false then it will always use the server-default ...unless more specific settings already exist - then it will show/modify those instead.
Think of it as true: try to be specific, false: try to be generic.
PlayerDefaultOverridesWorldDefault
If true then default settings for a player are more important than default settings for the world the player is in.
(i.e governs what happens if explicit player-world setting doesn't exist but both player and world default settings do.)
UseExtraSafeLoading
Should be highly redundant... I'm just paranoid.
ValidateOnLoad
If true then configs are validated on load.
(Due to the experimental config-merge feature validation is mostly required anyway... subject to change.)
MergeOnSave
Should it try to merge with on-disk config on save (experimental - implies auto-cleaning) or should it simply overwrite the on-disk file.
DiscChangesTakePrecedence1 / 2
When merging, what is more important? Changes made to disk, or changes made ingame? (If true disk are more important.) Setting "1" is for config.yml - "2" is for sapling.yml.
(Experimental: Recommend leaving these alone for now.)
AutoSaveToDefault
Autosave to the normal config file, or autosave to a backup and leave the in-use config alone?
(If set to false then any change made to the settings from console / ingame will be stored in a backup file on server shutdown and will thus not be in effect when the server comes back online unless it was saved manually. Note that on next shutdown the backup will be overwritten again! Thus you can only backtrack to last used running config - and not further back in time.)


sapling.yml

Example:

'*':
  '*':
    Survival:
      Assist: true
      Delay: 1
      Chance: 100
    Adventure:
      Assist: true
      Chance: 50
      Delay: 1
    Creative:
      Assist: true
      Delay: 1
      Chance: 100
  DaPlayer:
    Creative:
      Assist: false
WorldOfSnow:
  DaPlayer:
    Creative:
      Assist: true
      Delay: 10
    Adventure:
      Chance: 100
  '*':
    Survival:
      Delay: 10
    Adventure:
      Delay: 10

Explanation:

It is basically a tree with the depth of a node deciding what it is. The structure is:

  • World
    • Player
      • Game-mode
        • Settings (Assist / Delay / Chance)

Do note that it's case-sensitive!
(Hint: Use the validation / auto-clean commands to check your config.)

The special '*' can be seen as the "default settings" specifier.
So basically the first 2 lines of the config can be read as "Any world - Any player", or more simply "Server defaults".

A few lines down the player "DaPlayer" is specified, which, looking at the tree structure of the config, would read as "Any world - player: DaPlayer" or more simply "Default settings for player: DaPlayer".

Further down we have "DaPlayer" again, this time in "WorldOfSnow". Thus, quite simply, settings specified there will override any other settings when player: DaPlayer is in world: WorldOfSnow.

Lastly there is a '*' entry under "WorldOfSnow", which can be read as "world: WorldOfSnow - Any player" or more simply "Default settings for world: WorldOfSnow".

As can be seen you need not specify all settings under a node, but only those you wish to override. When replanting is triggered ingame each of the settings will be evaluated separately according to the configured priority. Which is

  • World_Player -> World -> Player -> Server

if PlayerDefaultOverridesWorldDefault: false, or

  • World_Player -> Player -> World -> Server

if PlayerDefaultOverridesWorldDefault: true.


Comments

Posts Quoted:
Reply
Clear All Quotes