mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-30 12:01:24 +01:00
Changed DoubleFlag and IntegerFlag to take java.lang.Number objects in unmarshal().
This commit is contained in:
parent
ecb87efe8d
commit
977c7d2f29
@ -52,6 +52,8 @@ public Double parseInput(WorldGuardPlugin plugin, CommandSender sender,
|
|||||||
public Double unmarshal(Object o) {
|
public Double unmarshal(Object o) {
|
||||||
if (o instanceof Double) {
|
if (o instanceof Double) {
|
||||||
return (Double) o;
|
return (Double) o;
|
||||||
|
} else if (o instanceof Number) {
|
||||||
|
return ((Number) o).doubleValue();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,8 @@ public Integer parseInput(WorldGuardPlugin plugin, CommandSender sender,
|
|||||||
public Integer unmarshal(Object o) {
|
public Integer unmarshal(Object o) {
|
||||||
if (o instanceof Integer) {
|
if (o instanceof Integer) {
|
||||||
return (Integer) o;
|
return (Integer) o;
|
||||||
|
} else if (o instanceof Number) {
|
||||||
|
return ((Number) o).intValue();
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user