From a554ae5633ec138233b83a8fb08b86cb0e8b4e2c Mon Sep 17 00:00:00 2001 From: MattBDev Date: Fri, 9 Dec 2016 16:58:32 -0500 Subject: [PATCH 1/4] Potential fix for commands --- .../com/intellectualcrafters/plot/commands/MainCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index fb46885c6..34cea9087 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -223,12 +223,12 @@ public class MainCommand extends Command { // Trim command args = Arrays.copyOfRange(args, 1, args.length); } - if (args.length >= 2 && args[0].charAt(0) == '-') { + if (args.length >= 2 && !args[0].isEmpty() && args[0].charAt(0) == '-') { switch (args[0].substring(1)) { case "f": confirm = new RunnableVal3() { @Override - public void run(final Command cmd, final Runnable success, final Runnable failure) { + public void run(Command cmd, Runnable success, Runnable failure) { if (EconHandler.manager != null) { PlotArea area = player.getApplicablePlotArea(); if (area != null) { From 9ad45750eec8fc04977d1046f4ae12165e4b1193 Mon Sep 17 00:00:00 2001 From: MattBDev Date: Fri, 9 Dec 2016 20:58:05 -0500 Subject: [PATCH 2/4] Unclaiming a plot should call plotExit() --- .../java/com/intellectualcrafters/plot/object/Plot.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java b/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java index 7320beae4..6a46ea13a 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java @@ -29,6 +29,7 @@ import com.intellectualcrafters.plot.util.block.LocalBlockQueue; import com.intellectualcrafters.plot.util.expiry.ExpireManager; import com.intellectualcrafters.plot.util.expiry.PlotAnalysis; import com.plotsquared.listener.PlotListener; + import java.awt.geom.Area; import java.awt.geom.PathIterator; import java.awt.geom.Rectangle2D; @@ -46,7 +47,6 @@ import java.util.Map.Entry; import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicInteger; /** * The plot class
@@ -767,7 +767,6 @@ public class Plot { @Override public void run() { if (queue.isEmpty()) { - AtomicInteger finished = new AtomicInteger(0); Runnable run = new Runnable() { @Override public void run() { @@ -1095,8 +1094,8 @@ public class Plot { DBFunc.delete(current); current.owner = null; current.settings = null; - for (PlotPlayer pp : current.getPlayersInPlot()) { - PlotListener.plotEntry(pp, current); + for (PlotPlayer player : current.getPlayersInPlot()) { + PlotListener.plotExit(player, current); } } return true; From d554dab8c8e8c9cfb7fbad9dc6f8e81b647b238a Mon Sep 17 00:00:00 2001 From: MattBDev Date: Sat, 10 Dec 2016 14:33:48 -0500 Subject: [PATCH 3/4] Fix potential NPE with claiming --- .../java/com/intellectualcrafters/plot/object/PlotArea.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/object/PlotArea.java b/Core/src/main/java/com/intellectualcrafters/plot/object/PlotArea.java index b260949c4..19ce0c29f 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/object/PlotArea.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/object/PlotArea.java @@ -21,6 +21,7 @@ import com.intellectualcrafters.plot.util.block.LocalBlockQueue; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -464,11 +465,14 @@ public abstract class PlotArea { } public Set getPlotsAbs(final UUID uuid) { + if (uuid == null) { + return Collections.emptySet(); + } final HashSet myPlots = new HashSet<>(); foreachPlotAbs(new RunnableVal() { @Override public void run(Plot value) { - if (value.owner.equals(uuid)) { + if (uuid.equals(value.owner)) { myPlots.add(value); } } From d648148f51698bd399692b23870e2b12dbd84007 Mon Sep 17 00:00:00 2001 From: Very Evil Olaf Date: Mon, 12 Dec 2016 15:42:00 +0100 Subject: [PATCH 4/4] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f29e00c05..b193b6e5f 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,12 +1,22 @@ -# Bug report template (Follow this template unless you are making a feature request.) -**Debug paste link**: +# Bug report template + + + +**Debug paste link:** + + +**Description of the problem:** + + +**How to replicate:** + + +**Checklist**: + +- [] I included a `/plot debugpaste` link +- [] I made sure there are no duplicates of this report [(Use Search)](https://github.com/IntellectualSites/PlotSquared/issues?utf8=%E2%9C%93&q=is%3Aissue) +- [] I made sure I am using an up-to-date version of PlotSquared +- [] I Made sure the bug/error is not caused by any other plugin -**Description of the problem:** -**How to replicate**: -Make sure you've completed the following steps (put an X between of brackets): -- [] Include `/plot debugpaste` -- [] Made sure there aren't duplicates of this report [(Use Search)](https://github.com/IntellectualSites/PlotSquared/issues?utf8=%E2%9C%93&q=is%3Aissue) -- [] Made sure you're using an up-to-date version of PlotSquared -- [] Made sure the bug/error isn't caused by any other plugin