Configurando o Sponge

This article is about configuring Sponge itself; plugins will usually create their own configuration files inside the server “config” directory. For Vanilla configuration check out the Minecraft Wiki.

Ficheiros de configuração do Sponge

O Sponge tem vários ficheiros de configuração, e todos podem ser encontrados na pasta config/sponge/ do teu servidor:

  • tracker.conf

  • custom_data.conf

  • global.conf e as subconfigurações correspondentes a cada mundo dimensão na pasta worlds

O ficheiro global.conf contém as definições de configuração global do Sponge. As suas propriedades também podem ser alterads para cada mundo e tipo de dimensão utilizando os ficheiros de configuração nas subpastas de config/worlds.

O ficheiro tracker.conf pode ser usado apra configurar o _Phase Tracker_, e o ficheiro custom_data.conf é usado para gerir dados personalizados adicionados por plugins.

Alterar a Configuração com um Editor de Texto

Abre o ficheiro desejado usando o editor teu preferido. Os ficheiros de configuração do Sponge usam o formato HOCON, sobre o qual podes ler mais em “Introdução a HOCON”.

Depois de fazeres as alterações desejadas, guarda o ficheiro. Se o servidor estava a correr enquanto fizeste as alterações, tens de recarregar o ficheiro de configuração usando os comandos de reloading explicados abaixo. Por exemplo, depois de alterares o teu ficheiro global.conf, corre``/sponge reload -g`` para recarregares as configurações do ficheiro.

Substituição da Configuração Global

If you would like to override the global configs in just a single world or dimension type, for example raise the spawn cap of monsters in the Vanilla Nether alone, subconfigs allow you to do just that. You can find configs for every world and dimension on your server within the worlds folder, inside the main Sponge config folder. These are sorted first by mods, and then dimension type. Simply modify those configs to your needs, and the changes will be applied to all the related worlds, overriding broader configs. This follows a simple order: World > Dimension > Global

Alterar a Configuração via Comandos

It is possible to modify most configs through the in-game command /sponge config. The syntax for the config command looks like this:

/sponge config <flag> <key> <value>

There are the following flags for specifying the target that you would wish to change.

  • -g is the flag for global (global.conf)

  • -d <dim> targets a dimension (dimension.conf)

  • -w <world> targets one world (world.conf)

  • -t is the flag for tracker (tracker.conf)

<name> being a placeholder, you need replace with the name of your target, e.g. -d minecraft:nether.

The key is the value you want to change. The value is whatever you want to change the value of the key to. For example, if you want to change chunk-load to true in the file config/sponge/minecraft/nether/dimension.conf:

sponge {
    logging {
        # Log when chunks are loaded
        chunk-load=false
    }
}

Eis o comando que deves usar:

/sponge config -d minecraft:nether logging.chunk-load true

If you need to check the value of a key, simply omit the value. Checking the value of a key such as logging.chunk-load in the nether can be done like so:

/sponge config -d minecraft:nether logging.chunk-load

Gravar a Configuração

Saving a world config to the file may be desired after making modifications. This can be useful in the event of an unexpected server crash. This is done by using the /sponge save command on the server. The syntax for this command is similar to the config command:

/sponge save <flag>

Aqui um exemplo para salvar a configuração global:

/sponge save -g

Recarregar uma Configuração

Por vezes, podes precisar de recarregar a configuração de um mundo enquanto o servidor está a correr. Isto é útil quando fazes alterações a um ficheiro de configuração local, e o queres recarregar para ser usado no servidor em execução. Isto é possível usando o comando /sponge reload. A sintaxe deste comando é a seguinte:

/sponge reload <flag>

Aqui um exemplo para recarregar o arquivo de configuração do fim do mundo:

/sponge reload -d minecraft:the_end