Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
A fix
Browse files Browse the repository at this point in the history
  • Loading branch information
I-No-oNe committed Jul 18, 2024
1 parent ef6cbac commit 120b277
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.mojang.authlib.GameProfile;
import net.i_no_am.freecamera.client.Global;
import net.i_no_am.freecamera.utils.ConfigUtils;
import net.i_no_am.freecamera.utils.FakePlayerUtils;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
Expand All @@ -22,10 +21,9 @@ public MixinAbstractClientPlayerEntity(World world, BlockPos pos, float yaw, Gam

@Inject(method = "isSpectator", at = @At("HEAD"), cancellable = true)
private void onIsSpectator(CallbackInfoReturnable<Boolean> cir) {
if (mc.player == null) return;
if ((Object) this instanceof FakePlayerUtils) return;
if (ConfigUtils.isCameraActive()) {
if ((Object) this != mc.player) return;
cir.setReturnValue(true);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
import net.minecraft.client.world.ClientWorld;

import java.util.Objects;
import java.util.UUID;

public class FakePlayerUtils extends OtherClientPlayerEntity implements Global {

private final ClientPlayerEntity p = mc.player;
private final ClientWorld w = mc.world;

public FakePlayerUtils() {
super(Objects.requireNonNull(mc.world), new GameProfile(UUID.fromString("66123666-6666-6666-6666-666666666600"), mc.player.getName().getString()));
super(Objects.requireNonNull(mc.world), new GameProfile(Objects.requireNonNull(mc.player).getUuid(), mc.player.getName().getString()));
copyPositionAndRotation(mc.player);
copyInventory();
copyPlayerModel();
Expand Down

0 comments on commit 120b277

Please sign in to comment.