-
Notifications
You must be signed in to change notification settings - Fork 1
Resource Pack Generator
If manually converting mp3s and hand-editing JSON isn't your idea of a fun time, this project provides an alternative in the form of a stand-alone and portable (read: no installation or setup required) resource pack generator.
- Download the executable from the release page that matches your operating system and your version of the mod.
- Depending on your operating system and security settings, you may need
to explicitly make the resource pack generator executable (on *nix systems,
you can do this from a terminal by running
chmod u+x /path/to/FoxNapRPG
or by going into Properties in most file managers).
You can also build the generator from source.
Place the generator executable in an empty folder, then move any music you
want to turn into records into that folder. There is no limit to the
number of tracks you can include, and they do not need to be pre-converted
to Ogg. The only requirement is that
the files have to be
decodable by
ffmpeg
.
Pro Tip: if your music files include metadata, the title and artist name will get automatically extracted, and any album art will be used to help generate the music disc texture.
When you're ready, simply double-click the FoxNapRPG
executable. A terminal window may pop
up showing progress of the resource pack creation, and before you know it you should have some
new files in your current directory:
-
FoxNapRP.zip
is the resource pack containing all your converted songs and music disc textures, and you can throw that into your Minecraftresourcepacks
folder -
FoxNapDP.zip
is the datapack that defines all the properties of the tracks themselves. You'll need to put this pack into thedatapacks
folder of any world where you want to use your music (see note below about multiplayer). -
foxnap.yaml
needs to go into your Minecraftconfig
folder. This tells the game how many music discs to enable for you.
You can also run the generator from the command-line, which will give you access to a bunch of additional customization options, such as setting the directories to search for music or the locations the generated resource pack and mod config should be saved.
For further details, run:
$ ./FoxNapRPG --help
from the folder where you saved the generator executable.
The Resource Pack Generator also allows you to finely tune the resource pack generation behavior via a configuration file. The pack generator currently supports the following formats:
- INI (.ini, .cfg, .config, .conf, .txt)
- JSON (.json)
- CSV (.csv, .tsv) where each entry specifies a single track via either its full path or its file name.
For each track, you can specify:
-
num
: a track number (to override the tracks bundled with the mod or just to make sure the tracks are ordered consistently) -
description
: the name to give to the track (if you don't want this read from the ID3 tag) -
hue
: the color to give to the vinyl part of the record template -
use_album_art
: whether the album art (embedded in the track tag data) for the inlay
To use a spec configuration file when running the resource pack generator, use the -s
command-line
flag, e.g.
$ ./FoxNapRPG -i /path/to/my/music -s track_specs.csv
Example spec files can be found here.
You can also build the generator from source.
- Clone this repo
-
Download or install a version of
ffmpeg
that can decode files from your music library and that has support for encoding usinglibvorbis
. Put the executable (or symbolic links to the executable) in thefoxnap_rpg/bin
folder. - Create and activate a virtual environment using python 3.10 or above
- If you have a
conda
-based environment and package manager installed on your system, such as mambaforge, you can use the project's dedicated dev/build environment, creatable from the repo root viamamba env create -f environment.yml
(substituteconda
formamba
as needed)
- If you have a
- From the repo's root, with your virtual environment activated, run
python -m pip install .
- At this point, you have two options:
- Use FoxNap as a python package, with
$ FoxNapRPG
available from the command line - Create a stand-alone executable using
pyinstaller
( included in theconda
environment). The scripts./rpg-build.sh
for *nix or.\rpg-build.bat
for Windows are available for reference.
- Use FoxNap as a python package, with