From 1e4ebd1ff8c5018b8648fd00b181356e1c2508c5 Mon Sep 17 00:00:00 2001 From: Paldiu Date: Fri, 14 May 2021 13:05:20 -0500 Subject: [PATCH] Readme --- README.md | 9 +++++++++ .../simplexcore/command/CommandLoader.java | 8 +++++--- .../simplexdev/simplexcore/gui/AbstractGUI.java | 15 +++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7e6553a..f712c14 100644 --- a/README.md +++ b/README.md @@ -1 +1,10 @@ # SimplexCore + +

SimplexCore is a plugin created by +Simplex Development Group.

+

This plugin is an API and framework plugin designed to make plugin development easier, and more user friendly.

+

SimplexCore vastly reduces boilerplate by creating autonomous functions which do most of the tedious work for you. +Registering commands is as simple as creating classes annotated with the @CommandInfo annotation, and extending SimplexCommand, which automatically registers with the spigot framework. This removes the need of using the plugin.yml to define commands and permissions. +Creating items uses a worker class which is a recursive object that builds an item and outputs the result. +SimplexListener subclasses are automatically registered upon new class initialization.

+

Everything is still in the process of being JavaDocced, so if there is no javadocs for the class or method you are trying to use, one will be added in a future update.

\ No newline at end of file diff --git a/src/main/java/io/github/simplexdev/simplexcore/command/CommandLoader.java b/src/main/java/io/github/simplexdev/simplexcore/command/CommandLoader.java index cb83f5b..3f3e0ae 100644 --- a/src/main/java/io/github/simplexdev/simplexcore/command/CommandLoader.java +++ b/src/main/java/io/github/simplexdev/simplexcore/command/CommandLoader.java @@ -85,15 +85,17 @@ public final class CommandLoader { SimplexCorePlugin.getInstance() .getLogger().warning(annotated.getSimpleName() + " is missing a required annotation: " - + CommandInfo.class.getSimpleName()); + + CommandInfo.class.getSimpleName() + + ". Ignoring."); return; } if (!SimplexCommand.class.isAssignableFrom(annotated)) { SimplexCorePlugin.getInstance() .getLogger().warning(annotated.getSimpleName() - + " must extend " + SimplexCommand.class.getSimpleName() - + " to be registered as a command."); + + " does not extend " + + SimplexCommand.class.getSimpleName() + + ". Ignoring."); return; } diff --git a/src/main/java/io/github/simplexdev/simplexcore/gui/AbstractGUI.java b/src/main/java/io/github/simplexdev/simplexcore/gui/AbstractGUI.java index a0fcd0c..288a499 100644 --- a/src/main/java/io/github/simplexdev/simplexcore/gui/AbstractGUI.java +++ b/src/main/java/io/github/simplexdev/simplexcore/gui/AbstractGUI.java @@ -18,6 +18,7 @@ public abstract class AbstractGUI implements InventoryHolder, IGUI { private final Inventory INV; private final Map actions; private final UUID uuid; + private final Map> pagesByGUI = new HashMap<>(); private final List validSize = new ArrayList<>(){{ add(9); @@ -28,6 +29,8 @@ public abstract class AbstractGUI implements InventoryHolder, IGUI { add(54); }}; + private int pages = 0; + public static final Map invByUUId = new HashMap<>(); public static final Map openInvs = new HashMap<>(); @@ -88,6 +91,18 @@ public abstract class AbstractGUI implements InventoryHolder, IGUI { invByUUId.remove(getInvUUId()); } + public void addPage(AbstractGUI page) { + pages += 1; + } + + public void deletePage(AbstractGUI page) { + if (pages == 0) { + return; + } + + pages -= 1; + } + public static Map getInvByUUId() { return invByUUId; }