This PR reworks drops, replacing the drop creator system with one fully dependent on Vanilla's loot tables. This will allow loot modifiers to be used to modify tree drops, and is also much more intuitive for users who have previously used loot tables and wish to change tree drops as opposed to the tree itself.
It should be noted that this PR will break compatibility with all add-ons and tree packs that require drops, such that their drop creators will no longer be read and hence the trees will no longer drop anything. As such, this should not be merged/released until such a time that all add-ons are also ready for a compatibility update.
Features
Removal of drop creators.
Leaves drops on individual harvest are now read from loot tables under the blocks directory.
The file name is equivalent to the species name with a suffix of the type of leaves block it is and the extension. For example oak_leaves.json for oak leaves and crimson_wart.json for crimson wart blocks.
If no loot table is found, it defaults to the common species' table. If that is not found it uses LootTables#EMPTY (dropping nothing).
These are now given an extra loot parameter, seasonal_seed_drop_factor, which contains the current seasonal seed drop factor as calculated from the species.
A custom loot condition, dynamictrees:seasonal_seed_drop_chance, has been added to drop based on the seasonal seed drop factor.
These are generally a mirror of the loot table for the vanilla leaves block.
Leaves drops on the harvest of a whole tree are now read from loot tables under the trees/leaves directory.
The file name is equivalent to the species name with a suffix of the file extension.
If no loot table is found, it defaults to the common species table. If that is not found it uses LootTables#EMPTY (dropping nothing).
These have their own loot parameter set, dynamictrees:leaves.
They are given the block state, seasonal drop factor, tool, and optionally explosion radius loot parameters.
These are very similar the loot table for the individual leaves blocks, but do not drop normal leaves from shears or silk touch and may use slightly different chance values.
Voluntary drops are now read from loot tables under the trees/voluntary directory.
The file name is equivalent to the species name with a suffix of the file extension.
If no loot table is found, it defaults to the common species' table. If that is not found it uses LootTables#EMPTY (dropping nothing).
These have their own loot parameter set, dynamictrees:voluntary.
They are given the block state [of the root block], seasonal drop factor, and fertility loot parameters.
A custom loot condition, dynamictrees:voluntary_seed_drop_chance, has been added to drop based on drop rate and season.
These normally only drop the tree's seed.
Branch drops are now read from loot tables under the trees/branches directory.
The file name is equivalent to the branch registry name (without the _branch suffix) with a suffix of the file extension.
These have their own loot parameter set, dynamictrees:branches.
They are given the tool used, volume of the relevant branch type, and optionally explosion radius loot parameters.
These are read once on each branch type for a whole tree or section that has been cut off. Custom loot functions, dynamictrees:multiply_logs_count and dynamictrees:multiply_sticks_count, have also been added to calculate the quantity of logs and sticks to drop based on the input volume.
Automatic data generators for all of the above loot tables, based on existing species and family data.
These are only generated if data gen is enabled for loot tables and a table doesn't already exist in the main source set.
This PR reworks drops, replacing the drop creator system with one fully dependent on Vanilla's loot tables. This will allow loot modifiers to be used to modify tree drops, and is also much more intuitive for users who have previously used loot tables and wish to change tree drops as opposed to the tree itself.
It should be noted that this PR will break compatibility with all add-ons and tree packs that require drops, such that their drop creators will no longer be read and hence the trees will no longer drop anything. As such, this should not be merged/released until such a time that all add-ons are also ready for a compatibility update.
Features
blocks
directory.oak_leaves.json
for oak leaves andcrimson_wart.json
for crimson wart blocks.LootTables#EMPTY
(dropping nothing).seasonal_seed_drop_factor
, which contains the current seasonal seed drop factor as calculated from the species.dynamictrees:seasonal_seed_drop_chance
, has been added to drop based on the seasonal seed drop factor.trees/leaves
directory.LootTables#EMPTY
(dropping nothing).dynamictrees:leaves
.trees/voluntary
directory.LootTables#EMPTY
(dropping nothing).dynamictrees:voluntary
.dynamictrees:voluntary_seed_drop_chance
, has been added to drop based on drop rate and season.trees/branches
directory._branch
suffix) with a suffix of the file extension.dynamictrees:branches
.dynamictrees:multiply_logs_count
anddynamictrees:multiply_sticks_count
, have also been added to calculate the quantity of logs and sticks to drop based on the input volume.main
source set.Closes #671