Skip to content

Commit

Permalink
Port BlockBuilder fix from #765 to 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxNeedsSnacks committed Jan 6, 2024
1 parent d98f808 commit d1aad04
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,12 @@ public BlockBuilder item(@Nullable Consumer<BlockItemBuilder> i) {
itemBuilder = null;
lootTable = EMPTY;
} else {
i.accept(getOrCreateItemBuilder());
if (itemBuilder == null) {
itemBuilder = getOrCreateItemBuilder();
itemBuilder.blockBuilder = this;
ScriptType.STARTUP.console.warn("`item` is called with non-null builder callback after block item is set to null! Creating another block item as fallback.");
}
i.accept(itemBuilder);
}

return this;
Expand Down

0 comments on commit d1aad04

Please sign in to comment.