Add Exact type

This commit is contained in:
Eric Stokes 2011-07-16 22:01:01 -06:00
parent c9c58c93e6
commit fc7db31b0d
2 changed files with 8 additions and 3 deletions

View File

@ -53,10 +53,13 @@ public class Destination {
}
String[] items = dest.split(":");
if (items.length > 2) {
if (items.length == 0) {
return getBadDestination();
}
if (items.length == 1 && items[0].equalsIgnoreCase("here")) {
return new Destination(items[0], DestinationType.Exact);
}
// If we only found one param, assume world, but still check for validity
if (items.length == 1 && plugin.isMVWorld(items[0])) {
return new Destination(items[0], DestinationType.World);
@ -67,6 +70,8 @@ public class Destination {
} else if (items[0].equalsIgnoreCase("p")) {
// TODO: Check for a valid portal, we can't right now, as portals aren't really in yet.
return new Destination(items[1], DestinationType.Portal);
} else if(items[0].equalsIgnoreCase("e")) {
// TODO: The new 'exact' dest type
}
System.out.print("Nothing valid found!!");
return getBadDestination();

View File

@ -1,5 +1,5 @@
package com.onarandombox.utils;
public enum DestinationType {
World, Portal, Invalid
World, Portal, Exact, Invalid
}