Fix plot list add

This commit is contained in:
Jesse Boyd 2016-03-29 17:56:48 +11:00
parent eed8cbec5a
commit 9bd3f2cbfd
3 changed files with 8 additions and 4 deletions

View File

@ -225,7 +225,6 @@ public class FlagCmd extends SubCommand {
MainUtil.sendMessage(player, C.FLAG_NOT_ADDED);
return false;
}
DBFunc.setFlags(plot, plot.getFlags().values());
MainUtil.sendMessage(player, C.FLAG_ADDED);
return true;
}

View File

@ -147,7 +147,7 @@ public class Flag<T> implements Cloneable {
}
return new Flag(this.key, method.invoke(this.value));
}
return new Flag(this.key, this.key.parseValueRaw(this.value.toString()));
return new Flag(this.key, this.key.parseValueRaw(this.key.toString(this.value)));
} catch (CloneNotSupportedException | IllegalAccessException | IllegalArgumentException | NoSuchMethodException | SecurityException | InvocationTargetException e) {
e.printStackTrace();
}

View File

@ -1,5 +1,6 @@
package com.intellectualcrafters.plot.flag;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.util.StringComparison;
import com.intellectualcrafters.plot.util.StringMan;
@ -441,7 +442,9 @@ public abstract class FlagValue<T> {
@Override
public List<String> parse(final String t) {
return Arrays.asList(t.split(","));
System.out.println("PARSE: " + t);
PS.stacktrace();
return new ArrayList<>(Arrays.asList(t.split(",")));
}
@Override
@ -454,6 +457,7 @@ public abstract class FlagValue<T> {
try {
((List<String>) t).addAll(parse(value));
} catch (final Exception ignored) {
ignored.printStackTrace();
}
}
@ -463,7 +467,8 @@ public abstract class FlagValue<T> {
for (final String item : parse(value)) {
((List<String>) t).remove(item);
}
} catch (final Exception e) {
} catch (final Exception ignored) {
ignored.printStackTrace();
}
}
}