This commit is contained in:
Paldiu 2021-05-14 13:05:20 -05:00
parent e9544ec8b7
commit 1e4ebd1ff8
3 changed files with 29 additions and 3 deletions

View File

@ -1 +1,10 @@
# SimplexCore
<p>SimplexCore is a plugin created by
<a href=https://www.simplexdev.app>Simplex Development Group</a>.</p>
<p>This plugin is an API and framework plugin designed to make plugin development easier, and more user friendly.</p>
<p>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.</p>
<p>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.</p>

View File

@ -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;
}

View File

@ -18,6 +18,7 @@ public abstract class AbstractGUI implements InventoryHolder, IGUI {
private final Inventory INV;
private final Map<Integer, ClickAction> actions;
private final UUID uuid;
private final Map<IGUI, List<AbstractGUI>> pagesByGUI = new HashMap<>();
private final List<Integer> 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<UUID, IGUI> invByUUId = new HashMap<>();
public static final Map<UUID, UUID> 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<UUID, IGUI> getInvByUUId() {
return invByUUId;
}