IMB11 / Fog

A total overhaul of Minecraft's fog, offering options to customize fog color, start, and end points. Enjoy a more immersive experience with enhanced depth and visuals, all while keeping the same view distance.
https://modrinth.com/mod/fog
Other
25 stars 6 forks source link

Add Compatibility With True Darkness #49

Open minhty-fresh opened 3 days ago

minhty-fresh commented 3 days ago

https://github.com/IMB11/Fog/issues/48

This pull request adds an optional config option in the fog definition for defining "nightNewMoon" which represents the fog color at night during a new moon. If provided, the fog color at night will transition between "night" and "nightNewMoon" fog color depending on the moon phase.

Here is what it looks like if "/generated/assets/c/fog_definitions/tag/biome/is_desert.json" is changed to

{
  "colors": {
    "day": "#D1C8AB",
    "night": "#827D6A",
    "nightNewMoon": "#000000"
  },
  "end_multiplier": 1.0,
  "start_multiplier": 1.0
}

(all other configs untouched) fog-night-new-moon-test

Other biomes' fog colors are unchanged at night and are not affected by moon phase.

IMB11 commented 2 days ago

Thanks for your PR! We'll take a look at it hopefully this weekend :+1:

IMB11 commented 2 days ago

Could I suggest instead of "nightNewMoon", having the "night" split into the following types? (You can use CODEC.either(...))

"night": "hex color"

or

"night": {
    "full_moon": "hex color",
    "new_moon": "hex color"
}

This would keep compatibility with player's resource packs and any biomes that dont need this format.

IMB11 commented 2 days ago

(and obviously, this transition needs to be configurable, you can definitely enable it by default because it's a great idea to have in vanilla anyways)

minhty-fresh commented 2 days ago

Oooh, I really like your suggestion for the night format, let me work on figuring that out, I'm pretty much brand new to minecraft mod dev. I'll also add a config option for enabling the feature.

minhty-fresh commented 2 days ago

Okay, I got it working with your new suggested format, and I also added a config option to disable moon phase color transitions. There is a slight bit of messiness caused by the use of Either<String, NightColors>. It seems required to have that as a property in FogColor for serialization, but also we want to be able to manually instantiate FogColor and Either can't be instantiated, so I had to do a bit of a workaround.