Changed DoubleFlag and IntegerFlag to take java.lang.Number objects in unmarshal().

This commit is contained in:
sk89q 2013-07-07 11:45:22 -07:00
parent ecb87efe8d
commit 977c7d2f29
2 changed files with 4 additions and 0 deletions

View File

@ -52,6 +52,8 @@ public Double parseInput(WorldGuardPlugin plugin, CommandSender sender,
public Double unmarshal(Object o) {
if (o instanceof Double) {
return (Double) o;
} else if (o instanceof Number) {
return ((Number) o).doubleValue();
} else {
return null;
}

View File

@ -52,6 +52,8 @@ public Integer parseInput(WorldGuardPlugin plugin, CommandSender sender,
public Integer unmarshal(Object o) {
if (o instanceof Integer) {
return (Integer) o;
} else if (o instanceof Number) {
return ((Number) o).intValue();
} else {
return null;
}