2022-05-06 02:28:39 +00:00
|
|
|
package dev.plex.util;
|
|
|
|
|
|
|
|
import lombok.Data;
|
2022-05-08 23:34:03 +00:00
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.Location;
|
2022-05-06 02:28:39 +00:00
|
|
|
|
2022-05-08 23:34:03 +00:00
|
|
|
@Data
|
|
|
|
public class CustomLocation
|
2022-05-06 02:28:39 +00:00
|
|
|
{
|
2022-05-08 23:34:03 +00:00
|
|
|
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);
|
|
|
|
}
|
2022-05-06 02:28:39 +00:00
|
|
|
}
|