Skip to content

Commit

Permalink
🌟 更新注册 API
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu-ZT committed Sep 3, 2024
1 parent 714becf commit d6bd6d4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ public <T extends Block> BlockBuilder<T> block(String id, Function<BlockBehaviou
return new BlockBuilder<>(this, id, factory);
}

public void entity() {
//TODO
}

public void blockEntity() {
//TODO
}

public void tab() {
//TODO
}

public void menu() {
//TODO
}

public <P extends DataProvider> void data(DataProviderType<P> type, Consumer<P> consumer) {
List<Consumer<? extends DataProvider>> list = this.dataProviders.getOrDefault(type, Collections.synchronizedList(new ArrayList<>()));
list.add(consumer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public BlockBuilder<T> model(BiConsumer<BlockEntry<T>, AnvilLibBlockModelProvide
}

public <I extends BlockItem> BlockItemBuilder<I, T> item() {
//TODO
return (BlockItemBuilder<I, T>) new BlockItemBuilder<>(this.registrator, this, this.id, BlockItem::new);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.function.BiFunction;

public class BlockItemBuilder<T extends BlockItem, B extends Block> extends ItemBuilder<T> {
//TODO
protected final BlockBuilder<B> blockBuilder;

public BlockItemBuilder(AbstractRegistrator registrator, BlockBuilder<B> builder, String id, BiFunction<Block, Item.Properties, T> factory) {
Expand Down

0 comments on commit d6bd6d4

Please sign in to comment.