sp614x / optifine

1.77k stars 420 forks source link

[CIT/Random Entities] CIT and Random Entities doesn't work if any "overlays" are present in the pack.mcmeta #7617

Open HanPrower opened 4 months ago

HanPrower commented 4 months ago

Description of Issue

Since MC1.20.2 Mojang introduced the overlays feature so resourcepacks could update to support the weird things Mojang do in point releases and still work across all versions of the game (e.g. a MC1.20 pack will work with the UI changes of MC1.20.1 and the bat of MC1.20.4).

However, if any overlays are present in the pack.mcmeta OptiFine will fail to look for the cit or mob folder in the main assets folder.

Steps to Reproduce

  1. Have a resourcepack with CIT and/or Random Entities
  2. Create a pack.mcmeta with some overlays e.g. pack.mcmeta.txt
  3. See that OptiFine doesn't even attempt to pull in the relevant features

OptiFine Version

OptiFine_1.20.4_HD_U_I7_pre2

Installation Method

Installed directly to the mod.jar via Prism Launcher, moving the relevant notch files to top level. Another person on the BDcraft forum has reported the same when using the installer method.

Log Files/Crash Reports

None are relevant as nothing shows in the log when the issue occurs.

F3 Debug Screenshot

2024-02-08_13 33 15

sp614x commented 3 months ago

Fixed, coming in next preview.

sp614x commented 3 months ago

Would it make sense to add OF specific version checks?

For example:

a) OF RP version = 1000 + RP version: 18 => 1018

 "overlays": {
    "entries": [
      {
        "formats": {
          "min_inclusive": 1016,
          "max_inclusive": 1022
        },
        "directory":"of16"
      },
  }

b) OF MC version: 1.20.4 => 12004

 "overlays": {
    "entries": [
      {
        "formats": {
          "min_inclusive": 12000,
          "max_inclusive": 12004
        },
        "directory":"of1204"
      },
  }

Those could be used to load resources only when OF is present.

ZenithRogue commented 1 week ago

Adding some additional discussion that was mentioned in the Discord.

Having it be under a seperate key would probably be preferable, IE:

"optifine_overlays":{
   "entries":[
      {
         "formats":{
            "min_inclusive":20,
            "max_inclusive":22
         },
         "directory":"of1204"
      }
   ]
}