Skip to content

Commit daa421f

Browse files
committed
add more documentation
1 parent 95d3fcb commit daa421f

4 files changed

Lines changed: 100 additions & 2 deletions

File tree

doc/CONFIG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This is the default config:
4040
},
4141
"UnusedFileValidator": {
4242
"enabled": true,
43-
"logLevel": "ERROR",
43+
"logLevel": "WARN",
4444
"ignore": []
4545
},
4646
"TextureIsNotCorruptedValidator": {

doc/VALIDATORS.md

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,121 @@ Checks if all hashprefixed referenced textures (e.g. #side) are bound to a textu
144144
## ModelOverridesExistsValidator
145145
Checks if item overrides are correct and the referenced model exists.
146146

147+
> [!NOTE]
148+
> This validator only takes model overrides from before 1.21.4 into account (not the new item definitions inside the items subfolder)
149+
150+
<details>
151+
<summary>Failing Examples</summary>
152+
<ul>
153+
<li><br>
154+
<pre lang="json">{
155+
"parent": "minecraft:item/generated",
156+
"textures": {
157+
"someKey": "someValue"
158+
},
159+
"overrides": [
160+
{
161+
"predicate": {
162+
"custom_model_data": 1
163+
},
164+
"model": "some/path/not_existing"
165+
}
166+
]
167+
}</pre><br>
168+
In this example the override references a model path, which can not be resolved to a model json (e.g. the file does not exist or is located wrongly)
169+
</li>
170+
</ul>
171+
</details>
172+
147173
## UnusedFileValidator
148174
Checks every file if it has been referenced in any json file. Most files need to be referenced somewhere, but this check may falsely detect files, which are in use. This will not flag for vanilla texture/model overrides. Files can be ignored with the `ignore` option using shell globs or regex.
149175

176+
> [!NOTE]
177+
> This validator may have many false-positives and false-negatives
178+
179+
150180
## TextureLimitMipLevelValidator
151181
Checks every PNG file, that will be loaded into the texture atlas, if it limits the mipmap levels. If the mip level drops below 4, the game displays certain textures with lower quality (e.g. leaves).
152182

183+
<details>
184+
<summary>Details</summary>
185+
Whenever a texture is loaded, which does not respect the texture sizes required for mip mapping, it may drop the usable mip level. For mip mapping to work (for mip map level 4) you need to have a texture size of at least 16x16, height and width should be divisible by 16 without a remainder. For comparison: Here are two screenshots with mip level 0 and mip level 4 (differences mostly notable on distant leaves):<br><br>
186+
Mip Level 4:<br>
187+
<img alt="minecraft screenshot with mip level of 4" src="img/mip_level_4.png" /><br><br>
188+
Mip Level 0:<br>
189+
<img alt="minecraft screenshot with mip level of 0" src="img/mip_level_0.png" />
190+
</details>
191+
<details>
192+
<summary>Fixing textures</summary>
193+
To fix textures that do limit the mip level, you simply need to adjust their size to be divisible by 16 without remainder. This may also involve changing the model files for UV mapping.
194+
</details>
195+
196+
153197
## TextureIsNotCorruptedValidator
154198
Checks every PNG file, that is located in any resource pack directory, if the texture is an actual image.
155199

156200
## FontTextureExistsValidator
157201
Checks if the texture file referenced in the font provider exists.
158202

203+
<details>
204+
<summary>Failing Examples</summary>
205+
<ul>
206+
<li><br>
207+
<pre lang="json">{
208+
"providers": [
209+
{
210+
"type": "bitmap",
211+
"file": "some/path/not_existing.png",
212+
"ascent": 4,
213+
"height": 10,
214+
"chars": [
215+
"\uE000"
216+
]
217+
}
218+
]
219+
}</pre><br>
220+
In this example the font provider references a texture which does not exist.
221+
</li>
222+
</ul>
223+
</details>
224+
225+
159226
## FontCharacterUsageValidator
160227
Checks if a font file defines a character multiple times, which overrides the character.
161228

229+
<details>
230+
<summary>Failing Examples</summary>
231+
<ul>
232+
<li><br>
233+
<pre lang="json">{
234+
"providers": [
235+
{
236+
"type": "bitmap",
237+
"file": "some/path/file1.png",
238+
"ascent": 4,
239+
"height": 10,
240+
"chars": [
241+
"\uE000"
242+
]
243+
},
244+
{
245+
"type": "bitmap",
246+
"file": "some/path/file2.png",
247+
"ascent": 4,
248+
"height": 10,
249+
"chars": [
250+
"\uE000"
251+
]
252+
}
253+
]
254+
}</pre><br>
255+
In this example the font provider references the same character twice, which would override the character.
256+
</li>
257+
</ul>
258+
</details>
259+
162260
## InvalidPathValidator
163261
Checks if a namespace or resource path violates the allowed pattern: [a-z0-9-_.] (for namespaces) and [a-z0-9-_./] for paths.
164262

165263
## ModelRequiresOverlayOverrideValidator
166-
Checks if a model json, which is present in the default pack, is also present in a specified overlay. This Validator requires some additional configuration to run and may be used to make sure every model in a specified path is overridden in a specific overlay (e.g. to fix certain models in certain game versions).
264+
Checks if a model json, which is present in the default pack, is also present in a specified overlay. This Validator requires some additional configuration to run and may be used to make sure every model in a specified path is overridden in a specific overlay (e.g. to fix certain models in certain game versions). Take a look at the [config file](CONFIG.md) for more details on how to configure this validator.

doc/img/mip_level_0.png

3.58 MB
Loading

doc/img/mip_level_4.png

3.21 MB
Loading

0 commit comments

Comments
 (0)