Skip to content

Content Tool Tutorial ‐ From 1.12.2 Earlier Bulk Import

Flan edited this page Apr 8, 2024 · 1 revision

Requirements

This tutorial depends on having the Tool setup in a Unity project and will use the Flan's Mod Toolbox panel.
If you are missing this, you can find it here.

1. Add Legacy Packs to Import Folder

Using the Flan's Mod Toolbox, select the Import tab.
Click the "Open Import Folder" button to find the "Content Packs" folder, then drag and drop your content pack source folder in there.
image
The root folder should look like "{Unity Project}/Import/Content Packs/{your pack name}/..." and contain content folders such as "aaguns", "boxes", "bullets" and "assets".
image

Now go back to the Toolbox and click "Open Models Folder" to get to the "Java Models" folder.
Place your java model package in this folder, making sure you copy over the .java files, not compiled .class files.
The pack id is the old folder name of your java files, which used to be stored at "src/main/java/com/flansmod/{id}/".
This should look like "{Unity Project}/Import/Java Models/{your pack id}/...".
Notably, the "src/main/java/com/flansmod/" part is ignored.

2a. Mass Import the Pack

The first option is to import an entire 1.12 (or earlier) pack and have the tool auto-create both Definitions and Models.
image
Each pack has 3 main buttons

  • Refresh: This calculates how many assets are in the source pack, and how many assets it will create when imported.
  • Import (No Overwrite): This imports any new assets, but will not overwrite any assets you already imported.
  • Import (Overwrite): This imports all assets in the pack, overwriting anything already imported.

image
To avoid a lot of lag in the Import tab, lots of data is left uncalculated until you click on the refresh button for each pack or subset of that pack. If you see "[?] Output Assets", this is because the data needs to be calculated manually.
Also, when clicking any button that starts a long chain of operations, like a full pack import, a progress bar will be displayed.

Once the import process is complete, you will find your imported assets at "Assets/Content Packs/{your pack name}".
There is also a "ContentPack" asset, called "{your pack name}.asset" at the root of that folder, which is where we will pick up for the next part of the tutorial.

2b. Import Models Only

You might not want to use data from old packs, or you might be exporting new models from Toolbox, BlockBench or similar programs.
In this case, it is possible to import a specific model to a specific location, one at a time.
To get to this mode, select the "Import Models" tab in the "Import" tab.
image
Note: You need a ContentPack asset as your target before you can import one of these. See: TODO create content tutorial.
Once you have a ContentPack to import into, select it from the dropdown on the right of your model namespace.

You will now be able to see where each model will be imported to by expanding the pack dropdown (triangle on the left side).
Any models that already exist will have a red name as making a new import will overwrite the originals.
image
Click on the import button and the Tool will create the model as a .prefab at the specified location.