适用于 mcsr:请使用 mods.tildejustin.dev
如果您正在寻找适用于 1.14 至 1.15.2 的普通 Fabric(而非 Ornithe)的 OptiFabric,请查看 OptiFabric Origins
旧版 OptiFabric
适用于旧版 Fabric (1.3.1-1.13.2) 和 Ornithe (b1.7.3-1.14.4) 的 OptiFabric
- 旧版 Fabric 安装程序及官方 MultiMC 实例:
- Ornithe 安装程序(可生成 MultiMC 实例):
- 适用于 Ornithe 和旧版 Fabric 的合法速通 MultiMC 实例(原生 LWJGL,无额外库或模组):Minecraft-Java-Edition-Speedrunning/legacy-fabric-instance-generator/releases
基于 RedLime 的 OptiFabric-Pre1.14 的工作成果,该模组是 hYdos 的 OptiFabric 1.8.9 的一个分支,而后者又是 modmuss 的原始 OptiFabric 的衍生作品。
安装方法
此模组需要 mods 文件夹中包含一个 OptiFine jar 文件,并与 optifabric 共存。对于 1.7.2 及以上版本,可以从 OptiFine 官方网站 获取;对于更早的版本,可以从 SpeedyCube64 的 Pre-1.9 OptiFine 存档 或 OptiFine 历史讨论帖 中获取。
工作原理
此模组使用了 Minecraft-Java-Edition-Speedrunning/fabric-asm,这是 Cat Core 的 Fabric-ASM/no-guava 的一个轻微衍生版本,而后者本身又是 Chocohead 的 fabric-asm 的更新版本。fabric asm 允许更极端的 ASM 修改,且所使用的分支不依赖 guava 或 apache commons,因为旧版 Minecraft 并未提供这些库。
步骤
- 模组会在当前
mods文件夹中查找 OptiFine 安装程序、模组 jar 文件或 zip 包 - 如果找到安装程序 jar,它会在自己的临时类加载器中运行提取任务
- OptiFine 模组 jar 是一组需要替换 Minecraft 所提供类的类文件
- OptiFine 的替换类会更改某些 lambda 方法的名称,因此它会利用原始 Minecraft jar 对旧名称进行合理推测
- 将 OptiFine 重新映射为 intermediary
- 移动修补后的类文件,因为它们不需要在类路径中出现两次
- 将 OptiFine 添加到类路径
- 为每个需要替换的类注册修补 tweaker
- 用提取出的类替换目标类,同时对其进行更多修复,并将其设为 public(由于访问权限问题)
- 希望它能正常工作
注意事项
- 此模组在开发环境或命名环境中实际上无法正常工作。就旧版 Fabric 而言,某些版本的 yarn 构建已损坏,因此目前无法使用;feather 稍好一些,但仍有问题。
- accessWideners 是基于 tiny remapper 的 checkPackageAccess 选项的输出创建的,但它们不太可能达到 100% 完整。如果您遇到与无效访问相关的崩溃,请报告该问题,这可能得以修复。
类排除器
这是一个偶尔有用的隐藏功能,用于在重新映射 jar 时移除文件。为此,它会读取 .minecraft/config/ 中的 optifabric-excluded-classes.json 文件(如果存在),并期望该文件包含版本(字段名)到可移除类数组(或纹理或其他任何内容,即文件名)的映射。
下面提供了一个示例文件内容,用于恢复 1.3.2 light 中 profiler 的移除。如果您尝试为其创建排除条目的 OptiFine 版本已在您的实例中加载过,请删除 .minecraft 文件夹中 .optifine 文件夹内的相应文件夹以强制重新缓存。
{
"OptiFine_1.3.2_L_B2": [
"ik.class"
]
}
for mcsr: use mods.tildejustin.dev
If you're looking for OptiFabric for 1.14 to 1.15.2 for regular Fabric instead of Ornithe, check out OptiFabric Origins
Legacy OptiFabric
OptiFabric for Legacy Fabric (1.3.1-1.13.2) and Ornithe (b1.7.3-1.14.4)
- Legacy Fabric installer and official MultiMC instances:
- Ornithe installer (can generate MultiMC instances):
- Legal speedrunning MultiMC instances for Ornithe and Legacy Fabric (vanilla LWJGL, no extra libraries or mods): Minecraft-Java-Edition-Speedrunning/legacy-fabric-instance-generator/releases
based on the work of RedLime's OptiFabric-Pre1.14, a fork of hYdos's OptiFabric 1.8.9 which in turn is a derivative of modmuss' original OptiFabric
installing
this mod requires an optifine jar in the mods folder alongside optifabric. for 1.7.2 and onwards this can be sourced from OptiFine's official website, and older versions these can be retrieved either from SpeedyCube64's Pre-1.9 Optifine Archive or on the OptiFine history thread.
how it works
this mod uses Minecraft-Java-Edition-Speedrunning/fabric-asm, a minor derivative of Cat Core's Fabric-ASM/no-guava which itself is an updated version of Chocohead's fabric-asm. fabric asm allows more extreme asm modification and the fork used has no dependency on guava or apache commons, which older minecraft versions don't provide.
steps
- the mod looks for an optifine installer or mod jar or zip in the current mods folder
- if it finds an installer jar it runs the extract task in its own throwaway classloader
- the optifine mod jar is a set of classes that need to replace the ones that minecraft provides
- optifine's replacement classes change the name of some lambda methods, so it take a good guess at the old name (using the original minecraft jar)
- remap optifine to intermediary
- move the patched classes out as they won't do much good on the classpath twice
- add optifine to the classpath
- register the patching tweaker for every class that needs replacing
- replace the target class with the class that was extracted, also do some more fixes to it, and make it public (due to access issues)
- hope it works
notes
- this mod does not really work in dev or named environments. In Legacy Fabric's case the yarn builds are corrupted in some versions so this cannot work atm, feather is better but still has issues.
- the accessWideners are created based on the output of tiny remapper's checkPackageAccess option, but they are unlikely to ever be 100% complete. if you have a crash that has to do with and invalid access, report it and it may be able to be fixed.
class excluder
this is a kind of hidden feature that is occasionally useful to remove files when remapping the jar. to do this, it reads the optifabric-excluded-classes.json file
in .minecraft/config/ if it exists, and expects the file to contain a mapping of versions (field names) to an array of removable classes (or textures or anything else, it's just
a filename).
an example file contents to revert the removal of the profiler for 1.3.2 light is provided below. if the optifine version you are trying to make an excluder extry for has already
been loaded before in your instance, delete its folder in the .optifine folder in .minecraft to force a recache.
{
"OptiFine_1.3.2_L_B2": [
"ik.class"
]
}
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Legacy OptiFabric
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
通过预加载更多类,修复 0.17+ 版本(mixin 0.16.0+)加载器上的死锁问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
评论 0
登录后参与评分
还没有评论,来抢沙发吧