Merge pull request #1352 from MisterErwin/master

A (possible) fix to #1351
This commit is contained in:
Jesse Boyd 2016-09-14 10:17:11 +10:00 committed by GitHub
commit 63259ec269

View File

@ -6,6 +6,7 @@ import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.RunnableVal;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.MathMan;
import com.intellectualcrafters.plot.util.StringMan;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.Collections;
@ -161,6 +162,9 @@ public final class Flags {
Object remove;
if (value.DEFAULT_FLAGS.containsKey(duplicate)) {
remove = value.DEFAULT_FLAGS.remove(duplicate);
if (remove instanceof Collection)
value.DEFAULT_FLAGS.put(flag, flag.parseValue(StringMan.join((Collection) remove, ',')));
else
value.DEFAULT_FLAGS.put(flag,flag.parseValue("" + remove));
}
}
@ -169,6 +173,9 @@ public final class Flags {
@Override public void run(Plot value) {
if (value.getFlags().containsKey(duplicate)) {
Object remove = value.getFlags().remove(duplicate);
if (remove instanceof Collection)
value.getFlags().put(flag, flag.parseValue(StringMan.join((Collection) remove, ',')));
else
value.getFlags().put(flag,flag.parseValue("" + remove));
}
}