Actually fixed #294

This commit is contained in:
Eric Stokes 2011-12-06 18:40:09 -07:00
parent f6e49bd8eb
commit 3a5bc6adda
3 changed files with 4 additions and 5 deletions

View File

@ -77,6 +77,7 @@ public class LocationConfigProperty implements MVConfigProperty<Location> {
this.section.set(configNode + ".pitch", this.value.getPitch());
this.section.set(configNode + ".yaw", this.value.getYaw());
this.section.set(configNode + ".world", this.value.getWorld().getName());
return true;
}

View File

@ -173,10 +173,7 @@ public class MVPlayerListener extends PlayerListener {
// TODO: Fix this. Currently, we only check for PORTAL blocks. I'll have to figure out what
// TODO: we want to do here.
if (newloc != null) {
System.out.println("Found a new location!");
event.setFrom(newloc);
} else {
System.out.println("Did NOT find a new location!");
}
}
// Wait for the adjust, then return!

View File

@ -15,6 +15,7 @@ import org.bukkit.entity.Vehicle;
import org.bukkit.util.Vector;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.Formatter;
import java.util.HashMap;
import java.util.Map;
@ -93,11 +94,11 @@ public class LocationManipulation {
try {
float pitch = 0;
float yaw = 0;
if (split.length == 3) {
if (split.length >= 3) {
yaw = (float) Double.parseDouble(split[2]);
}
if (split.length == 4) {
pitch = (float) Double.parseDouble(split[2]);
pitch = (float) Double.parseDouble(split[3]);
}
return new Location(w, Double.parseDouble(xyzsplit[0]), Double.parseDouble(xyzsplit[1]), Double.parseDouble(xyzsplit[2]), yaw, pitch);
} catch (NumberFormatException e) {