Skip to content

Commit

Permalink
Replace unnecessary getWorld calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
Provismet committed Oct 2, 2023
1 parent 68a8432 commit ab78b3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/provismet/vmcmc/vmc/CaptureRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ 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;
}
return time / 24000f;
});

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;
});

Expand Down Expand Up @@ -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<OSCPacket> messages = new ArrayList<>(BLEND_REGISTRY.size() + BONE_REGISTRY.size());

Expand Down

0 comments on commit ab78b3c

Please sign in to comment.