Skip to content

Commit

Permalink
Merge pull request #13 from RappyLabyAddons/bug/headRotation
Browse files Browse the repository at this point in the history
Bug: Yaw and pitch are switched on `>= 1.16.5`
  • Loading branch information
RappyTV authored Sep 27, 2023
2 parents 34eedfb + 3d9cb0a commit 7071425
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ labyMod {
author = "RappyTV"
description = "This addon saves your last death point, so you can find your items again."
minecraftVersion = "1.8<1.20.2"
version = System.getenv().getOrDefault("VERSION", "1.0.3")
version = System.getenv().getOrDefault("VERSION", "1.0.4")
}

minecraft {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public void onDeathScreen(CallbackInfo ci) {
Location deathLocation = new Location(player.getX(), player.getY(), player.getZ());

if(DeathFinderAddon.get().configuration().saveRotation().get()) {
deathLocation.setYaw(player.xRot);
deathLocation.setPitch(player.yRot);
deathLocation.setYaw(player.yRot);
deathLocation.setPitch(player.xRot);
}
if(deathLocation.equals(DeathFinderAddon.getDeathLocation())) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public void onDeathScreen(CallbackInfo ci) {
Location deathLocation = new Location(player.getX(), player.getY(), player.getZ());

if(DeathFinderAddon.get().configuration().saveRotation().get()) {
deathLocation.setYaw(player.getXRot());
deathLocation.setPitch(player.getYRot());
deathLocation.setYaw(player.getYRot());
deathLocation.setPitch(player.getXRot());
}
if(deathLocation.equals(DeathFinderAddon.getDeathLocation())) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public void onDeathScreen(CallbackInfo ci) {
Location deathLocation = new Location(player.getX(), player.getY(), player.getZ());

if(DeathFinderAddon.get().configuration().saveRotation().get()) {
deathLocation.setYaw(player.getXRot());
deathLocation.setPitch(player.getYRot());
deathLocation.setYaw(player.getYRot());
deathLocation.setPitch(player.getXRot());
}
if(deathLocation.equals(DeathFinderAddon.getDeathLocation())) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public void onDeathScreen(CallbackInfo ci) {
Location deathLocation = new Location(player.getX(), player.getY(), player.getZ());

if(DeathFinderAddon.get().configuration().saveRotation().get()) {
deathLocation.setYaw(player.getXRot());
deathLocation.setPitch(player.getYRot());
deathLocation.setYaw(player.getYRot());
deathLocation.setPitch(player.getXRot());
}
if(deathLocation.equals(DeathFinderAddon.getDeathLocation())) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public void onDeathScreen(CallbackInfo ci) {
Location deathLocation = new Location(player.getX(), player.getY(), player.getZ());

if(DeathFinderAddon.get().configuration().saveRotation().get()) {
deathLocation.setYaw(player.getXRot());
deathLocation.setPitch(player.getYRot());
deathLocation.setYaw(player.getYRot());
deathLocation.setPitch(player.getXRot());
}
if(deathLocation.equals(DeathFinderAddon.getDeathLocation())) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public void onDeathScreen(CallbackInfo ci) {
Location deathLocation = new Location(player.getX(), player.getY(), player.getZ());

if(DeathFinderAddon.get().configuration().saveRotation().get()) {
deathLocation.setYaw(player.getXRot());
deathLocation.setPitch(player.getYRot());
deathLocation.setYaw(player.getYRot());
deathLocation.setPitch(player.getXRot());
}
if(deathLocation.equals(DeathFinderAddon.getDeathLocation())) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public void onDeathScreen(CallbackInfo ci) {
Location deathLocation = new Location(player.getX(), player.getY(), player.getZ());

if(DeathFinderAddon.get().configuration().saveRotation().get()) {
deathLocation.setYaw(player.getXRot());
deathLocation.setPitch(player.getYRot());
deathLocation.setYaw(player.getYRot());
deathLocation.setPitch(player.getXRot());
}
if(deathLocation.equals(DeathFinderAddon.getDeathLocation())) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,16 @@ protected DeathScreenMixin(Component title) {

@Inject(method = "init", at = @At("TAIL"))
public void onDeathScreen(CallbackInfo ci) {
System.out.println("\n\n1\n\n");
if(this.minecraft == null || this.minecraft.player == null) return;
System.out.println("\n\n2\n\n");

LocalPlayer player = this.minecraft.player;
Location deathLocation = new Location(player.getX(), player.getY(), player.getZ());

if(DeathFinderAddon.get().configuration().saveRotation().get()) {
deathLocation.setYaw(player.getXRot());
deathLocation.setPitch(player.getYRot());
System.out.println("\n\n3\n\n");
deathLocation.setYaw(player.getYRot());
deathLocation.setPitch(player.getXRot());
}
if(deathLocation.equals(DeathFinderAddon.getDeathLocation())) return;
System.out.println("\n\n4\n\n");

Laby.fireEvent(new DeathEvent(deathLocation));
}
Expand Down

0 comments on commit 7071425

Please sign in to comment.