Repository navigation
Commit 7218d04
authored
fix(invulnerable): 无敌模式不再被创造模式玩家绕过, 默认值改回开启 (#69)
#67 无敌模式对创造模式玩家无效:
- 原版 Entity#isInvulnerableTo() 的条件含 !source.isCreativePlayer(), 创造模式攻击被显式放行
- 因此只 setInvulnerable(true) 挡不住创造模式玩家, 管理员在创造模式下测试即「无敌无效」
- PlayerListener 新增 EntityDamageEvent 监听: 无敌假人 + 直接造成伤害的创造模式玩家 -> 取消事件
- 虚空 / /kill 等原版就该绕过无敌的来源不受影响
#68 默认值与文档不符:
- Feature.invulnerable 默认选项 false -> true
- config.yml default-features.invulnerable false -> true, version 24 -> 25
- README 一直写「假人默认开启无敌模式」, 现让行为与文档一致
本地实机验证 (Purpur 26.3): 无该配置键时生成即 Invulnerable:1b; 创造模式攻击被挡;
/kill 仍生效; 控制台 /damage 被挡。
Co-authored-by: EndlessPixel <EndlessPixel@users.noreply.github.com>1 parent aacc67e commit 7218d04
4 files changed
Lines changed: 40 additions & 3 deletions
File tree
- fakeplayer-core/src/main
- java/io/github/hello09x/fakeplayer/core
- listener
- repository/model
- resources
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
44 | 69 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
0 commit comments