You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The simples way to display a cape is by going into the `config/cape-provider` directory and creating a cape texture file named `cape.png`.
39
+
40
+
Additionally there are the following optional files:
41
+
*`owners.txt` - Determines which player names or UUIDs will get the cape displayed. If this file is not present then all players will display with the cape.
42
+
*`name.txt` - To override the display name of the provider
43
+
44
+
You can also add more providers by creating corresponding directories in `config/cape-provider/simple-custom`.<br/>Example: `config/cape-provider/simple-custom/my-super-cool-provider/cape.png`
45
+
46
+
#### Remote Provider in configuration
47
+
48
+
> Recommended for:
49
+
> * Users that want to add a custom remote provider
50
+
29
51
This demo showcases how to apply the capes inside [``custom-cape-demo``](https://github.com/litetex-oss/mcm-cape-provider/tree/dev/custom-cape-demo).
30
52
31
-
1. Open the config file located in ``config/cape-provider.json5``
32
-
2. In the ``customProviders`` section add the following entry:
53
+
1. Open the config file located in ``config/cape-provider/config.json``
54
+
2. In the ``remoteCustomProviders`` section add the following entry:
33
55
```jsonc
34
56
{
35
57
"id":"cp1",
@@ -51,31 +73,64 @@ This demo showcases how to apply the capes inside [``custom-cape-demo``](https:/
51
73
</details>
52
74
3. Restart the game and activate the provider
53
75
54
-
For more details have a look at [CustomProvider](https://github.com/litetex-oss/mcm-cape-provider/tree/dev/src/main/java/net/litetex/capes/provider/CustomProvider.java) and [CustomProviderConfig](https://github.com/litetex-oss/mcm-cape-provider/tree/dev/src/main/java/net/litetex/capes/config/CustomProviderConfig.java)
76
+
For more details have a look at [RemoteCustomProvider](https://github.com/litetex-oss/mcm-cape-provider/tree/dev/src/main/java/net/litetex/capes/provider/custom/remote/RemoteCustomProvider.java) and [RemoteCustomProviderConfig](https://github.com/litetex-oss/mcm-cape-provider/tree/dev/src/main/java/net/litetex/capes/provider/custom/remote/RemoteCustomProviderConfig.java)
55
77
56
-
##### Maximum size
78
+
NOTE: Texture resolvers can be selected using the `textureResolverId`attribute (see below for details).
57
79
58
-
Images/Textures should not exceed 10MB otherwise they might be ignored.
80
+
#### via Mods
59
81
60
-
##### Texture resolvers / Animated textures
82
+
> Recommended for:
83
+
>* Mods
61
84
62
-
Texture resolvers can be selected using the `textureResolverId` attribute.
63
-
The following resolvers are currently built-in:
85
+
If you are a mod developer and want to e.g. display a cape for supporters or contributors of your mod, you can provide it using the mod's resources and/or metadata in ``fabric.mod.json``.
86
+
The overall behavior is similar to how [``modmenu``](https://github.com/TerraformersMC/ModMenu?tab=readme-ov-file#fabric-metadata-api) handles this.
64
87
65
-
| Resolver-ID| Animated | Format | Example | Notes |
|`gif`| ✔ | [GIF](https://de.wikipedia.org/wiki/Graphics_Interchange_Format) | [animated.gif](https://raw.githubusercontent.com/litetex-oss/mcm-cape-provider/refs/heads/dev/custom-cape-demo/animated.gif) | _Usage not recommended_<br/>GIFs require more resources when compared to more modern formats like PNG. |
88
+
##### Local/Simple (Recommended)
70
89
71
-
Please note that animated textures can be frozen or completely disabled in the settings.
90
+
This approach requires no network communication and is the recommended approach.
91
+
It works by reading metadata and resources from the `cape` directory.
92
+
93
+
Here is an example:
94
+
1. Add the following mod metadata:
95
+
``fabric.mod.json``
96
+
```json5
97
+
{
98
+
...
99
+
"custom": {
100
+
"cape": "Contributors"
101
+
}
102
+
}
103
+
```
104
+
2. Create a `cape` directory inside `resources`
105
+
3. Add the cape texture in `cape/cape.png`
106
+
4. Add the players that should be given the cape in `cape/owners.txt` with their UUIDs or names
72
107
73
-
#### As a developer / Proving capes through mods
108
+
<details><summary>Note: There is also a more detailed variant</summary>
74
109
75
-
If you are a mod developer and want to e.g. display a cape for supporters of your mod, you can provide it using the mod's metadata / ``fabric.mod.json``.
76
-
The overall behavior is similar to how [``modmenu``](https://github.com/TerraformersMC/ModMenu?tab=readme-ov-file#fabric-metadata-api) handles this.
110
+
``fabric.mod.json``
111
+
```json5
112
+
{
113
+
"custom": {
114
+
"cape": {
115
+
"name-extra": "Contributors",
116
+
"owners": {
117
+
// You can also used UUIDs
118
+
"names": [
119
+
"Notch"
120
+
]
121
+
}
122
+
}
123
+
}
124
+
}
125
+
```
77
126
78
-
Here's a simple implementation:
127
+
</details>
128
+
129
+
The mod uses this strategy itself. See the [`fabric.mod.json`](https://github.com/litetex-oss/mcm-cape-provider/tree/dev/src/main/resources/fabric.mod.json) or [`cape` directory](https://github.com/litetex-oss/mcm-cape-provider/tree/dev/src/main/resources/cape) for details.
130
+
131
+
##### Remote
132
+
133
+
Here's an example implementation that shows how a remote cape provider can be added:
79
134
80
135
``fabric.mod.json``
81
136
```json5
@@ -108,8 +163,28 @@ Here's a simple implementation:
108
163
109
164
</details>
110
165
166
+
#### Programmatic
167
+
111
168
You can also create a [programmatic cape provider](https://github.com/litetex-oss/mcm-cape-provider/tree/dev/PROGRAMMATIC_PROVIDER.md).
112
169
170
+
### Further notes
171
+
172
+
#### Maximum size
173
+
174
+
Images/Textures should not exceed 10MB. Otherwise they might be ignored.
175
+
176
+
#### Texture resolvers / Animated textures
177
+
178
+
The following resolvers are currently built-in:
179
+
180
+
| Resolver-ID | Animated | Format | Example | Notes |
| `gif` | ✔ | [GIF](https://de.wikipedia.org/wiki/Graphics_Interchange_Format) | [animated.gif](https://raw.githubusercontent.com/litetex-oss/mcm-cape-provider/refs/heads/dev/custom-cape-demo/animated.gif) | _Usage not recommended_<br/>GIFs require more resources when compared to more modern formats like PNG. |
185
+
186
+
Please note that animated textures can be frozen or completely disabled in the settings.
0 commit comments