Under startup_scripts, I have the following in a file;
ForgeEvents.onEvent("net.minecraftforge.client.event.ViewportEvent$RenderFog", (event) => {
if (Platform.isClientEnvironment()) global.RenderFog(event);
});
ForgeEvents.onEvent("net.minecraftforge.client.event.ViewportEvent$ComputeFogColor", (event) => {
if (Platform.isClientEnvironment()) global.ComputeFogColor(event);
});
Of course, this errors on startup, because the client check happens after trying to hook onto the forge event, which throws a error on the server.
So, what do I do here?
I'm sure I could just package the script only to the client, but with the way I have my server stuff set up, this would be awfully inconvenient.
I assume there's some obvious answer, but I had no idea what to ctrl-f to find the answer. Any mixture of 'forge event client' didn't seem to help much.