mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-24 03:25:29 +01:00
Add BlockPosition#toLocation
This commit is contained in:
parent
fc28a9242c
commit
a2452cba67
@ -18,6 +18,8 @@ package com.comphenix.protocol.wrappers;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.comphenix.protocol.reflect.EquivalentConverter;
|
||||
@ -80,6 +82,15 @@ public class BlockPosition {
|
||||
return new Vector(x, y, z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert this instance to an equivalent Location.
|
||||
* @param world World for the location
|
||||
* @return Location
|
||||
*/
|
||||
public Location toLocation(World world) {
|
||||
return new Location(world, x, y, z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the x-coordinate.
|
||||
* @return X coordinate.
|
||||
|
Loading…
Reference in New Issue
Block a user