Skip to content

Commit 02a5871

Browse files
committed
[feat] add enter-message and cancel-collision settings
1 parent 34153e1 commit 02a5871

10 files changed

Lines changed: 363 additions & 153 deletions

File tree

README.md

Lines changed: 77 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
<div align="center">
2-
<h1>WorldUtils</h1>
3-
4-
[![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://github.com/StarCodeClub/WorldUtils) [![Version](https://img.shields.io/badge/version-1.3.3--SNAPSHOT-blue.svg)](https://github.com/StarCodeClub/WorldUtils/releases) [![Minecraft](https://img.shields.io/badge/minecraft-1.20.X--latest-green.svg)](https://www.spigotmc.org/) [![Folia](https://img.shields.io/badge/folia-supported-pink)](https://papermc.io/downloads/folia) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
2+
<h1>WorldUtils</h1>
3+
4+
<div>
5+
<a href="https://github.com/StarCodeClub/WorldUtils/blob/main/LICENSE">
6+
<img src="https://img.shields.io/github/license/StarCodeClub/WorldUtils" alt="License" />
7+
</a>
8+
<a href="https://github.com/StarCodeClub/WorldUtils/actions">
9+
<img src="https://img.shields.io/github/actions/workflow/status/StarCodeClub/WorldUtils/build.yml?branch=master" alt="Build status" />
10+
</a>
11+
<a href="https://github.com/StarCodeClub/WorldUtils/releases">
12+
<img src="https://img.shields.io/github/release/StarCodeClub/WorldUtils" alt="latest version" />
13+
</a>
14+
<a href="https://papermc.io/downloads/folia">
15+
<img src="https://img.shields.io/badge/folia-supported-pink" alt="folia supported" />
16+
</a>
17+
<img src="https://img.shields.io/badge/minecraft-1.20.x--Latest-green.svg" alt="Minecraft version" />
18+
</div>
519

6-
<h4>适用于高版本 Paper、Folia 的 Minecraft 服务端的插件,提供许多有关世界的实用功能和设置</h4>
7-
<h4>Language: 简体中文 | [English](README_en.md)</h4>
20+
<h4>适用于高版本 Paper、Folia 的 Minecraft 服务端的插件,提供许多有关世界的实用功能和设置</h4>
21+
<h4>Language: 简体中文 | [Switch to English](./README_en.md)</h4>
822
</div>
923

1024
## ✨ 特性
1125

1226
- **🔧 灵活**:层次化配置系统,支持配置继承,简单明确地完成功能设置
1327
- **🔒 世界保护**:提供 9 种世界保护
14-
- **🌍 独立世界属性**: 为每个世界设置单独的 GameMode
28+
- **🌍 独立世界属性**: 为每个世界调整独立的设置
1529
- **💬 消息**:支持使用下一代 MiniMessage 格式,ActionBar 提示玩家更加优雅,已做频繁触发优化
1630
- **⚡ High Performance**:极度轻量,无冗余代码,插件大小仅65KB
1731
- **🎯 权限系统**:精细的权限控制,支持使用权限绕过特定保护
@@ -45,67 +59,94 @@ mvn clean package
4559

4660
```yaml
4761
# 插件前缀 (MiniMessage 格式)
48-
plugin-prefix: "<shadow:#000000FF><gradient:#ff7300:#ff3c00><b>[WU]</b></gradient></shadow>"
62+
plugin-prefix: "<gradient:#00eec0:#00c5ff><b>[WU]</b></gradient>"
4963

5064
# 世界配置文件
5165
configs:
52-
# 配置文件必须包含 default 节点,请勿删除!!!
66+
# default 为默认配置,同时也是[配置模版],请勿删除!!!
5367
default:
54-
# 禁止玩家修改世界(放置方块,填充水、岩浆,放置画,修改物品展示框和花盆...)
68+
# 阻止玩家修改世界(放置方块,填充水、岩浆,放置画,修改物品展示框和花盆...)
5569
anti-world-edit: false
56-
# 禁止玩家 pvp (玩家互相伤害)
70+
# 阻止玩家在此世界进行 PVP (玩家互相伤害)
5771
anti-pvp: false
58-
# 禁止玩家进入世界 (folia 上无法立刻拦截,但于在2s内将会传送至 Fallback World)
72+
# 阻止玩家进入该世界 (folia 上无法立刻拦截,但于在2s内将会传送至 Fallback World)
5973
anti-player-enter: false
6074
# 如果发现玩家处于禁止进入的世界,将会将玩家传送至该世界出生点
6175
world-enter-fallback: "world"
62-
# 使爆炸在该世界不破坏方块 (EntityExplodeEvent)
76+
# 使爆炸在该世界不破坏方块 (仍可造成伤害)
6377
anti-explosion: false
64-
# 禁止玩家与该世界的方块交互 (打开容器,使用工作台等) (PlayerInteractEvent)
78+
# 阻止玩家与该世界的方块交互 (打开容器,使用工作台等)
6579
anti-block-interaction: false
66-
# 禁止玩家在此世界使用物品 (丢雪球、鸡蛋,射箭,使用刷怪蛋等)
80+
# 阻止玩家在此世界使用物品 (丢雪球、鸡蛋,射箭,使用刷怪蛋,打火石等)
6781
anti-use-item: false
68-
# 禁止玩家攻击该世界的实体 (不包含玩家互相伤害)
82+
# 阻止玩家对该世界的实体造成伤害 (不包含玩家互相伤害)
6983
anti-attack-entity: false
70-
# 禁止玩家在该世界与实体交互 (骑乘坐骑,与村民交易等) (onPlayerInteractEntity)
84+
# 阻止玩家在该世界与实体交互 (骑乘坐骑,使用栓绳,与村民交易等)
7185
anti-entity-interaction: false
72-
# 禁止玩家在该世界捡起或丢弃物品 (PlayerPickupItemEvent, PlayerDropItemEvent)
86+
# 阻止玩家在该世界捡起或丢弃物品
7387
anti-pickup-drop-items: false
74-
75-
# 为每个世界切换单独的游戏模式, 设置为空则为不更改
88+
# 为世界设置独立的游戏模式 (设置为空则使用默认游戏模式)
7689
world-gamemode: ""
77-
# 强制保持玩家在此世界的游戏模式
78-
# 需设置 world-gamemode 才会生效
90+
# 是否强制禁止玩家在此世界修改游戏模式
7991
force-world-gamemode: false
92+
# 取消玩家碰撞 (禁止玩家推动该世界的实体使其位置改变), 玩家自身仍可被其他实体推动 (由客户端计算)
93+
cancel-player-collision: false
8094

81-
# 玩家无权限时 ActionBar 显示的提示 (MiniMessage 格式)
95+
# 在玩家进入该世界时向玩家发送提示, 设置为空则不发送
96+
enter-message:
97+
chat-message: ""
98+
action-bar: ""
99+
100+
title: "" # 使用 \n 分隔 title 和 subtitle
101+
duration: 2 # 显示持续时间,仅对 Title 起效
102+
103+
# 玩家无权限时 actionbar 显示的提示 (MiniMessage 格式)
82104
# 已做频繁触发优化,1s 内只会发送一次, 填空字符串 "" 则不会向玩家发送
83-
message:
105+
messages:
84106
anti-world-edit: "{plugin-prefix} <red>你没有权限修改这个世界.</red>"
85107
anti-pvp: "{plugin-prefix} <red>已禁止在该世界 PVP.</red>"
86-
# ... 其他消息
108+
anti-player-enter: "{plugin-prefix} <red>你没有权限进入这个世界.</red>"
109+
anti-block-interaction: "{plugin-prefix} <red>你没有权限与这个世界的方块交互.</red>"
110+
anti-attack-entity: "{plugin-prefix} <red>已禁止对此世界的实体造成伤害.</red>"
111+
anti-entity-interaction: "{plugin-prefix} <red>已禁止与此世界的生物交互.</red>"
112+
anti-pickup-drop-items: "{plugin-prefix} <red>已禁止在此世界捡起或丢弃物品.</red>"
113+
anti-use-item: "{plugin-prefix} <red>已禁止在此世界使用物品.</red>"
114+
player-gamemode-change: "{plugin-prefix} <red>游戏模式已与该世界统一</red>"
87115

88-
# 继承配置示例
89116
common:
90-
parent: default # 继承 default 配置
91-
anti-world-edit: true
117+
# 仅需添加你想调整的设置,其他设置默认继承 default
118+
# 你也可以手动指定 parent,继承其他配置
119+
# parent: default
92120
anti-explosion: true
93121

94-
hub-config:
95-
parent: common # 继承 common 配置
122+
hub:
123+
parent: common
124+
# 仅需添加你想在 common 基础上调整的设置
125+
anti-world-edit: true
96126
anti-block-interaction: true
97127
anti-attack-entity: true
98128

129+
messages:
130+
anti-world-edit: "{plugin-prefix} <red>你不能修改主城的任何方块.</red>"
131+
132+
enter-message:
133+
title: "<b>欢迎来到主城</b>\n<yellow>祝您在此服务器玩的开心!</yellow>"
134+
duration: 3
135+
136+
137+
99138
# 指定哪些世界使用哪个配置
139+
# 未指定的默认使用 default 配置
140+
# 指定为 disable 则将在该世界禁用 WorldUtils
100141
world-config:
101-
"world": common # world 世界使用 common 配置
102-
"hub": hub-config # hub 世界使用 hub-config 配置
103-
"world_the_end": disable # 在此世界禁用 WorldUtils
142+
"world": common
143+
"hub": hub # 使世界使用 hub 配置
144+
"world_the_end": disable
104145
```
105146
106147
### 功能说明
107148
108-
| 保护类型 | 说明 | 涵盖事件 | Folia 支持 |
149+
| 保护类型 | 描述 | 涵盖事件 | Folia 支持 |
109150
|---------------------------|-----------|-------------------------|----------------------------------|
110151
| `anti-world-edit` | 禁止修改世界 | 禁止方块放置/破坏、桶操作、画/物品展示框交互 | 完整支持✅ |
111152
| `anti-pvp` | 禁止玩家之间战斗 | 取消玩家间伤害 | 完整支持✅ |
@@ -117,6 +158,7 @@ world-config:
117158
| `anti-pickup-drop-items` | 禁止丢弃/拿取物品 | 禁止玩家在该世界捡起或丢弃物品 | 完整支持✅ |
118159
| `anti-use-item` | 禁止使用物品 | 拦截丢雪球、鸡蛋,射箭,使用刷怪蛋等 | 完整支持✅ |
119160
| `world-gamemode` | 独立世界游戏模式 | 切换世界时更改游戏模式 | 完整支持✅ |
161+
| `cancel-player-collision` | 取消玩家碰撞 | 禁止玩家推动该世界的实体使其位置改变 | 完整支持✅ |
120162

121163
## 🎮 命令与权限
122164

@@ -146,7 +188,8 @@ world-config:
146188
- `wu.bypass.<world>.anti-entity-interaction` - 绕过指定世界的实体交互保护
147189
- `wu.bypass.<world>.anti-pickup-drop-items` - 绕过指定世界的丢弃/拿取物品保护
148190
- `wu.bypass.<world>.anti-use-item` - 绕过指定世界的使用物品保护
149-
- `wu.bypass.change-gamemode` - 拥有次权限 WU 将不会修改您的游戏模式
191+
- `wu.bypass.change-gamemode` - 拥有此权限 WU 将不会修改您的游戏模式
192+
- `wu.bypass.cancel-player-collision` - 拥有此权限 WU 将不会调整您的碰撞效果
150193
---
151194

152195
如果您遇到问题或有功能建议,请在 [GitHub Issues](https://github.com/StarCodeClub/WorldUtils/issues) 提交。

0 commit comments

Comments
 (0)