Skip to content

Commit

Permalink
🐛 修倍datagen
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuRuoLing committed Sep 6, 2024
1 parent 842bde6 commit c5e96a9
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ public BlockItemBuilder<BlockItem, T> blockItem() {

public <I extends BlockItem> BlockItemBuilder<I, T> item(BiFunction<Block, Item.Properties, I> factory) {
BlockItemBuilder<I, T> itemBuilder = new BlockItemBuilder<>(this.registrator, this, this.id, factory);
if (recipeFunction != null){
itemBuilder.recipe(recipeFunction::accept);
}
this.itemBuilder = itemBuilder;
dropOther = () -> itemEntry;
return itemBuilder;
Expand All @@ -139,8 +136,14 @@ public T build() {

@Override
public BlockEntry<T> register() {
if (this.recipeFunction != null){
this.itemBuilder.recipe(
(itemEntry1, registratorRecipeProvider) -> recipeFunction.accept(itemEntry1, registratorRecipeProvider)
);
}
this.itemEntry = itemBuilder.register();
this.entry.setBlockItem(itemEntry);

this.registrator.addBuilder(BuiltInRegistries.BLOCK, this);
if (dropOther != null) {
this.loot((blockLootTableProvider, t) -> blockLootTableProvider.dropOther(this.entry.get(), dropOther.get()));
Expand Down

0 comments on commit c5e96a9

Please sign in to comment.