Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add resourcepack linting and cleanup .ajmodel export files #62

Merged
merged 26 commits into from
Jan 8, 2024

Conversation

TheAfroOfDoom
Copy link
Owner

Summary

When working on #8, we realized that an update to either Blockbench or Animated Java caused diffs in AJ's exported files. This PR runs the exporter again manually on each .ajmodel file to ensure cleaner diffs once #8 is complete.

During this process, we decided to also cleanup all the warnings that appear in the Minecraft log upon resourcepack reload (F3 + T). In particular, we were getting warnings relating to the miplevel (Wikipedia, Minecraft-specific context) being dropped from 4 to 0 due to our textures' dimensions not being divisible by 16.

Texture animated_java:item/attacks/homing-vine-blinking-lane with size 1x1 limits mip level from 4 to 0
minecraft:textures/atlas/blocks.png: dropping miplevel from 4 to 0, because of minimum power of two: 1

custom linting rules

This PR also adds the infrastructure to support custom linting rules we can run on the datapack/resourcepack files. We added a workflow so that they also run in GitHub Actions.

We add a linting rule that checks every texture file in the resourcepacks directory (.png files) and ensures that their width/heights are divisible by 16.

These custom linting rules can be ran with yarn start lint.resourcepack.


Test plan

models whose textures were modified were re-tested in game to ensure they still functioned/animated/remained the same visually

Reproducing in-game

N/A -- map behavior/visuals should remain unchanged

Preview

image


Supplemental changes

  • fix warning.png file deleting upon AJ export: a274d2c

- converted file dimensions to be square (2 140x140 frames animated = 140x280)
…textures instead of `projectile-star.png` sprite file
… to fix mipmap warning in console

- warning: `Texture animated_java:item/attacks/homing-vine-blinking-lane with size 1x1 limits mip level from 4 to 0`
- if a texture isn't (e.g. its width is 1 pixel), we get a warning in the Minecraft game output (log)
- e.g. `Texture animated_java:item/black with size 1x1 limits mip level from 4 to 0`
- resize 1x1, 1x2 etc images to be 16x16, 16x32 etc
- had to also update model's UV mapping
@TheAfroOfDoom TheAfroOfDoom merged commit de4f163 into main Jan 8, 2024
4 checks passed
@TheAfroOfDoom TheAfroOfDoom deleted the miscellaneous-ajmodel-cleanup branch January 8, 2024 09:50
@TheAfroOfDoom TheAfroOfDoom changed the title add resourcepack linting for texture dimensions and cleanup .ajmodel export files add resourcepack linting and cleanup .ajmodel export files Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant