Skip to content

Commit

Permalink
Fix 1.18.2 implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Aug 25, 2024
1 parent 742c538 commit d3c19f8
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import net.countercraft.movecraft.SmoothTeleport;
import net.countercraft.movecraft.util.ReflectUtils;
import net.minecraft.server.level.ServerPlayer;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -81,8 +79,8 @@ public void teleport(@NotNull Player player, @NotNull Location location) {
double x = location.getX();
double y = location.getY();
double z = location.getZ();
float yawChange = location.getYaw();
float pitchChange = location.getPitch();
float yawChange = location.getYaw() - player.getLocation().getYaw();
float pitchChange = player.getLocation().getPitch() - location.getPitch();
Object handle = ReflectUtils.getHandle(player);
try {
positionMethod.invoke(handle, x, y, z, yawField.get(handle), pitchField.get(handle));
Expand Down

0 comments on commit d3c19f8

Please sign in to comment.