一个脚本/调整模组,允许你无需设置其他模组即可更改各种游戏机制。
大多数情况下,它用于创建新的合成配方。
以下是 GroovyScript(简称 GrS)的一些关键特性:
特性:
- Groovy:一种强大且经过测试的脚本语言
- 兼容 Java 的语法 + 可互操作的代码
- 静态编译
- 可选的动态类型
- 元编程
- 沙盒化:脚本实际上在沙盒中运行,敏感操作被列入黑名单,禁止调用或引用
- 重载:能够在游戏中测试脚本更改而无需重启
- 几乎所有 Forge 注册表对象都可以动态重载
- 原生支持大多数模组注册表
- 事件:使用 Groovy Closures 轻松监听 Forge 的事件总线
- 熟悉度:为熟悉 CraftTweaker 的用户提供括号处理器(当前已实现,可能在不久的将来被移除)
- 信息展示:显示手中物品的丰富信息及其他内容的命令
- 优化:确保在提供功能的同时不做出任何妥协,使用高效的代码
- API:为其他模组作者提供丰富的代码目录,使其模组与 GroovyScript 兼容,例如包/类/方法/字段的黑名单
模组兼容性
从技术上讲,已经存在对所有可能模组的兼容性,因为你可以直接访问所有代码。然而,GroovyScript 确实添加了一些辅助方法,使一切更简洁、更易于使用。
配方注册表的重载必须由我们手动实现,而且非常繁琐。我们目前支持少数几个模组的配方重载,但如果有人能帮忙添加兼容性并/或编写维基页面,我们将不胜感激。
常见问题
-
是否支持 X 模组?能否实现 X 模组中的 X 功能?
Groovy 可以访问几乎所有的 Java 代码。这意味着只要你知道如何操作,几乎一切都是“支持的”。像配方这样的东西是不可重载的。我们需要为该特定类型的配方手动添加支持。
-
你能添加对 X 模组的支持吗?
很可能。我们的意图是让它与几乎所有模组一起工作。如果你想要的模组尚未得到支持,你可以在 Discord 上向我们询问。
-
为什么模组文件这么大?
为了使模组正常工作,我们需要包含 Groovy 库,这些库的大小相当可观。
-
这与 CraftTweaker 和 KubeJS 兼容吗?
是的,但这样做没有意义(除了 CraftTweaker 目前支持更多的模组)。
-
我为什么要使用这个而不是 CraftTweaker?
上面提到的所有原因都是理由。在我看来,能够动态重载脚本是 GroovyScript 最大的优势。
A scripting / tweaking mod that allows you to alter various game mechanics without having to set up a mod.
Most of the time it is used to create new recipes.
Here are some key features of GroovyScript (short GrS):
Features:
- Groovy: a powerful and tested scripting language
- Java-compatible syntax + interoperable code
- Static compilation
- Optional dynamic typing
- Metaprogramming
- Sandboxed: scripts are effectively ran in a sandbox, with sensitive operations blacklisted from being called or referenced
- Reloading: able to test script changes within the game without restarting
- Most if not all Forge Registry objects can be reloaded on the fly
- Most mod registries are supported natively
- Events: Easily listen to Forge's EventBuses with Groovy Closures
- Familiarity: Bracket handlers for those that are familiar with CraftTweaker (currently implemented, may be removed in the near future)
- Informational: commands to display rich information for the item in your hand and more
- Optimized: Making sure no compromises are being made while delivering features with efficient code
- API: Great catalogue of code for other mod authors to make their mods compatible with GroovyScript such as package/class/method/field blacklists
Mod Compat
Technically there is already mod compat for every mod possible, since you can access all code directly. However GroovyScript does add helper methods to make everything cleaner and easier.
Reloading for recipe registries must be implemented manually by us and its very tedious. We currently support a few mods for reloading recipes, but we would very much appreciate if anyone can help adding compat and/or writting wiki pages.
FaQ
-
Does it have support for X mod? Can do X from X mod?
Groovy can access almost every java code. This means almost everything is "supported", if you know how to do it. Stuff like recipes are not reloadable. We would need to add support manually for that specific recipe type.
-
Can you add support for X mod?
Probably. We intent to make it work with pretty much every mod. If your desired mod is not yet supported you can ask us about it on the Discord.
-
Why is the mod file so large?
In order for the mod to work we need to inlcude the Groovy libraries, which are decently sized.
-
Is this compatible with CraftTweaker and KubeJS?
Yes, but there is no point in doing that (exept that CraftTweaker currently supports more mods.)
-
Why would i use this over CraftTweaker?
All the reasons are mention above in the Features. Being able to reload scripts on the fly is the biggest argument for GroovyScript imo.
下载 GroovyScript
下载 GroovyScript
下载 GroovyScript
下载 GroovyScript
下载 GroovyScript
下载 GroovyScript
下载 GroovyScript
下载 GroovyScript
下载 GroovyScript
下载 GroovyScript
[!WARNING] 此版本包含破坏性更改!更多详情见下文。
破坏性更改
- 无论系统字符集如何,均以 UTF-8 读取脚本 [由 @Rongmario 在 bb8c765 提交]
- 脚本始终以 UTF-8 格式读取。使用其他编码(如 Windows 上的 ANSI)保存的脚本必须重新保存为 UTF-8。 [由 @seferlian 修复问题 #349]
错误修复
- 查找未在 LootTableList 中注册的战利品表 [由 @Rongmario 在 5873657 提交] [由 @3A70 修复问题 #298]
- 修复不同平台排序行为不一致的问题 [由 @WaitingIdly 在 bfbb4b6 提交]
构建与依赖项
- 迁移至约定配置并恢复可构建状态 [由 @Rongmario 在 df3a2de 提交]
其他
- 通过在 GroovySecurityManager 中避免类加载来修复 ReEntrantTransformerError [由 @DeliciousBread481 在 a6df8b7 提交]
- 修复在 JEI 中复制快捷键失效的问题 [PR by @WaitingIdly in #383]
首次贡献者
- @DeliciousBread481 完成了他们的首次贡献!
完整更新日志:
更新内容
- 通过 @WaitingIdly 在 修复了生物群系解析器的问题
- 通过 @Wizzerinus 在 修复了 Factory Tech 的问题
完整更新日志:
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧