From 9bd3f2cbfd8ca725e7086e36fa678e1bc9d0b9ac Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 29 Mar 2016 17:56:48 +1100 Subject: [PATCH] Fix plot list add --- .../com/intellectualcrafters/plot/commands/FlagCmd.java | 1 - .../java/com/intellectualcrafters/plot/flag/Flag.java | 2 +- .../com/intellectualcrafters/plot/flag/FlagValue.java | 9 +++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java index 3c5e53656..2357499a4 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/FlagCmd.java @@ -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; } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flag.java b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flag.java index cde856235..9deafd176 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flag.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flag.java @@ -147,7 +147,7 @@ public class Flag 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(); } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/flag/FlagValue.java b/Core/src/main/java/com/intellectualcrafters/plot/flag/FlagValue.java index 56b65d6a4..d93734c7d 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/flag/FlagValue.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/flag/FlagValue.java @@ -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 { @Override public List 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 { try { ((List) t).addAll(parse(value)); } catch (final Exception ignored) { + ignored.printStackTrace(); } } @@ -463,7 +467,8 @@ public abstract class FlagValue { for (final String item : parse(value)) { ((List) t).remove(item); } - } catch (final Exception e) { + } catch (final Exception ignored) { + ignored.printStackTrace(); } } }