Mod Sets

Mod Sets

2.5k Downloads

[崩溃] "type": "type"

Phoupraw opened this issue · 9 comments

commented

config/modsets/rules/example.json:

{
  "text": {
    "text": "My first rule set",
    "bold": true,
    "color": "green"
  },
  "description": "Awwww",
  "rules": [
    {
      "text": "text",
      "description": "tooltip",
      "controller": {
        "type": "type"
      }
    }
  ]
}

crash: minecraft-exported-crash-info-2023-07-25T12-33-49.zip

commented

config/modsets/rules/mods_group_example.json:

{
  "text": "The mods group",
  "description": "Text Text",
  "controller": {
    "type": "mods_group",
    "collapsed": false,
    "mods": [
      
    ]
  }
}

崩溃报告:minecraft-exported-crash-info-2023-07-25T12-47-46.zip

commented

I'll update the README for avoiding confusing

commented

你的配置不对,type 不能是 type,这个只是示例,不是可以直接使用的
具体的示例是在下方的单个 controller 里的

You config is wrong. Type should not be "type" for controller. The example of rules isn't for running directly.
The actual controller example below showing the correct type.

Or you can take the working example from https://github.com/SettingDust/ModSets/blob/main/example_rules.json

commented

controller 是 rule 的属性,而不是根属性,请参考 https://github.com/SettingDust/ModSets/blob/main/example_rules.json?rgh-link-date=2023-07-25T04%3A44%3A10Z 编写

controller is prop of rule instead of root. Refer to https://github.com/SettingDust/ModSets/blob/main/example_rules.json?rgh-link-date=2023-07-25T04%3A44%3A10Z

*Need json schema for rule json

commented

第一个是我没想到 mods 会为空,我可能会加一个提示不能为空
第二个是问题,你可以先把 boolean 规则删除了,我得复现一下试试看什么情况

commented
{
  "text": {
    "text": "My first rule set",
    "bold": true,
    "color": "green"
  },
  "description": "Awwww",
  "rules": [
    {
      "text": "The mods group",
      "description": "Text Text",
      "controller": {
        "type": "mods_group",
        "collapsed": false,
        "mods": [
          
        ]
      }
    }
  ]
}

image
latest.log

commented

我复制了 https://github.com/SettingDust/ModSets/blob/main/example_rules.jsonconfig/modsets/rules/mods_group_example.json,结果
image
latest.log

commented

第二个 null 是因为 mod set 不存在,也就是你应该没有 sodium,我会加一个合适的提示