|
|
||
|---|---|---|
| .. | ||
| averageColors.js | ||
| deleteBlocks.sh | ||
| filter.js | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| regex.json | ||
| resize.js | ||
| spritesheet.js | ||
@blockmatic/generator
Collection of Node.JS scripts to generate data for blockmatic. See below to see how to use these scripts (they are also in order of use). A bit of knowledge of blockmatic is needed to put the files into the correct locations.
Before running any of these scripts you need to have a blocks directory with Minecraft textures in them. See below on how to do that.
- Create a
blocksdirectory - Open a Minecraft client jar in a zip extraction program (such as 7zip, WinRAR, Xarchiver, etc.)
- Go to
assets/minecraft/textures/blocks - Copy all textures into the
blocksdirectory
filter.js
Deletes every unneeded texture in the
blocksdirectory
- Run
node filter.js - Every unneeded texture has been deleted
resize.js
Resizes image files bigger than 16x16 (these files are usually for animations such as fire)
- Run
node resize.js - Every file has been resized accordingly
averageColors.js
Calculates the average color for each texture and outputs it into a JSON file
- Run
node averageColors.js - In the
datadirectory there should be a JSON file generated - Put that JSON file into
src/data
spritesheet.js
Generates a spritesheet for Pixi.JS to use
- Run
node spritesheet.js - In the
datadirectory there should be two files generated -spritesheet.jsonandspritesheet.png - Put
spritesheet.pnginto thepublicfolder - Put
spritesheet.jsonintosrc/data
deleteBlocks.sh
(MacOS and Linux only) Deletes every file in the
blocksfolder
You probably don't need to run this script.
$ chmod +x ./deleteBlocks.sh
$ ./deleteBlocks.sh