SoLegendary Posted November 22, 2021 Posted November 22, 2021 (edited) I have only recently started modding using Forge, but I found very quickly that I was able to modify the vanilla source code directly by simply right clicking a classname -> Go to Declarations or Usages in IntelliJ. This would open up the source .jar file at the path: \build\fg_cache\net\minecraftforge\forge\1.16.5-36.2.0_mapped_official_1.16.5\forge-1.16.5-36.2.0_mapped_official_source_1.16.5.jar which I could easily pull out of the .jar archive, edit with a notepad and throw back in. I was doing this to disable frustum culling in ClippingHelper.java (ie. rendering outside of the player's usual view) for a camera mod I was working on. However, as of today making these changes seemed to suddenly have no effect. I saved the changes, deleted my .gradle and build folders, invalidated my caches and reran the gradlew genIntellijRuns to rebuild them and suddenly that source jar no longer exists and I cannot find any vanilla .java files anymore, only .class files which are not editable by text editor. My mod still runs perfectly fine, minus the changes to the ClippingHelper class I made of course. So my questions are: Where did this source .jar go? Is there an alternative way to edit Vanilla .java source files like I was doing? Is there an alternative to editing Vanilla classes in the first place? As proof I'm not crazy, I've attached the original ClippingHelper.java class below that I was previously able to find under that path. https://pastebin.com/MvFtQaTH Edited November 25, 2021 by SoLegendary solved Quote
SoLegendary Posted November 24, 2021 Author Posted November 24, 2021 (edited) Do you know another method for editing the view frustum or disabling frustum culling entirely? I've tried looking at Minecraft.levelRenderer as it has quite a few references to view frustums like capturedFrustum, viewArea, frustumPoints, frustumPos, except when I use the access transformer to make these public in order to read them, they all seem to be null or 0. For some context, I've implemented an orthographic camera, but when it's zoomed out, you can see behind the player, which isn't rendered due to frustum culling: Increasing FOV helps somewhat, but I can only get it to a maximum of 180 (ie. a semicircle rendering cone) using the FOV modifier event before it just wraps around again. If there's a way to get it to 360 somehow that would also solve the issue. Edited November 24, 2021 by SoLegendary note about FOV Quote
SoLegendary Posted November 25, 2021 Author Posted November 25, 2021 Actually I solved it a different way by just setting the camera entity to face downward above the ground and hard-setting the FOV to 180 to effectively render everything in range, then just manually offsetting the camera angle up by 45deg. That said, this method would definitely improve performance a lot. Thanks! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.