Skip to content

🎨 YACL 配置界面与 ModMenu (MC 26.2)

📌 仓库源码声明:本 Wiki 中的文档反映了仓库中的当前源代码状态,可能包含领先于 CurseForge 和 Modrinth 上公开发布版本的最新未发布提交或开发中功能。

配置信息栏详细参数
配置文件路径config/ig_magnet.json
GUI 支持库YetAnotherConfigLib v3 (dev.isxander:yet-another-config-lib)
ModMenu 入口点net.instantgratification.magnet.config.ModMenuIntegration
GUI 界面构造器net.instantgratification.magnet.config.YaclScreenHelper
类加载安全隔离通过 GuiHelper.getOptionalFactory 反射隔离

📖 配置系统架构

Magnet, Let me get that! 提供了由 YetAnotherConfigLib v3 (YACL) 驱动的可选客户端配置界面,并完美支持通过 ModMenu 直接在游戏内打开。

为了确保专用服务器在加载客户端 GUI 类时绝对不会发生 ClassNotFound 崩溃,GUI 工厂采用了反射安全的隔离类加载保护

java
public class ModMenuIntegration implements ModMenuApi {
    @Override
    public ConfigScreenFactory<?> getModConfigScreenFactory() {
        return GuiHelper.getOptionalFactory(
                "ig_magnet",
                "net.instantgratification.magnet.config.YaclScreenHelper",
                "createScreen"
        );
    }
}

⚠️ 配置生效优先级警告

⚠️ 重要提示
在 ModMenu 配置界面或 config/ig_magnet.json 中所做的修改仅会作为新建世界时的基准默认值
若要修改已有活跃世界的配置参数,请在游戏内通过 /gamerule 或原版游戏规则设置界面查阅并调整游戏规则参考


🗂️ 配置分类与选项层级

YACL 配置界面 ("Magnet, Let me get that! Configuration")
  ├── General Settings (常规设置)
  │     ├── Magnet Enabled (启用磁铁,默认: true)
  │     ├── Magnet Range (吸引半径,默认: 12,范围: 1..64)
  │     ├── Instant Pickup (瞬间拾取,默认: false)
  │     └── Magnet Noclip (虚位移穿相,默认: true)
  ├── Speeds & Pull Heuristics (速度与牵引算法)
  │     ├── Item Speed (物品速度,默认: 80%,范围: 1..1000)
  │     └── Item Acceleration (吸引加速度,默认: 10%,范围: 1..1000)
  ├── Line of Sight (LOS) (视线检测)
  │     ├── Line of Sight Only (仅限视线内,默认: true)
  │     ├── Keep Moving if Unseen (脱离视线保持移动,默认: true)
  │     ├── Blocked by Transparent (透明方块阻隔,默认: false)
  │     ├── Blocked by Flora (植被树叶阻隔,默认: false)
  │     └── Blocked by Block Entities (方块实体阻隔,默认: false)
  └── Visuals & Performance (视觉与性能)
        ├── Attract XP Orbs (吸附经验球,默认: true)
        ├── Magnet Particles (粒子效果,默认: true)
        ├── Particle Count (单源粒子数,默认: 1,范围: 0..100)
        └── Max Particle Sources (最大粒子源,默认: 5,范围: 0..100)

📄 原始 JSON 结构 (config/ig_magnet.json)

json
{
  "configVersion": 1,
  "enabled": true,
  "range": 12,
  "noClip": true,
  "affectsXp": true,
  "particles": true,
  "particleCount": 1,
  "maxParticleSources": 5,
  "speed": 80,
  "acceleration": 10,
  "instant": false,
  "losOnly": true,
  "keepMovingIfUnseen": true,
  "blockedByTransparent": false,
  "blockedByFlora": false,
  "blockedByBlockEntities": false
}

🔗 相关 Wiki 文档

Official documentation & web portal for Dasik Igaijinn mods.