Uncreative Posted March 5, 2021 Posted March 5, 2021 Hi, A lot of automated designs (mob farms, for example) in Minecraft can generate a ton of entities and those entities getting rendered end up dumping your FPS to 0. I'm trying to write a mod that allows you to limit the number of entities rendered, to avoid this. So far I've found that WorldRenderer::updateCameraAndRender() seems to be the function I would want to modify, as it is calling the methods that end up causing an entity to be rendered, and counts the number of entities rendered. What I want to do is add a simple "if" case that causes it to not render entities if "countEntitiesRendered" goes over a certain number. However, I am having a hard time figuring out how to do this. At first, I thought I would just create a class extending WorldRenderer that overrides that method, copy and paste the code from it, and add in the if statement. But since many of the fields from WorldRenderer are private, the extension class cannot access them, requiring large amounts of reflection to change privacy levels. Is there a better way to do what I am trying to do? 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.