Skip to content

Commit

Permalink
(略微)调整电网是否渲染计算
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuRuoLing committed Sep 26, 2024
1 parent a9b0949 commit 91e591c
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,9 @@ public SimplePowerGrid(@NotNull PowerGrid grid) {
}

public boolean shouldRender(Vec3 cameraPos) {
int[] renderDistance = {Minecraft.getInstance().options.getEffectiveRenderDistance() * 16};
renderDistance[0] *= renderDistance[0];
int renderDistance = Minecraft.getInstance().options.getEffectiveRenderDistance() * 16;
return powerComponentInfoList.stream()
.anyMatch(it -> it.pos().getCenter().distanceToSqr(cameraPos) < renderDistance[0]);
.anyMatch(it -> it.pos().getCenter().distanceTo(cameraPos) < renderDistance);
}

private void createTransmitterVisualLines() {
Expand Down

0 comments on commit 91e591c

Please sign in to comment.