Advanced Computers
这是另一个 Minecraft 计算机模组,包含一个自定义构建的 LUA 运行时,名为 JLuaVm,因此也具备跨区块卸载甚至服务器关闭持久化计算机状态的能力,意味着在这些事件发生时它们不会被强制重启。这与 OpenComputers-1.12 的行为类似,尽管我们使用的是完全自定义的 Lua 运行时。 本项目当然受到了 OpenComputers(适用于 Minecraft 1.12)和原版 ComputerCraft 模组的启发。
模组本身以及我们的 Lua 运行时位于我们的 Github 组织下:
请确保在单人游戏/主机托管中使用 JDK(Java 开发工具包)而非普通的 JRE(Java 运行环境)来运行 Minecraft。在多人服务器上游玩应该可以正常使用 JRE。如果未满足此要求,游戏会故意崩溃并列出故障排除步骤。但只需安装 GraalVM 或(几乎)任何 Java-17+ 运行时的 JDK 版本即可正常工作。
这是一个测试版
大部分内容已经就绪,我们认为模组的状态相当不错,但仍可能存在一些错误。如果你发现了错误,请提交 Issue 工单。
功能
向 Minecraft 中添加了可编程计算机,以及屏幕、外围设备电缆、真实互联网访问、红石和库存接口外围设备等更多功能,所有这些都可以通过 Lua 5.4 进行交互。
对于服务器所有者: 就资源使用而言,我们仅为每台计算机设置了一个 Lua 执行环境,而不是整个虚拟机,这意味着这些计算机对 RAM 和磁盘空间的需求非常低。
已根据计算机层级实现 CPU 时间限制。磁盘使用量也受到限制,但目前 RAM 使用量尚未限制。
导航指南
所有 API 都在我们的维基上进行了文档记录:,其中还包含入门指南 。
内置操作系统(Advanced OS)带有基本命令,如 ls、rm,甚至还有名为 nano 的文本编辑器,灵感来源于 GNU nano。此外还有 pasteTextToFile,它会监听粘贴的文本(通过鼠标中键粘贴),然后将其写入指定文件中。例如 pasteToFile someFile.lua。
你还可以使用 Lua 代码 vm.listUdKeys(components:getFirst("computer")) 以编程方式确定 userdata 对象包含哪些字段(在你当前的模组版本中)。'userdata' 是一种特殊的 Lua 类型,代表 Java 对象。所有组件都以 userdata 对象表示。
结合查看现有的 uefi.lua 和操作系统文件(均位于 src/main/resources/assets/advancedcomputers/lua/* 中),希望这能给你一个不错的起点。
你也可以在全局 _HOST 变量中找到当前模组和 Minecraft 的版本。例如 AdvancedComputers 0.1.2-alpha; Minecraft 1.20.1。
计划中的事项:
使操作系统更易用(包括重写内核),因为目前它非常简陋(尽管包含了(已完成)ls和lua程序)在 上创建一个列出并描述所有 API 函数的维基(已完成)在游戏内计算机之间发送网络数据包(通过一些智能的数据包处理来避免编写自定义的游戏内 IP 协议)(已完成)限制磁盘空间并(已完成)与更多 Minecraft 方块进行交互(已完成)- 添加软性计算机 RAM 限制
- 完成添加 Lua 标准库中缺失的任何内容(最 notably 是模式匹配中的一些边缘情况特性,即 string.gsub 及相关函数中的边缘情况,尽管它们大多都能工作)
- 添加更多有趣的功能,如服务器等。
目标 Minecraft 版本
目前针对 Minecraft 1.20.1 (Forge),但我们计划在未来更新到新版本。
许可与署名
欢迎在任何整合包中包含此模组,无需署名。 如果你将此模组作为整合包的一部分使用,很高兴你能在 Discord 上给我们发一条消息,因为我们很好奇,但这并非必需。
关于非整合包的使用,请不要在任何地方重新上传模组构建版本。
正如 LICENSE 文件中所述,该模组在 MIT 许可下发布。 例外的是字体,它们位于 git 仓库中的 /assetSources/font 文件夹中。对于这些字体,适用该文件夹中关联的许可证。
也可以将 JLuaVm 用于其他 Minecraft 模组,因为它也是以 MIT 许可发布的。
Advanced Computers
This is yet another computer mod for Minecraft, including a custom built LUA runtime, called JLuaVm, and thus also the ability to persist computer states across chunk unloading and even server shutdowns, meaning they wont be forcefully rebooted in such events. This is similar to the behaviour of OpenComputers-1.12, though we are using a fully-custom lua runtime. This project is of course inspired by OpenComputers (for Minecraft 1.12) and the original ComputerCraft mod.
The mod itself and our Lua runtime are located under our Github organization:
Make sure you are running Minecraft using a JDK (Java Development Kit) instead of the regular JRE (Java Runtime Environment) for singleplayer/hosting. Playing on a multiplayer server should work just fine with the JRE. If this requirement is not fulfilled the game will intentionally crash, listing troubleshooting steps. But simply installing a JDK like GraalVM or (almost) any JDK-flavor of a Java-17+ runtime should work just fine.
THIS IS A BETA
Most of the content is in and we think the mod is in pretty good shape, but there might still be bugs present. If you find one, please open an issue ticket.
Features
Adds programmable computers into Minecraft, along with screens, peripheral cables, real-world-internet-access, and redstone and inventory-interface peripherals and much more, all being interactable through Lua 5.4.
For server owners: As far as resource usage goes, we are only setting up a lua execution environment per computer and not an entire virtual machine, meaning these computers have a very low ram and disk space requirement.
Cpu time limiting based on computer tier is implemented. Disk usage is limited too, but ram usage is currently not limited.
Finding your way around
All the api is documented on our wiki, , which also contains a introductory guide .
The included OS (Advanced OS) comes with the basic commands such as ls, rm and even a text editor called nano, inspired by the GNU nano. Additionally there is also pasteTextToFile, which listens for pasted-text (paste via middle mouse button) and then writes that into the specified file. E.g. pasteToFile someFile.lua.
You can also use the lua code vm.listUdKeys(components:getFirst("computer")) to programmatically figure out which fields a userdata object contains (in your current mod version). 'userdata' is a special Lua type that represents a Java object. All components are represented as userdata objects.
This combined with looking at the existing uefi.lua and operating system, both located in src/main/resources/assets/advancedcomputers/lua/* should hopefully give a decent point to start out with.
You can also find the current mod and minecraft version in the global _HOST variable. E.g AdvancedComputers 0.1.2-alpha; Minecraft 1.20.1.
Planned stuff:
Make the OS more usable (including rewriting the kernel), as currently it is very very bare (though does contain the(DONE)lsandluaprograms)Making a wiki on that lists & describes all the api functions(DONE)Sending network packets between ingame computers (with some intelligent packet handling to avoid having to write a custom ingame IP protocol)(DONE)Make disk space limited and(DONE)Interaction with more minecraft blocks(DONE)- Add a soft computer ram limit
- Finish adding anything that is missing from the Lua standard library (most notably some edgecase features in pattern matching, i.e. edgecases in string.gsub and related functions, though they mostly work)
- Adding more fun stuff like servers, etc.
Targeted minecraft versions
Currently this targets Minecraft 1.20.1 (forge), but we do plan to update to newer versions in the future.
License & Attribution
Feel free to include this mod in any modpacks without attributing us. It would be nice if you could send us a message in Discord if you use this mod as part of a modpack as we are curious, but this is not required.
As far as non-modpack usage goes, do not reupload mod builds anywhere.
As specified in the LICENSE file, the mod is published under the MIT license. An exception to this are the fonts, which are located in the /assetSources/font in the git repository. For those, the associated license in that folder applies.
Feel free to use JLuaVm for another Minecraft mod too, as that is licensed as MIT as well.
下载 Advanced Computers
下载 Advanced Computers
下载 Advanced Computers
下载 Advanced Computers
下载 Advanced Computers
下载 Advanced Computers
下载 Advanced Computers
下载 Advanced Computers
下载 Advanced Computers
下载 Advanced Computers
高级计算机:
- 修复了有时集群未重新计算的问题
高级计算机:
- 阻止将 CTRL+O 快捷键(及类似快捷键)传递给 Just Enough Items,从而在 nano.lua 中保存时避免切换 JEI 的可见性。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧