Skip to content

Commit

Permalink
Not pointing
Browse files Browse the repository at this point in the history
- Fix occasional npe in PlayerUniforms
- Mark accessor method as Nullable
  • Loading branch information
Jozufozu committed Sep 23, 2024
1 parent 36b0ad4 commit 7bd59f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void update(RenderContext context) {
Vec3 eyePos = player.getEyePosition(context.partialTick());
ptr = writeVec3(ptr, (float) eyePos.x, (float) eyePos.y, (float) eyePos.z);

ptr = writeTeamColor(ptr, info.getTeam());
ptr = writeTeamColor(ptr, info == null ? null : info.getTeam());

ptr = writeEyeBrightness(ptr, player);

Expand All @@ -54,7 +54,8 @@ public static void update(RenderContext context) {

ptr = writeInt(ptr, player.isShiftKeyDown() ? 1 : 0);

ptr = writeInt(ptr, info.getGameMode().getId());
ptr = writeInt(ptr, info == null ? 0 : info.getGameMode()
.getId());

BUFFER.markDirty();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.engine_room.flywheel.backend.mixin;

import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

Expand All @@ -9,5 +10,6 @@
@Mixin(AbstractClientPlayer.class)
public interface AbstractClientPlayerAccessor {
@Invoker("getPlayerInfo")
@Nullable
PlayerInfo flywheel$getPlayerInfo();
}

0 comments on commit 7bd59f7

Please sign in to comment.