Module-Guilds/src/main/java/dev/plex/util/CustomLocation.java
2023-09-08 17:40:39 -05:00

24 lines
602 B
Java

package dev.plex.util;
import lombok.Data;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@Data
public class CustomLocation
{
private final String worldName;
private final double x, y, z;
private final float yaw, pitch;
public static CustomLocation fromLocation(Location location)
{
return new CustomLocation(location.getWorld().getName(), location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
}
public Location toLocation()
{
return new Location(Bukkit.getWorld(worldName), x, y, z, yaw, pitch);
}
}