Rift 是 Minecraft 1.13 的一款轻量级模组 API、库和加载器。Rift 的主要目标是打造一个更模块化且更轻量的 Minecraft 模组 API。Rift 并非旨在与 Forge 竞争或取代它,而是 Rift 配合一组可选的社区制作的基础库模组来共同实现这一目标。这些模组的完整列表见下文。
Discord 服务器:
安装: 由于目前尚无适用于 1.13 的 Forge,安装或升级 Rift 的唯一方法是双击运行其 jar 文件。它会自动复制自身到你的 .minecraft 文件夹,并在启动器中添加一个 "Rift" 配置文件。按照惯例,将 Rift 模组添加到 ".minecraft/mods" 文件夹即可。
安装 Optifine: 将 Optifine 放入 "mods" 文件夹。Rift 会识别并加载它。
在 MultiMC 中安装: 点击 "Add Instance"(添加实例),选择 "Import from zip"(从 zip 导入),并在框中粘贴此链接:https://media.forgecdn.net/files/2610/746/rift-1.0.4-66.zip
运行服务器: 将 Rift jar 放入空目录,然后运行 "java -jar Rift.jar --server"。Spigot 支持即将推出。
模组开发者: 关于使用 Rift 的信息 | 示例模组(欢迎随意复制)
为什么还需要另一个模组 API?
打造轻量级且模块化的 API
Rift 的主要目标是提供一个能够扩展游戏任何方面的模组 API,同时尽可能少地改变游戏本身,且不增加额外的依赖项。与过于复杂的事件系统不同,Rift 采用了一种简单、更快且基于接口的系统来扩展原版 Minecraft。
对于修改原版行为,Rift 鼓励模组使用 Mixin 库来在任何原版方法中添加回调或重定向,而不是使用固定且僵硬的钩子集。
Rift 故意不添加诸如能量 API、替代模型渲染器和自定义方块状态格式等复杂功能。这些应该由单独的库模组来实现。这样做的主要优势是 Rift 可以更快地更新以适配新的 Minecraft 版本,用户也永远不会被迫使用他们的模组所不需要功能。在没有安装任何模组的情况下,Rift 的速度、稳定性和内存效率始终与原版 Minecraft 一致。
让模组更具原版风格
Rift API 不提供用于修改现有游戏机制的钩子。相反,它提供了扩展原版游戏各个方面的钩子(完整列表见下文)。Rift 还鼓励模组尽可能使用原版 API,并与原版共享创意栏和选项菜单,从而减少玩家在原版内容与模组内容之间看到的差异,使模组更好地融入原版 Minecraft。
然而,这并不意味着 Rift 模组受到任何限制。事实上恰恰相反。通过 Mixin——一种用于修改原版代码的简单基于注解的系统,Rift 模组可以通过比仅使用 Forge API 更灵活的方式来改变游戏的运作方式。模组可以在任何原版方法的任意位置注入回调到它们自己的方法中,或者用它们自己的代码替换原版方法或其部分代码。Mixin 还确保了多个模组可以同时注入同一个方法而不会降低兼容性。
让模组兼容多个 Minecraft 版本
使用 Rift,你的模组将在许多 Minecraft 版本中正常运行。通过可选的模组兼容性模块,Rift 会将模组重新映射到更新后的混淆名称,并将未实现的原版方法注入回类中,从而使不稳定的 Minecraft API 变得稳定。虽然所有模组在多个 Minecraft 版本中的完全兼容性可能无法实现,但大多数模组至少应在几个版本中正常工作。
极快且高效
无论是作为 Forge 模组安装还是独立运行,Rift 都不会减慢游戏的加载速度。Rift 基于接口而非事件总线,因此它不会加载任何额外的库,事件回调将极其快速,并且只需几行代码即可添加你自己的模组事件。
推荐使用的库
与 Forge 不同,Rift 的目标是让模组开发更加模块化。Rift 本身仅提供扩展原版游戏的功能,更高级的 API 和功能由社区提供。以下是一些常见功能的解决方案:
功能特性
- 简单且可扩展的基于接口的事件系统(模组仅需几行代码即可添加自定义事件)
- 提供用于注册物品、方块、实体方块(Tile Entities)、流体、附魔、粒子类型、药水效果、生物群系、实体、实体方块渲染器、自定义物品渲染器、复杂(非 JSON)配方、维度、世界类型等的接口
- 简单的网络 API,便于轻松添加原版数据包和模组消息
- 在每个客户端或服务端刻(Tick)触发的事件
- 支持 Mixin 和其他类转换器,允许
- 自动下载并解压依赖项
- 部分依赖其他模组,即仅在存在另一个模组时才启用某些功能。
Rift is a lightweight modding API, library, and mod loader for Minecraft 1.13. The main objective of Rift is to make a more modular and lightweight modding API for Minecraft. Rift is not intended to compete with or replace Forge, but rather Rift and a set of optional community-made library mods is. A full list of these can be found below.
Discord server:
Installation: Since Forge for 1.13 is not available yet, the only way to install or upgrade Rift is to run the jar by double-clicking it. It will copy itself to your .minecraft folder and a "Rift" profile will be added to the launcher. Add Rift mods to the ".minecraft/mods" folder, as usual.
Installing Optifine: Add Optifine to the "mods" folder. Rift will recognize and load it
Installing in MultiMC: Click "Add Instance", "Import from zip", and paste this link in the box: https://media.forgecdn.net/files/2610/746/rift-1.0.4-66.zip
Running a server: Place the Rift jar into an empty directory and run "java -jar Rift.jar --server". Spigot support coming soon
Mod developers: Information about using Rift | Sample mod (feel free to copy it)
Why another mod API?
Making a lightweight and modular API
The main goal of Rift is to provide a mod API capable of extending any aspect of the game while changing the game as little as possible and adding no additional dependencies. Rather than an over-complicated event system, Rift implements a simple, faster, and cleaner interface-based system for extending vanilla Minecraft.
For modifying vanilla behavior, Rift encourages mods to use the Mixin library to add callbacks or redirects in any vanilla method, rather than an fixed and inflexible set of hooks.
Rift intentionally does not add complex features such as energy APIs, alternative model renderers, and custom block state formats. Those should be implemented in separate library mods. The main advantage of this is that Rift can quickly update more quickly to newer Minecraft versions, and users will never need to use features that their mods don't need. Rift with no mods will always be just as fast, stable, and memory-efficient as vanilla Minecraft.
Making mods more vanilla-feeling
The Rift API does not provide hooks to modify existing game mechanics. Instead, it provides hooks to extend every aspect of the vanilla game (full list can be found below). Rift also encourages mods to be more integrated into vanilla Minecraft by using vanilla APIs whenever possible and sharing creative tabs and option menus with vanilla, reducing the difference the player sees between vanilla and modded content.
However, this does not mean that Rift mods are limited in any way. In fact, the opposite is true. Rift mods can change the way the game works in an even more flexible way than by only using Forge's API, through the use of Mixin, a simple annotation-based system for modifying vanilla code. Mods can inject callbacks to their methods at any point in any vanilla method, or replace vanilla methods or sections of them with their own code. Mixin also ensures that many mods can inject into the same method without reducing compatibility.
Making mods work in many Minecraft versions
With Rift, your mods will work throughout many Minecraft versions. Through optional mod compatibility modules, Rift will remap mods to updated obfuscated names and inject unimplemented vanilla methods back into classes, making the unstable Minecraft API stable. Although compatibility of all mods across many Minecraft versions may not be possible, most mods should work for at least a few versions.
Very fast and efficient
Whether it is installed as a Forge mod, or on its own, Rift will not slow down the game's loading time. Rift is based on interfaces rather than an event bus, so it will not load any additional libraries, event callbacks will be extremely fast, and adding your own mod event can be done in a few lines of code.
Recommended Libraries
Unlike Forge, Rift's goal is to make modding more modular. Rift itself only provides features for extending the vanilla game, and more advanced APIs and features are provided by the community. Here are some solutions for a few common features:
- Networking: Rift API, ProtoCharset
- Configuration: Gson (vanilla library), Configurate, Random Configs, any other library you want
- Other language support: Riftlin (kotlin),
- Energy API: ZeroPoint
- Capabilities: Rift-Capabilities
- Alternative blockstate format: Under development, coming soon
- JSON-based GUIs: Under development, coming soon
- Annotation-based riftmod.json generation: Pylon
Features
- Simple and extensible interface-based event system (mods can add their own events with only a few lines of code)
- Interfaces for registering item, blocks, tile entities, fluids, enchantments, particle types, potion effects, biomes, entities, tile entity renderers, custom item renderers, complex (non-json) recipes, dimensions, world types, and more
- Simple network API for easily adding both vanilla packets and mod messages
- Tick events called every client or server tick
- Support for both Mixin and other class transformers, allowing
- Automatic dependency downloading and extraction
- Partial dependencies on other mods, where some features are enabled only if another mod is present.
评论 0
登录后参与评分
还没有评论,来抢沙发吧