Skip to content

Commit

Permalink
Remove block.getLootTable() call from registry callbacks
Browse files Browse the repository at this point in the history
Vanilla 1.21.2 doesn't do it anymore on block registration.
  • Loading branch information
Technici4n committed Oct 19, 2024
1 parent 323372e commit 1796c00
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ public void onClear(Registry<Block> registry, boolean full) {
public void onBake(Registry<Block> registry) {
// Vanilla does this in Blocks.<clinit>

// Init cache and loot table for new blocks only (the cache init is expensive).
// Init cache for new blocks only (the cache init is expensive).
// State cache init cannot be done in onAdd because some of it might depend on other registries being populated in mod code.
// Loot table init cannot be done in onAdd because the loot table supplier might depend on blocks registered later.
for (Block block : addedBlocks) {
block.getStateDefinition().getPossibleStates().forEach(BlockBehaviour.BlockStateBase::initCache);
block.getLootTable();
}
addedBlocks.clear();

Expand Down

0 comments on commit 1796c00

Please sign in to comment.