Nostalgic Tweaks (Fabric/Forge)

Nostalgic Tweaks (Fabric/Forge)

115k Downloads

[FORGE] improve mod compatiblity by cancelling forge events

AlexModGuy opened this issue ยท 1 comments

commented

Version Information

Minecraft Version: 1.20+

Describe the Bug

Nostalgic Tweaks directly sets fog near and far plane distance via RenderSystem calls, rather than let Forge's event system handle this by properly cancelling the fog event, and setting the event's near and far plane distance. This leads to issues with other mods that expect these values to pertain to the actual fog, such as AlexModGuy/AlexsCaves#781.

Bug Context

https://github.com/Adrenix/Nostalgic-Tweaks/blob/1.20/common/src/main/java/mod/adrenix/nostalgic/util/client/FogUtil.java#L170
Direct calls to RenderSystem bypass the forge event's setFarPlaneDistance() and setNearPlaneDistance(), meaning that any other mod which expects these values to return the start and end of the fog will recieve old, incorrect results. I propose you change the return type of the FogUtil methods to return the three wanted values, and use event's setters rather than set them directly.

commented

Thank you for pointing this out! I implemented the events in beta 9. This will eventually receive a backport fix for 1.20.1.