跳到正文

cc wasm

作者:iunggognsoinr

add wasm support for computer craft

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Description

this mod add wasm support for
CC: Tweaked.

this mod uses chicory runtime,
and includes wasi support

Usage

  • put .wasm file in wasm folder.
  • in lua in computer craft, run wasm.load_wasm function
    to load a module. Note that the argument does not contains a .wasm extend name.

Wasm development

use this crate

see the example here

Example

minesweeper example

wasm file,

  • download this file and put it in ./wasm/
  • place a monitor on top of a computer
  • in computer craft’s shell run exec_wasm_auto_reload minesweeper

there is a python interpreter example,
download this file and put it in ./wasm/, and then in computer craft lua run:

py = wasm.load_wasm("python")

py.init()

py.exec("import time as t")

print(py.eval("t.time()"))

常见问题

cc wasm 支持哪些 Minecraft 版本?

cc wasm 支持 Minecraft Java 版 1.20.1,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。

cc wasm 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

iunggognsoinr 的其他作品

查看全部 →