Charmonium
Charmonium copied to clipboard
[Suggestion] Add a conditional check for player distance from portal before playing ambient dimensional sounds
Minecraft Version: 1.15.2 Mod Loader / Version: forge-31.2.36 Charm Version: Charm-1.15.2-1.5.9 Charmonium Version: 1.15.2-1.0.1
Details: First off, thanks for this mod (and Charm and Strange) - they add so much depth to the Vanilla experience that I cannot even fathom the words to describe how appreciative I am of the work you have put in here.
The reason I am suggesting this is because of how your mod interacts with Immersive Portals. In case you haven't seen it, Immersive Portals allows the player to seamlessly transition between dimensions without a loading screen by just walking through. It accomplishes this by keeping the chunks surrounding the portal in the destination dimension loaded. This causes a rather annoying issue in Charmonium, where if the player has opened a portal, the alternate dimension's ambient sounds propagate to the player's current dimension.
So, Overworld ambient sounds play in the Nether, and Nether ambient sounds play in the Overworld. These ambient sounds persist regardless of how far the player travels away from the portal. It seems to happen more often with the Nether sounds in the Overworld, but occasionally this issue ocurrs in the Nether as well, where birds can still be heard chirping, although its harder to reproduce.
I think the same issue might also occur with the Better Portals mod, but I have not tested it.
My suggestion is to add a conditional check to the code that determines when these ambient sounds can play. A satisfactory conditional would check if the player is currently standing in the dimension before playing its associated sound. A more immersive conditional that is better implemented would check if the player is standing within X distance from a portal, and increase the volume the closer the player is to the portal. These conditionals would supplement the existing check for if the dimension is loaded, so as not to break existing functionality.
Steps to reproduce:
- Install Forge
- Install Charm
- Install Charmonium
- Install Immersive Portals
- Build a Nether Portal
- Listen
- Go through the portal
- Listen
- Travel considerable distance
- Listen
- Go back through the Nether Portal
- Travel considerable distance
- Listen
Brief Video of the Issue (Click the image):
(My recording software bugged out so unfortunately this is the best I could do)
Thanks for the ticket and instructions. This got totally lost in the backlog somehow. We will look at building this into an upcoming version.
Ambient sounds are now handled properly when moving through IP portals as of 2.2.0.
Thanks, @svenhjol - It works great!