Add BlockPosition#toLocation

This commit is contained in:
Dan Mulloy 2015-08-29 12:42:47 -04:00
parent fc28a9242c
commit a2452cba67

View File

@ -18,6 +18,8 @@ package com.comphenix.protocol.wrappers;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import com.comphenix.protocol.reflect.EquivalentConverter; import com.comphenix.protocol.reflect.EquivalentConverter;
@ -80,6 +82,15 @@ public class BlockPosition {
return new Vector(x, y, z); 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. * Retrieve the x-coordinate.
* @return X coordinate. * @return X coordinate.