Skip to content

Commit

Permalink
feat: 先初始化Item相关类
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcmd committed Aug 10, 2023
1 parent 02d5d7f commit 4699940
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Allay-Server/src/main/java/cn/allay/server/Allay.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ public static void initAllayAPI() throws MissingImplementationException {
api.bind(Server.class, AllayServer::new);
api.bind(Scheduler.SchedulerFactory.class, () -> AllayScheduler::new);

//Block
api.bind(BlockTypeBuilder.BlockTypeBuilderFactory.class, () -> AllayBlockType::builder);
api.bind(VanillaBlockAttributeRegistry.class, () -> new AllayVanillaBlockAttributeRegistry(new AllayVanillaBlockAttributeRegistry.Loader()));
api.bind(BlockStateHashPalette.class, AllayBlockStateHashPalette::new);
api.bind(BlockTypeRegistry.class, AllayBlockTypeRegistry::new, instance -> ((AllayBlockTypeRegistry) instance).init());

//Item
api.bind(ItemTypeBuilder.ItemTypeBuilderFactory.class, () -> AllayItemType::builder);
api.bind(VanillaItemAttributeRegistry.class, () -> new AllayVanillaItemAttributeRegistry(new AllayVanillaItemAttributeRegistry.Loader()));
api.bind(ItemTypeRegistry.class, AllayItemTypeRegistry::new, instance -> ((AllayItemTypeRegistry) instance).init());
api.bind(CreativeItemRegistry.class, () -> new AllayCreativeItemRegistry(new AllayCreativeItemRegistry.Loader()));

//Block
api.bind(BlockTypeBuilder.BlockTypeBuilderFactory.class, () -> AllayBlockType::builder);
api.bind(VanillaBlockAttributeRegistry.class, () -> new AllayVanillaBlockAttributeRegistry(new AllayVanillaBlockAttributeRegistry.Loader()));
api.bind(BlockStateHashPalette.class, AllayBlockStateHashPalette::new);
api.bind(BlockTypeRegistry.class, AllayBlockTypeRegistry::new, instance -> ((AllayBlockTypeRegistry) instance).init());

//Entity
api.bind(EntityTypeBuilder.EntityTypeBuilderFactory.class, () -> AllayEntityType::builder);
api.bind(EntityTypeRegistry.class, AllayEntityTypeRegistry::new, instance -> ((AllayEntityTypeRegistry) instance).init());
Expand Down

0 comments on commit 4699940

Please sign in to comment.