From ab78b3c46c8e2855cb88999ce8ed0b03e3e4df63 Mon Sep 17 00:00:00 2001 From: Provismet <17149901+Provismet@users.noreply.github.com> Date: Mon, 2 Oct 2023 05:03:50 +0100 Subject: [PATCH] Replace unnecessary getWorld calls. --- .../java/com/provismet/vmcmc/vmc/CaptureRegistry.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/provismet/vmcmc/vmc/CaptureRegistry.java b/src/main/java/com/provismet/vmcmc/vmc/CaptureRegistry.java index 4f59be9..f716d55 100644 --- a/src/main/java/com/provismet/vmcmc/vmc/CaptureRegistry.java +++ b/src/main/java/com/provismet/vmcmc/vmc/CaptureRegistry.java @@ -115,7 +115,7 @@ public static void registerStandardEvents () { }); registerBlendShape("time_of_day", client -> { - float time = client.player.getWorld().getTimeOfDay(); + float time = client.world.getTimeOfDay(); while (time >= 24000f) { time -= 24000f; } @@ -123,8 +123,8 @@ public static void registerStandardEvents () { }); registerBlendShape("rain_amount", client -> { - if (client.player.getWorld().isThundering()) return 1f; - else if (client.player.getWorld().isRaining()) return 0.5f; + if (client.world.isThundering()) return 1f; + else if (client.world.isRaining()) return 0.5f; else return 0f; }); @@ -181,7 +181,7 @@ public static void registerStandardEvents () { * @param client The Minecraft client. */ public static void iterate (MinecraftClient client) { - if (client.player == null || !PacketSender.isValid()) return; + if (client.player == null || client.world == null || !PacketSender.isValid()) return; List messages = new ArrayList<>(BLEND_REGISTRY.size() + BONE_REGISTRY.size());