Skip to content

Commit

Permalink
Merge branch 'refs/heads/1.19' into 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Nov 12, 2024
2 parents a19dac6 + 392a77e commit f35c648
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/main/java/xyz/fulmine/switchy_teleport/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import folk.sisby.switchy.util.Feedback;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3d;
import org.jetbrains.annotations.Nullable;

public record Location(double x, double y, double z, float pitch, float yaw, Identifier dimension, @Nullable Boolean setSpawn) {
Expand All @@ -27,10 +26,6 @@ public static Location fromNbt(NbtCompound nbt) {
);
}

public Vec3d getCoordinates() {
return new Vec3d(x, y, z);
}

public NbtCompound toNbt() {
NbtCompound outNbt = new NbtCompound();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import folk.sisby.switchy.util.Feedback;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import org.jetbrains.annotations.Nullable;
Expand All @@ -33,7 +34,7 @@ public void updateFromPlayer(ServerPlayerEntity player, @Nullable String nextPre
public void applyToPlayer(ServerPlayerEntity player) {
if (location != null) {
player.setSpawnPoint(RegistryKey.of(Registry.WORLD_KEY, location.dimension()),
new BlockPos(location.getCoordinates()),
new BlockPos(new Vec3d(location.x(), location.y(), location.z())),
location.yaw(),
Boolean.TRUE.equals(location.setSpawn()), false);
}
Expand Down

0 comments on commit f35c648

Please sign in to comment.