Do some work on the JavaDoc

This commit is contained in:
graywolf336
2013-12-28 19:50:55 -06:00
parent ce457fc7bf
commit 4ab48b3659
6 changed files with 59 additions and 14 deletions

View File

@ -16,6 +16,16 @@ public class SimpleLocation {
private double x, y, z;
private float yaw, pitch;
/**
* Creates a new SimpleLocation with each detail provided separately.
*
* @param world as a string
* @param x coordinate as a double
* @param y coordinate as a double
* @param z coordinate as a double
* @param yaw as a float
* @param pitch as a float
*/
public SimpleLocation(String world, double x, double y, double z, float yaw, float pitch) {
this.world = world;
this.x = x;
@ -25,6 +35,11 @@ public class SimpleLocation {
this.pitch = pitch;
}
/**
* Creates a new SimpleLocation with all the detail provided from {@link Location}.
*
* @param location to convert to a SimpleLocation
*/
public SimpleLocation(Location location) {
this.world = location.getWorld().getName();
this.x = location.getX();
@ -34,14 +49,17 @@ public class SimpleLocation {
this.pitch = location.getPitch();
}
/** Returns the instance from Bukkit of the world this location is in. */
public World getWorld() {
return Bukkit.getWorld(world);
}
/** Returns the name of the world this location is in. */
public String getWorldName() {
return this.world;
}
/** Returns a new {@link Location} from this SimpleLocation. */
public Location getLocation() {
return new Location(Bukkit.getWorld(world), x, y, z, yaw, pitch);
}