Code Monkey home page Code Monkey logo

modsets's Introduction

Mod Sets

Modrinth Downloads Modrinth Version Modrinth Game Versions

GitHub GitHub issues
Static Badge Discord

This project heavily inspired by ThatOrThis
The mod is using for Minecraft Fabric/Quilt/Forge for managing mod loading in game.
And useful for modpack developer

Feature

  • Enable/Disable mods in game with defined mod sets/subdirectory name/mod id(Need restart)
  • Using https://github.com/isXander/YetAnotherConfigLib for config screen
  • Custom mod loading rules for modpack developer to make the pack with more user defined options

Usage

The rules files should be json in config/modsets/rules.
Add rule and enter the config screen through Mod Menu
Full example: https://github.com/SettingDust/ModSets/blob/main/example_rules.json

Mod Set

Mod set is entry defined in config/modsets/modsets.json that is string to set of mod id map.
Specifically, sub folder name in mods folder will be mod sets the mods in it. And mod id will be the mod set only contains itself.
Notice, the defined mod sets by config will override the folder/mod id with the same name.
Example:

{
  // The `sodium` will target the two mods here. 
  // If disable this mod set, the mod in list won't load if it is exist
  "sodium": {
    "text": "Sodium",
    "description": "Performance: +++++",
    "mods": [
      "sodium",
      "indium"
    ]
  }
}

Rule

img_1.png Every rule hold a text and description for displaying the info you want.
And a controller for YACL user interface Example:

{
  "text": {
    "text": "My first rule set",
    "bold": true,
    "color": "green"
  },
  "description": "Awwww",
  "rules": [
    {
      "text": "text",
      "description": "description",
      "controller": {
        "type": "type" // Notice, this isn't valid type of controller. Take the type from controllers below
      }
    }
  ]
}

Controllers

Label

For displaying text on screen Example:

{
  "text": "The label",
  "description": "Text Text",
  "controller": {
    "type": "label"
  }
}

Boolean

For switching a single mod set on/off
Example:

{
  "text": "The boolean",
  "description": "Text Text",
  "controller": {
    "type": "boolean",
    "mod": "sodium"
  }
}

Cycling

For switching between mod sets in a list.
Useful when there is conflicting mods such as sodium and optifabric. Or switching the pack difficult Example:

{
  "text": "The cycling",
  "description": "Text Text",
  "controller": {
    "type": "cycling",
    "mods": [ // Don't empty
      "sodium",
      "optifabric"
    ]
  }
}

Mods Group

Assign a simple boolean controller option to every mods in the mod sets. Example:

{
  "text": "The mods group",
  "description": "Text Text",
  "controller": {
    "type": "mods_group",
    // Default is true
    "collapsed": false,
    "mods": [ // Don't empty
      "sodium",
      "optifabric"
    ]
  }
}

Rules Group

Group the rules so that it's able to collapse the rules Example:

{
  "text": "The rules group",
  "description": "Text Text",
  "controller": {
    "type": "rules_group",
    // Default is true
    "collapsed": true,
    "rules": [ // Don't empty
      {
        "text": "text",
        "description": "description",
        "controller": {
          "type": "label"
        }
      },
      {
        "text": "text",
        "description": "description",
        "controller": {
          "type": "boolean",
          "mod": "sodium"
        }
      }
    ]
  }
}

Notice: Every text and description is text raw json. Using https://www.minecraftjson.com/ for generating text.

modsets's People

Contributors

settingdust avatar u7f8au7fbd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

modsets's Issues

Refactor and port to 1.21

  • Port to 1.21.
  • Control disabled mod by mod set instead of mod id.
  • Split components of ModSet into standalone class to work before Minecraft loaded.

"Save Changes" and "Undo" buttons swapped (on specific condition)

(Sorry for bad English, if it's here)
Let's assume that i created 2 rules and 2 modsets:
изображение

Then i am trying to disable "Client mods" and this happens:
Bug

It's not working, But if i do "Undo" button:
b

Now it's working and if i do this:
bug2

It's also working (I showed here wrong tab but just trust me). BUT if i swap "Rule" and "Modlist" tabs (swap the names of "1.json" and "2.json" files) the bug occurs from "other side":
bug3
bug4
bug5

There is config files if needed:
1.json
2.json
modsets.json

I want to implement this mod in my modpack but this bug makes everything worse.

Remaster the nested group

Relate:

There isn't a way to nest group

For now, the nested mods group will add three controllers

  1. The rule text as label controller
  2. The mod set option as a boolean controller*
  3. All the mods in the mod set as booleans controller(var length)

*You shouldn't use mod ID as mod set ID when the mods in the mod set contain the mod itself

The rules group will be

  1. The rule text as label controller
  2. The rules

Disabled mods are still loaded

Description
As you can see, removing mod ID from the list doesn't do anything:

Images

image
image

To reproduce

  1. Install Mod Sets and its dependencies
  2. Install any other mod (Sodium, for example)
  3. Launch the game
  4. Remove sodium from the Sodium group
  5. Restart the game
  6. Sodium is still loaded

Additional
Maybe I'm just wrong in understanding how this feature should work ._.

Crashes on launch due to space in mod ID of "mod sets_common_config_"

The issue occurs with both mod_sets-ingame-1.7.0+sha.37ee792+1.20.1.jar (mod sets_common_config_) and mod_sets-config-1.7.0+sha.37ee792+1.20.1.jar (mod sets_common_ingame_)

Mod Sets was downloaded from Modrinth: https://modrinth.com/mod/mod-sets/version/1.7.0-intermediary

latest.log

Details
[09:51:15] [main/INFO]: Loading Minecraft 1.20.1 with Fabric Loader 0.15.10
[09:51:15] [main/ERROR]: Incompatible mods found!
net.fabricmc.loader.impl.FormattedException: net.fabricmc.loader.impl.discovery.ModResolutionException: Mod discovery failed!
	at net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:63) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:197) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:146) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.15.10.jar:?]
	at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:88) ~[?:?]
	at org.prismlauncher.EntryPoint.listen(EntryPoint.java:126) ~[?:?]
	at org.prismlauncher.EntryPoint.main(EntryPoint.java:71) ~[?:?]
Caused by: net.fabricmc.loader.impl.discovery.ModResolutionException: Mod discovery failed!
	at net.fabricmc.loader.impl.discovery.ModDiscoverer.lambda$discoverMods$1(ModDiscoverer.java:159) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer.discoverMods(ModDiscoverer.java:159) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.FabricLoaderImpl.setup(FabricLoaderImpl.java:215) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:192) ~[fabric-loader-0.15.10.jar:?]
	... 6 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Error analyzing [C:\Users\anon\AppData\Roaming\PrismLauncher\instances\test\.minecraft\mods\mod_sets-intermediary-1.7.0+sha.37ee792+1.20.1.jar]: net.fabricmc.loader.impl.util.ExceptionUtil$WrappedException: net.fabricmc.loader.impl.metadata.ParseMetadataException: Error reading fabric.mod.json file for mod at C:\Users\anon\AppData\Roaming\PrismLauncher\instances\test\.minecraft\mods\mod_sets-intermediary-1.7.0+sha.37ee792+1.20.1.jar -> META-INF/jars/mod_sets-config-1.7.0+sha.37ee792+1.20.1.jar: Invalid mod id mod sets_common_config_: It contains invalid characters: ' '!
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
	at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
	at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:562) ~[?:?]
	at java.util.concurrent.ForkJoinTask.reportExecutionException(ForkJoinTask.java:604) ~[?:?]
	at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:981) ~[?:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer.discoverMods(ModDiscoverer.java:156) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.FabricLoaderImpl.setup(FabricLoaderImpl.java:215) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:192) ~[fabric-loader-0.15.10.jar:?]
	... 6 more
Caused by: java.lang.RuntimeException: Error analyzing [C:\Users\anon\AppData\Roaming\PrismLauncher\instances\test\.minecraft\mods\mod_sets-intermediary-1.7.0+sha.37ee792+1.20.1.jar]: net.fabricmc.loader.impl.util.ExceptionUtil$WrappedException: net.fabricmc.loader.impl.metadata.ParseMetadataException: Error reading fabric.mod.json file for mod at C:\Users\anon\AppData\Roaming\PrismLauncher\instances\test\.minecraft\mods\mod_sets-intermediary-1.7.0+sha.37ee792+1.20.1.jar -> META-INF/jars/mod_sets-config-1.7.0+sha.37ee792+1.20.1.jar: Invalid mod id mod sets_common_config_: It contains invalid characters: ' '!
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:300) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:249) ~[fabric-loader-0.15.10.jar:?]
	at java.util.concurrent.RecursiveTask.exec(RecursiveTask.java:100) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: net.fabricmc.loader.impl.util.ExceptionUtil$WrappedException: net.fabricmc.loader.impl.metadata.ParseMetadataException: Error reading fabric.mod.json file for mod at C:\Users\anon\AppData\Roaming\PrismLauncher\instances\test\.minecraft\mods\mod_sets-intermediary-1.7.0+sha.37ee792+1.20.1.jar -> META-INF/jars/mod_sets-config-1.7.0+sha.37ee792+1.20.1.jar: Invalid mod id mod sets_common_config_: It contains invalid characters: ' '!
	at net.fabricmc.loader.impl.util.ExceptionUtil.wrap(ExceptionUtil.java:51) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:278) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:249) ~[fabric-loader-0.15.10.jar:?]
	at java.util.concurrent.RecursiveTask.exec(RecursiveTask.java:100) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:686) ~[?:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.computeNestedMods(ModDiscoverer.java:500) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.computeJarFile(ModDiscoverer.java:342) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:290) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:249) ~[fabric-loader-0.15.10.jar:?]
	at java.util.concurrent.RecursiveTask.exec(RecursiveTask.java:100) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: net.fabricmc.loader.impl.metadata.ParseMetadataException: Error reading fabric.mod.json file for mod at C:\Users\anon\AppData\Roaming\PrismLauncher\instances\test\.minecraft\mods\mod_sets-intermediary-1.7.0+sha.37ee792+1.20.1.jar -> META-INF/jars/mod_sets-config-1.7.0+sha.37ee792+1.20.1.jar: Invalid mod id mod sets_common_config_: It contains invalid characters: ' '!
	at net.fabricmc.loader.impl.metadata.MetadataVerifier.checkModId(MetadataVerifier.java:146) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.metadata.MetadataVerifier.verify(MetadataVerifier.java:52) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.metadata.ModMetadataParser.parseMetadata(ModMetadataParser.java:49) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.parseMetadata(ModDiscoverer.java:506) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.computeJarStream(ModDiscoverer.java:396) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:276) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:249) ~[fabric-loader-0.15.10.jar:?]
	at java.util.concurrent.RecursiveTask.exec(RecursiveTask.java:100) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:686) ~[?:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.computeNestedMods(ModDiscoverer.java:500) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.computeJarFile(ModDiscoverer.java:342) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:290) ~[fabric-loader-0.15.10.jar:?]
	at net.fabricmc.loader.impl.discovery.ModDiscoverer$ModScanTask.compute(ModDiscoverer.java:249) ~[fabric-loader-0.15.10.jar:?]
	at java.util.concurrent.RecursiveTask.exec(RecursiveTask.java:100) ~[?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.