# HyacinthHello
一个简单的插件,允许玩家设置自己的自定义加入、离开和死亡消息。
消息可以通过`/joinmsg`、`/leavemsg`和`/deathmsg`进行设置,并存储在插件目录下的`PlayerDatabase`中。
在https://www.youtube.com/watch?v=L6Li0QnvPis观看演示。
## 命令
使用命令设置消息。通过传递空白值可以清除消息。
- `/joinmsg [message]`
- `/leavemsg [message]`
- `/deathmsg [message]`
管理员可以使用`hyacinthhello.mod`权限节点来覆盖其他玩家的消息。
- `/hh mod joinmsg [user] [message]`
- `/hh mod leavemsg [user] [message]`
- `/hh mod deathmsg [user] [message]`
## 配置
配置允许你修改插件的外观。以下是一个示例:
```yaml
enabled: true # 是否启用插件
proxy-mode: false # 是否启用Velocity支持(见下文)
proxy-redis: # 如果以上为false则忽略
address: 0.0.0.0 # 你的redis地址,通常可以不修改
port: 6379 # 你的redis端口,通常可以不修改
channel: hyacinthhello # 除非你有多个带有HyacinthHello的代理,否则保持默认值
ssl: false # 除非你知道需要修改,否则留空
pass: # 除非你知道要填写什么,否则留空
database:
type: yaml # 默认是yaml。其他选项是mysql或postgres
# 如果你选择了yaml,可以忽略数据库配置的其余部分
host: 0.0.0.0
port: 3306 # mysql的默认端口是3306,postgres是5432
db: hyacinthhello # 创建这个数据库
user: # 填写这里
pass: # 填写这里
economy:
enabled: false # 是否收取更改消息的费用
type: 'vault' # 选项是 vault 或 playerpoints
cost: # PlayerPoints仅支持整数(例如 10.0,而不是 10.5)
joinmsg: 10.0
leavemsg: 10.0
deathmsg: 10.0
prefix: "" # 命令响应前的缀
wrapper-left: "&e&o" # 消息前缀
wrapper-right: "" # 消息后缀
maximum-message-length: 60 # 玩家设置消息时进行检查
regex-filters: # 正则表达式过滤器不需要用/包裹
- "simpleexactmatch"
- "t[a-zA-Z]st"
```
## 经济
支持 Vault 或 [Rosewood Development的PlayerPoints](https://www.spigotmc.org/resources/playerpoints.80745/)。
玩家不会被收取清除消息的费用,仅设置费用。
## 权限
- `hyacinthhello.use` 使用任何命令
- `hyacinthhello.mod` 使用mod命令
- `hyacinthhello.joinmsg` 设置和发送加入消息
- `hyacinthhello.leavemsg` 设置和发送离开消息
- `hyacinthhello.deathmsg` 设置和发送死亡消息
- `hyacinthhello.color` 在消息中使用颜色
## 占位符
每种消息类型都有自己的占位符。占位符将不包含配置文件中设置的包装器。
- `%hyacinthhello_join%`
- `%hyacinthhello_leave%`
- `%hyacinthhello_death%`
占位符也会包含颜色和格式,如果玩家有权限的话。你可以排除它们:
- `%hyacinthhello_join-clean%`
- `%hyacinthhello_leave-clean%`
- `%hyacinthhello_death-clean%`
你也可以传递一个用户名来获取特定玩家的消息。
- `%hyacinthhello_join_[username]%`
## Velocity
使用HyacinthHello Velocity,你可以在整个网络上广播HyacinthHello的自定义消息。
Velocity插件可以仅仅转发到其他服务器,或者接管代理上的所有加入、离开和死亡消息。后一种选项是推荐的。
如果你想在你的代理上同步玩家的自定义消息,你可以使用单个MySQL或Postgres数据库来存储所有服务器的数据。
需要Redis。
在你的服务器上:
```yaml
proxy-mode: true
proxy-redis:
address: 0.0.0.0 # 你的redis地址,通常可以不修改
port: 6379 # 你的redis端口,通常可以不修改
channel: hyacinthhello # 除非你有多个带有HyacinthHello的代理,否则保持默认值
ssl: # 除非你知道需要修改,否则留空
pass: # 除非你知道要填写什么,否则留空
```
在你的代理上:
```yaml
# 变量:
# {p} 玩家名称
# {s} 服务器名称
# {m} 转发的消息
redis:
address: 0.0.0.0 # 你的redis地址,通常可以不修改
port: 6379 # 你的redis端口,通常可以不修改
prefix: hyacinthhello # 除非你有多个带有HyacinthHello的代理,否则保持默认值
ssl: # 除非你知道需要修改,否则留空
pass: # 除非你知道要填写什么,否则留空
override-backends: true # 覆盖默认和自定义消息。
join-message: '{p} joined {s}' # 允许设置加入的自定义格式
leave-message: '{p} left {s}' # 允许设置离开的自定义格式
death-message: '{m}' # 仅包裹从后端服务器转发的消息
wrapper-left: '&e&o'
wrapper-right: ''
```