mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-14 06:24:12 +01:00
Not pointing
- Fix occasional npe in PlayerUniforms - Mark accessor method as Nullable
This commit is contained in:
parent
36b0ad4cf9
commit
7bd59f7b14
@ -40,7 +40,7 @@ public final class PlayerUniforms extends UniformWriter {
|
||||
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);
|
||||
|
||||
@ -54,7 +54,8 @@ public final class PlayerUniforms extends UniformWriter {
|
||||
|
||||
ptr = writeInt(ptr, player.isShiftKeyDown() ? 1 : 0);
|
||||
|
||||
ptr = writeInt(ptr, info.getGameMode().getId());
|
||||
ptr = writeInt(ptr, info == null ? 0 : info.getGameMode()
|
||||
.getId());
|
||||
|
||||
BUFFER.markDirty();
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
@ -9,5 +10,6 @@ import net.minecraft.client.player.AbstractClientPlayer;
|
||||
@Mixin(AbstractClientPlayer.class)
|
||||
public interface AbstractClientPlayerAccessor {
|
||||
@Invoker("getPlayerInfo")
|
||||
@Nullable
|
||||
PlayerInfo flywheel$getPlayerInfo();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user