Skip to content

Commit

Permalink
Fixed resource leak: '<unassigned Closeable value>' is never closed
Browse files Browse the repository at this point in the history
  • Loading branch information
XDPXI committed Nov 23, 2024
1 parent 3ac1332 commit 968687c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/java/dev/xdpxi/xdlib/XDsLibraryClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ private static float getCloudHeightClient(World world) {

@Environment(EnvType.CLIENT)
public static float getRainGradient(World world, float original) {
if (MinecraftClient.getInstance().cameraEntity != null) {
double playerY = MinecraftClient.getInstance().cameraEntity.getPos().y;
MinecraftClient client = MinecraftClient.getInstance();
if (client.cameraEntity != null) {
double playerY = client.cameraEntity.getPos().y;
float cloudY = XDsLibraryClient.getCloudHeight(world) + ADDITIONAL_CLOUD_HEIGHT;

if (playerY < cloudY - GRADIENT_HEIGHT) {
Expand Down

0 comments on commit 968687c

Please sign in to comment.