斗篷
适用于 Paper 的自定义玩家斗篷。玩家通过浏览器上传斗篷图片并在游戏中佩戴。
客户端所需的一切(模型、纹理和一个小核心着色器)都由插件构建并提供的资源包交付。无需客户端模组,也无需外部资源包。
功能
- 从浏览器上传。
/cape upload 提供一个一次性链接,指向带有实时预览的上传页面。JPG 和 WebP 格式会自动转换为 PNG。
- 原版行为。 斗篷附着在肩膀上,并使用原版斗篷物理效果:行走时摆动,奔跑和下落时抬起,并位于胸甲之上。它会随身体平滑转动。与原版一样,它在你的第一人称视角中隐藏,而在第三人称视角(F5)中可见。
- 鞘翅。 装备的鞘翅会使用与斗篷相同的图像作为纹理。
- 每个斗篷一个小型资源包。 上传新斗篷时,仅向需要它的玩家发送资源包。其他玩家不会收到资源重载。
- 斗篷菜单。
/cape 打开包含你所有斗篷的菜单:装备、卸下、删除、上传。
- 彩色名称。 聊天和菜单中的斗篷名称会根据斗篷自身的颜色进行着色。
- 可配置。 限制、斗篷大小和位置、强制资源包以及所有消息 (MiniMessage)。
要求
- Paper 1.21.11, 26.1.x, 26.2 或 26.3
- Java 21 用于 1.21.11,Java 25 用于 26.x(取决于你的 Paper 版本所需的 Java 版本)
- 内置 Web 服务器的一个开放 TCP 端口(默认
8085)
安装
- 将
Capes-<version>.jar 放入 plugins/ 目录并启动服务器。
- 在
plugins/Capes/config.yml 中将 public-url 设置为玩家可以访问的地址,例如
http://your.server.ip:8085。
- 在你的防火墙 / 托管面板中开放该端口。
- 重启服务器(Web 服务器端口仅在启动时读取)。
命令
| 命令 |
描述 |
权限 |
/cape |
打开斗篷菜单 |
capes.use |
/cape upload |
获取一次性上传链接 |
capes.use |
/cape set <name> |
装备其中一个斗篷 |
capes.use |
/cape remove |
卸下你的斗篷 |
capes.use |
/cape list |
在聊天中列出你的斗篷 |
capes.use |
/cape pack |
重新发送斗篷资源包 |
capes.use |
/cape reload |
重载配置、消息和资源包 |
capes.admin |
/cape admin remove <player> <name> |
删除其他玩家的斗篷 |
capes.admin |
capes.use 默认授予所有人,capes.admin 授予操作员。
斗篷图像
使用标准的 Mojang 斗篷布局:64×32 像素,或者 2:1 的倍数,如 128×64。
同一张图像也提供鞘翅翅膀的纹理,就像原版斗篷一样。
资源包和着色器
每个斗篷都有自己独立的资源包,由插件在 <public-url>/pack/<name>.zip 处提供服务。这些资源包叠加在服务器自带的资源包之上,绝不会替换它。
这些资源包适用于从 1.21.11 到 26.3 的客户端,包括通过 ViaVersion 加入且客户端版本与服务器不同的玩家。
为了在第一人称视角中隐藏自己的斗篷,资源包包含一个核心着色器:原版物品着色器加上一个小分支。拥有者副本的斗篷被着以 rgb(1, 255, 3) 色,当相机紧贴其旁边时(第一人称),着色器会丢弃该副本。
每个客户端版本都有其各自的物品着色器,因此资源包作为覆盖层携带每个版本的着色器,每个客户端只加载属于自己的那个:
| 客户端 |
覆盖层 |
着色器 |
| 1.21.11 |
capes_1_21_11 |
rendertype_item_entity_translucent_cull.vsh / .fsh |
| 26.1.x |
capes_26_1 |
item.vsh / item.fsh |
| 26.2 |
capes_26_2 |
item.vsh / item.fsh |
| 26.3 |
capes_26_3 |
item.vsh / item.fsh |
着色器源代码随插件 jar 包一起分发,位于 pack/overlays/ 下。其他客户端没有着色器:斗篷可以正常工作,但拥有者也会在第一人称视角中看到自己的斗篷。
Minecraft 只使用每个着色器的一个副本,即最后加载的资源包中的那个。如果你的服务器已经发送了带有自己物品着色器的资源包,请执行以下操作之一:
- 设置
generate-shader: false 并将上述匹配文件中标记为 Capes plugin 的分支复制到你的着色器中,或者
- 设置
hide-own-cape: false。此时不需要着色器,你也将在第一人称视角中看到自己的斗篷。
许可证
MIT。
Capes
Custom player capes for Paper. Players upload a cape image from their browser and wear it in game.
Everything the client needs (models, textures and a small core shader) is delivered in resource
packs that the plugin builds and serves itself. No client mods and no external resource pack are
required.
Features
- Upload from the browser.
/cape upload gives a one-time link to an upload page with a live
preview. JPG and WebP are converted to PNG automatically.
- Vanilla behaviour. The cape is attached to the shoulders and uses vanilla cape physics: it
sways while walking, lifts when running and falling, and sits over a chestplate.
It turns smoothly with the body. Like vanilla, it is hidden from your own first-person view and
visible in third person (F5).
- Elytra. Equipped elytra get wings textured from the same cape image.
- One small pack per cape. Uploading a new cape sends a pack only to the players who need it.
Nobody else gets a resource reload.
- Cape menu.
/cape opens a menu with your capes: equip, unequip, delete, upload.
- Coloured names. Cape names in chat and in the menu are tinted with the cape's own colours.
- Configurable. Limits, cape size and position, forced packs, and all messages
(MiniMessage).
Requirements
- Paper 1.21.11, 26.1.x, 26.2 or 26.3
- Java 21 for 1.21.11, Java 25 for 26.x (whatever your Paper version already needs)
- One open TCP port for the built-in web server (default
8085)
Installation
- Put
Capes-<version>.jar into plugins/ and start the server.
- In
plugins/Capes/config.yml set public-url to an address players can reach, for example
http://your.server.ip:8085.
- Open that port in your firewall / hosting panel.
- Restart the server (the web server port is only read on startup).
Commands
| Command |
Description |
Permission |
/cape |
Open the cape menu |
capes.use |
/cape upload |
Get a one-time upload link |
capes.use |
/cape set <name> |
Equip one of your capes |
capes.use |
/cape remove |
Unequip your cape |
capes.use |
/cape list |
List your capes in chat |
capes.use |
/cape pack |
Re-send the cape resource packs |
capes.use |
/cape reload |
Reload config, messages and packs |
capes.admin |
/cape admin remove <player> <name> |
Delete another player's cape |
capes.admin |
capes.use is granted to everyone by default, capes.admin to operators.
Cape images
Use the standard Mojang cape layout: 64×32 pixels, or a 2:1 multiple such as 128×64.
The same image also provides the elytra wings, exactly like vanilla capes.
Resource packs and the shader
Each cape gets its own pack, served by the plugin at <public-url>/pack/<name>.zip. Packs are
added on top of the server's own resource pack, never replacing it.
Packs work for clients from 1.21.11 to 26.3, including players who join through ViaVersion
with a different client version than the server.
To hide your own cape in first person, the packs include a core shader: the vanilla item shader
plus one small branch. The owner's copy of the cape is tinted rgb(1, 255, 3), and the shader
drops that copy when the camera is right next to it (first person).
Each client version has its own item shader, so the pack carries one per version as a pack
overlay, and every client loads only its own:
| Client |
Overlay |
Shader |
| 1.21.11 |
capes_1_21_11 |
rendertype_item_entity_translucent_cull.vsh / .fsh |
| 26.1.x |
capes_26_1 |
item.vsh / item.fsh |
| 26.2 |
capes_26_2 |
item.vsh / item.fsh |
| 26.3 |
capes_26_3 |
item.vsh / item.fsh |
The shader sources ship inside the plugin jar under pack/overlays/. Other
clients get no shader: the cape works, but its owner also sees it in first person.
Minecraft uses only one copy of each shader, the one from the last loaded pack. If your server
already sends a resource pack with its own item shader, either:
- set
generate-shader: false and copy the branches marked Capes plugin from the matching file
above into your shader, or
- set
hide-own-cape: false. The shader is then not needed, and you will also see your own cape in
first person.
License
MIT.
评论 0
登录后参与评分
还没有评论,来抢沙发吧