Skip to content

Commit

Permalink
Hacky way of adding the CullTime to the fps f3 string. Disable the na…
Browse files Browse the repository at this point in the history
…metag code for now, Fixing #5
  • Loading branch information
tr7zw committed Feb 23, 2021
1 parent 7dfd8ad commit f0ed8d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/main/java/dev/tr7zw/entityculling/CullTask.java
Expand Up @@ -26,6 +26,7 @@ public class CullTask implements Runnable {
private final int sleepDelay = 10;
private final Set<BlockEntityType<?>> unCullable;
private Vec3d lastPos = new Vec3d(0, 0, 0);
private long lastTime = 0;

public CullTask(OcclusionCullingInstance culling, Set<BlockEntityType<?>> unCullable) {
this.culling = culling;
Expand All @@ -43,6 +44,7 @@ public void run() {
? client.player.getCameraPosVec(client.getTickDelta())
: client.gameRenderer.getCamera().getPos();
if (requestCull || !lastPos.equals(camera)) {
long start = System.currentTimeMillis();
requestCull = false;
lastPos = camera;
culling.resetCache();
Expand Down Expand Up @@ -97,7 +99,10 @@ public void run() {
}
}
}
lastTime = (System.currentTimeMillis()-start);
}
if(!client.fpsDebugString.contains("CullTime"))
client.fpsDebugString += " CullTime: " + lastTime + "ms"; // Bit hacky, but works for now :shrug:
}
} catch (Exception e) {
e.printStackTrace();
Expand Down
6 changes: 1 addition & 5 deletions src/main/resources/entityculling.mixins.json
Expand Up @@ -9,11 +9,7 @@
"BlockEntityRenderDispatcherMixin",
"WorldRendererMixin",
"EntityRendererMixin",
"CullableMixin",
"EntityMixin",
"TextMixin",
"TextRendererMixin",
"PlayerEntityMixin"
"CullableMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit f0ed8d5

Please sign in to comment.