public static final String MOD_ID = "tutorial"; public static final Identifier BIGGER_CHEST = new Identifier(MOD_ID, "bigger_chest"); public static final Block BIGGER_CHEST_BLOCK = new BiggerChestBlock(FabricBlockSettings.of(Material.WOOD).build()); public static final String BIGGER_CHEST_TRANSLATION_KEY = Util.createTranslationKey("container", BIGGER_CHEST); public static BlockEntityType BIGGER_CHEST_ENTITY_TYPE; @Override public void onInitialize() { Registry.register(Registry.BLOCK, BIGGER_CHEST, BIGGER_CHEST_BLOCK); Registry.register(Registry.ITEM, BIGGER_CHEST, new BlockItem(BIGGER_CHEST_BLOCK, new Item.Settings().group(ItemGroup.REDSTONE))); BIGGER_CHEST_ENTITY_TYPE = Registry.register(Registry.BLOCK_ENTITY_TYPE, BIGGER_CHEST, BlockEntityType.Builder.create(BiggerChestBlockEntity::new, BIGGER_CHEST_BLOCK).build(null)); ContainerProviderRegistry.INSTANCE.registerFactory(BIGGER_CHEST, (syncId, identifier, player, buf) -> { final BlockEntity blockEntity = player.world.getBlockEntity(buf.readBlockPos()); return((BiggerChestBlockEntity) blockEntity).createContainer(syncId, player.inventory); }); }