Dynamic Surroundings

Dynamic Surroundings

51M Downloads

[Compatibility] Just Enough Dimensions

Efimero opened this issue ยท 6 comments

commented

Mod Version: 3.4.9.3

Forge Version: 2611

Description: your custom thunder and rain effects don't happen in custom (JED) dimensions when using separate dimension worldinfo; sky goes dark, but the effects don't trigger.
I reported the issue to JED since you have a hook to trigger the storms, but maybe you could check for the mod and if so look for the per-world worldinfo file?
hopefully then both mods can work together

commented

It depends on how they handle their dimensions. If they do something different than Minecraft it probably won't work. I will take a look at mod compat and see if there is anything possible to do. Thanks!

commented

Ah yes, I seem to remember that ClientRegistry stuff when I tried to look into this, but I couldn't find where it determines whether a dimension can have weather effects. So based on this, in a mod pack scenario (where even the JED dimensions are pre-set/predictable), it should be possible for the pack author to configure the JED dimensions to have the weather effects then?

And yes I agree, it would be nice to have some properties/tags for dimensions, maybe in the WorldProvider, or maybe it would be better in the DimensionType so that even existing providers could be configured to have different properties based on the registered DimensionType in use, so that the mod registering the dimension could indicate what type it is.

commented

Yes, a pack author has the ability to configure DS behavior using external JSON config files, including turning on weather for a dimension.

commented

How does Dynamic Surroundings handle the weather stuff, ie. how does it decide where to render the effects? I tried to look through your code back when that issue was posted for JED, but couldn't quite find what I was looking for (and then forgot to comment back on that issue >_>). So does DS check for the DimensionType, or which WorldProvider is in use (does it need to extend the vanilla Surface provider maybe?), or something else?

commented

First, the hooks:

  • DS uses the Forge hook for render weather. On world load DS executes some code to hook it. If another mod has already made a hook it does not - it assumes a non-cosmetic mod needs the hook.
  • The actual rendering for Overworld occurs here. It is very similar to how Minecraft does rendering, but has enhancements for dust, different precipitation strengths, optimizations for performance, etc.
  • For rain splash particles and sound DS uses ASM to intercept the call and redirects to this method.

From a default standpoint DS assumes that a dimension does not have weather effects. It relies on configuration data to determine if weather actually occurs within a dimension.

The reason DS assumes no weather for a dimension is because most of the modded dimensions that it runs into are either space related (like Galacticraft), have some weird properties (RFTools and Mystcraft), or has their own needs for controlling weather (like Twilight Forest progression). Personally I would like to see a properties on dimensions similar to that on Biomes where a mod author can indicate things like weather, space, air, etc. From a compat standpoint with JED this is where I think this issue fits. It would be nice of DS can somehow query the world/dimension to find out if weather can be hooked.

EDIT: I should point out that config files can be provided to "turn on" weather for a dimension. For mods that have predictable dimensions this works well, and this is how I provide "out of the box" support for mods. However, for mods like JED (and Advanced Rocketry for that matter) that can dynamically create dimensions it is problematic.