Palm Trees
This document serves as a general guide for adding new palm fruit trees to TFG. And an explanation of class functions.
Core Mod Side
Step 1) Enum Entry
To add new Palm Fruit Trees first locate the enum class PalmTrees and add a new enum entry following the format
java
PalmTrees(int defaultGrowthDays, int foliageColorIndex, int minGrowthSize, int maxGrowthSize, int minDrops, int maxDrops, Integer clusterAges, String clusterModelShape, boolean specialCluster, boolean specialFruit, Lifecycle[] stages)- defaultGrowthDays: Default number of days required for growth.
- foliageColorIndex: Sets the color of the leaves based on TFC foliage index (foliage.png). Range from 0 to 255
- minGrowthSize: Sets the minimum number of stage 2 trunk blocks for the final growth tree size. (5 blocks will always be placed below)
- maxGrowthSize: Sets the maximum number of stage 2 trunk blocks for the final growth tree size. (5 blocks will always be placed below)
- minDrops: Sets the minimum number of fruit drops when mature.
- maxDrops: Sets the maximum number of fruit drops when mature.
- clusterAges: Sets the number of age states for the cluster block.
- clusterModelShape: Sets the model shape for the cluster block. Available options: "square", "bundle", "double_bundle", "string"
- specialCluster: If false, the cluster block will be automatically generated with {@link PalmClusterBlock}. If true, a dedicated class should be made.
- specialFruit: If false, the fruit will be automatically generated as an item. If true, a dedicated class should be made.
- stages: Lifecycle stages. Only valid stages are {@link Lifecycle#FRUITING} and {@link Lifecycle#DORMANT}.
Step 2) Assets
- Add textures in the palm_tree asset folder for blocks, items, and food.
- Add models for palm heads although you can just use another palm head as the parent model. But it is still recommended to use unique textures for all palm tree entries to keep them somewhat distinguishable.
- Optional*: add climate range jsons to the data folder to be able to test the trees in the dev environment. But climate data should still be added on the modpack side for consistency.
Step 3) runData
Run runData to generate blockstate, model, and loot jsons.
Modpack Side
Step 1) Climate Range and Fruits
- Add climate range data to the constant. Make sure to specify what dimension the tree can be found in. This does not impact anything except for the sapling tooltip information.
- While you are in this file add fruit info to the fruit constant. This will generate jams, and other fruit related items/ recipes.
Step 2) Food Data
- Add food data to your palm tree products.
Step 3) Assets
- Enable GEN_JAM_MODELS and start the modpack once to generate jam models if you are adding new fruit types. Remember to set the boolean to false again before pushing.
- Add jam textures.
- Add planter textures for the Firmalife Greenhouse hanging planters. Its just a 3x3 square in the top left corner of a 16x16 texture.
Step 4) Worldgen
- Create structure nbt files for each height size for each tree and place the structures in the data folder. Remember to fill in the empty spaces with structure voids except for the areas where the palm clusters grow; leave those as air. You can also just copy a pre-existing palm tree structure and use an nbt editor to replace the blocks with the ones from your own palm tree.
- Create configured feature jsons for each tree.
- Create placed feature jsons for each tree.
- Add biome tags for the placed features to enable generation.
Step 5) Field Guide
- Add field guide entries for each new tree in their respective dimension category.
Optional*)
- Firmalife Greenhouse planter information is automatically generated using the enum. But you can change the register here.
- Electric Greenhouse recipes are automatically generated using the enum. But you can change the register here.
Tools Repo Side
- Add lang strings for everything like so