From 444e8b346eab42d09f0a5f1cd2598cba4ac32069 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Fri, 7 Aug 2015 13:18:14 +1000 Subject: [PATCH] Removed deprecated in comment --- src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java | 1 - .../intellectualcrafters/plot/util/helpmenu/HelpMenu.java | 5 ++++- src/main/java/com/plotsquared/general/commands/Command.java | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java b/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java index 55a773db1..e0919431d 100644 --- a/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java +++ b/src/main/java/com/intellectualcrafters/plot/api/PlotAPI.java @@ -60,7 +60,6 @@ import com.plotsquared.bukkit.util.BukkitUtil; * @author Empire92 * @version API 2.0 * - * @deprecated */ @SuppressWarnings("unused") public class PlotAPI { diff --git a/src/main/java/com/intellectualcrafters/plot/util/helpmenu/HelpMenu.java b/src/main/java/com/intellectualcrafters/plot/util/helpmenu/HelpMenu.java index f46467d1a..0d76ba144 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/helpmenu/HelpMenu.java +++ b/src/main/java/com/intellectualcrafters/plot/util/helpmenu/HelpMenu.java @@ -32,7 +32,7 @@ public class HelpMenu { } public HelpMenu generateMaxPages() { - this._maxPage = Math.max((_commands.size() - 1) / PER_PAGE, 1); + this._maxPage = Math.max((_commands.size() - 1) / PER_PAGE, 0); return this; } @@ -40,6 +40,9 @@ public class HelpMenu { if (currentPage > _maxPage) { currentPage = _maxPage; } + if (currentPage < 0) { + currentPage = 0; + } _page = new HelpPage(_commandCategory, currentPage, _maxPage); int max = Math.min((currentPage * PER_PAGE) + (PER_PAGE - 1), _commands.size()); for (int i = currentPage * PER_PAGE; i < max; i++) { diff --git a/src/main/java/com/plotsquared/general/commands/Command.java b/src/main/java/com/plotsquared/general/commands/Command.java index 556a0af53..39ad2aef5 100644 --- a/src/main/java/com/plotsquared/general/commands/Command.java +++ b/src/main/java/com/plotsquared/general/commands/Command.java @@ -140,6 +140,9 @@ public abstract class Command extends CommandManager { } final public CommandCategory getCategory() { + if (category == null) { + return CommandCategory.DEBUG; + } return this.category; }