Archived
0
This repository has been archived on 2022-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
Files
mc-core/core/README.MD

130 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Core
Ядро сервера.
Пример настройки можно посмотреть в файле [`sample-config.groovy`](./sample-config.groovy).
## Spring beans
### Разное
#### CoreEventListener
Стандартный обработчик системных событий.
**Bean example:**
```groovy
beans {
coreEventListener(mc.core.CoreEventListener)
}
```
#### ConfigFromSpring
Настройка параметров сервера через конфигурацию "спринга".
Имеются следующие настройки:
* `descriptionServer` - описание сервера (aka "Motd")
* `favicon` - файл с иконкой сервера
* `maxPlayers` - максимальная вместимость сервера
**Implements:** `mc.core.Config`
**Bean example:**
```groovy
beans {
config(mc.core.embedded.ConfigFromSpring) {
descriptionServer = 'MC Core - LIMBO'
maxPlayers = 1
favicon = 'icon.png'
}
}
```
#### GameLoop
**Bean example:**
Доступные параметры:
* `gameTimer` - бин, управляющий ходом времени
* `percentWarnLowTps` - порог "низкого" значения TPS, в процентах
```groovy
beans {
gameLoop(mc.core.GameLoop) {
gameTimer = ref('timeProcessor')
percentWarnLowTps = 15
}
}
```
#### SimpleChatProcessor
Простой обработчик чата.
**Implements:** `mc.core.chat.ChatProcessor`
**Bean example:**
```groovy
beans {
chatProcessor(mc.core.chat.SimpleChatProcessor)
}
```
### Время
#### IdleTime
Игровое время суток застывает на указанной отметке.
Доступные параметры:
* `gameTime` - отметка времени (long)
**Implements:** `mc.core.time.TimeProcessor`
**Bean example:**
```groovy
beans {
timeProcessor(mc.core.time.IdleTime) {
gameTime = 1000
}
}
```
#### TimePerTick
Игровое время суток соответствует игровым тикам (20 tps)
Доступные параметры:
* `startGameTime` - стартовое время (long)
**Implements:** `mc.core.time.TimeProcessor`
**Bean example:**
```groovy
beans {
timeProcessor(mc.core.time.TimePerTick) {
startGameTime = 1000
}
}
```
#### RealTime
Игровое время суток соответствует реальному времени
**Implements:** `mc.core.time.TimeProcessor`
**Bean example:**
```groovy
beans {
timeProcessor(mc.core.time.RealTime)
}
```