Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.
IceBlcokMCPublic archive

About

PLand Native Bind API for LegacyScriptEngine (quickjs and nodejs backend)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PLand-NAPI

PLand Native Bind API for LegacyScriptEngine (quickjs and nodejs backend)

PLand 原生绑定API,用于 LegacyScriptEngine (quickjs 和 nodejs 后端)

安装 / Install

前置条件 / Prerequisites

  • PLand-NAPI 必须与 PLand 一起安装,否则无法使用 (且 minor 版本必须一致) PLand-NAPI must be installed with PLand, otherwise it cannot be used (and the minor version must be consistent)

使用 Lip 安装 / Install with Lip

lip install github.com/IceBlcokMC/PLand-NAPI

# 或者手动指定后端类型 / Or manually specify the backend type
lip install github.com/IceBlcokMC/PLand-NAPI#quickjs
lip install github.com/IceBlcokMC/PLand-NAPI#nodejs

手动安装 / Manual Install

前往 Releases 下载对应后端类型的安装包

Go to Releases to download the installation package for the corresponding backend type

解压并将 pland-napi-<backend> 文件夹放入 plugins 文件夹

Unzip and put the pland-napi-<backend> folder into the plugins folder

开发者文档 / Developer Documentation

从 PLand-LegacyRemoteCallApi 迁移 / Migrate from PLand-LegacyRemoteCallApi

  1. 将 PLand-LegacyRemoteCallApi 卸载 / Uninstall PLand-LegacyRemoteCallApi

  2. 将您的脚本里所有 import PLand-LegacyRemoteCallApi 的地方改为 import {} from 'pland-napi-<backend>.<suffix>"

    Change all import PLand-LegacyRemoteCallApi in your script to import {} from 'pland-napi-<backend>.<suffix>"

    例如 / For example:

    对于 lse-quickjs 后端,你可以这样导入 / For the lse-quickjs backend, you can import like this:

    import {} from /* ... */ "pland-napi-quickjs.dll";

    对于 lse-nodejs 后端,情况有点特殊,node.js 暂不支持使用 import 语法导入 C++ 插件(Node Addon)

    For the lse-nodejs backend, the situation is a bit special. Node.js does not currently support using the import syntax to import C++ plugins (Node Addon)

    因此你需要将 import 语法改为 require 语法
    So you need to change the import syntax to require syntax

    const {
      /* ... */
    } = require("../pland-napi-nodejs/pland-napi-nodejs.node");
  3. 查看 PLand-NAPI 的类型定义文件,将所有与 PLand-LegacyRemoteCallApi 相关的调用全部改为 PLand-NAPI 的调用

    Check the type definition file of PLand-NAPI, and change all calls related to PLand-LegacyRemoteCallApi to calls of PLand-NAPI

    PLand-NAPI 的类型文件您可以在仓库的 types 文件夹里找到
    You can find the type file of PLand-NAPI in the types folder of the repository

    同时它也会随 PLand-NAPI 的 Releases 一起发布
    It will also be released with PLand-NAPI Releases

示例 / Example

您可以查看 tests 文件夹下各后端的测试脚本,了解如何导入和使用 PLand-NAPI

You can check the test scripts in the tests folder for each backend to learn how to import and use PLand-NAPI

当您成功导入 PLand-NAPI 后,您可以按照正常的开发流程来编写您的脚本。

After you successfully import PLand-NAPI, you can write your script according to the normal development process.

许可证 / License

PLand-NAPI 使用 LGPL-3.0 or later 许可证

PLand-NAPI is licensed under the LGPL-3.0 or later license

注意: PLand-NAPI 所使用的第三方库均遵循其各自的许可证

Note: All third-party libraries used by PLand-NAPI are subject to their respective licenses

About

PLand Native Bind API for LegacyScriptEngine (quickjs and nodejs backend)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages