diff --git a/src/client/java/dev/xdpxi/xdlib/XDsLibraryClient.java b/src/client/java/dev/xdpxi/xdlib/XDsLibraryClient.java index 32e443a..d545502 100644 --- a/src/client/java/dev/xdpxi/xdlib/XDsLibraryClient.java +++ b/src/client/java/dev/xdpxi/xdlib/XDsLibraryClient.java @@ -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) {