mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fixes #1351
This commit is contained in:
parent
63259ec269
commit
56227a6d7d
@ -162,22 +162,32 @@ public final class Flags {
|
|||||||
Object remove;
|
Object remove;
|
||||||
if (value.DEFAULT_FLAGS.containsKey(duplicate)) {
|
if (value.DEFAULT_FLAGS.containsKey(duplicate)) {
|
||||||
remove = value.DEFAULT_FLAGS.remove(duplicate);
|
remove = value.DEFAULT_FLAGS.remove(duplicate);
|
||||||
if (remove instanceof Collection)
|
try {
|
||||||
|
if (remove instanceof Collection && remove.getClass().getMethod("toString").getDeclaringClass() == Object.class) {
|
||||||
value.DEFAULT_FLAGS.put(flag, flag.parseValue(StringMan.join((Collection) remove, ',')));
|
value.DEFAULT_FLAGS.put(flag, flag.parseValue(StringMan.join((Collection) remove, ',')));
|
||||||
else
|
} else {
|
||||||
value.DEFAULT_FLAGS.put(flag, flag.parseValue("" + remove));
|
value.DEFAULT_FLAGS.put(flag, flag.parseValue("" + remove));
|
||||||
}
|
}
|
||||||
|
} catch (NoSuchMethodException neverHappens) {
|
||||||
|
neverHappens.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
PS.get().foreachPlotRaw(new RunnableVal<Plot>() {
|
PS.get().foreachPlotRaw(new RunnableVal<Plot>() {
|
||||||
@Override public void run(Plot value) {
|
@Override public void run(Plot value) {
|
||||||
if (value.getFlags().containsKey(duplicate)) {
|
if (value.getFlags().containsKey(duplicate)) {
|
||||||
Object remove = value.getFlags().remove(duplicate);
|
Object remove = value.getFlags().remove(duplicate);
|
||||||
if (remove instanceof Collection)
|
try {
|
||||||
|
if (remove instanceof Collection && remove.getClass().getMethod("toString").getDeclaringClass() == Object.class) {
|
||||||
value.getFlags().put(flag, flag.parseValue(StringMan.join((Collection) remove, ',')));
|
value.getFlags().put(flag, flag.parseValue(StringMan.join((Collection) remove, ',')));
|
||||||
else
|
} else {
|
||||||
value.getFlags().put(flag, flag.parseValue("" + remove));
|
value.getFlags().put(flag, flag.parseValue("" + remove));
|
||||||
}
|
}
|
||||||
|
} catch (NoSuchMethodException neverHappens) {
|
||||||
|
neverHappens.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user