mirror of
https://github.com/SimplexDevelopment/SimplexCore.git
synced 2025-02-02 09:30:05 +00:00
Readme
This commit is contained in:
parent
e9544ec8b7
commit
1e4ebd1ff8
@ -1 +1,10 @@
|
|||||||
# SimplexCore
|
# 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>
|
@ -85,15 +85,17 @@ public final class CommandLoader {
|
|||||||
SimplexCorePlugin.getInstance()
|
SimplexCorePlugin.getInstance()
|
||||||
.getLogger().warning(annotated.getSimpleName()
|
.getLogger().warning(annotated.getSimpleName()
|
||||||
+ " is missing a required annotation: "
|
+ " is missing a required annotation: "
|
||||||
+ CommandInfo.class.getSimpleName());
|
+ CommandInfo.class.getSimpleName()
|
||||||
|
+ ". Ignoring.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SimplexCommand.class.isAssignableFrom(annotated)) {
|
if (!SimplexCommand.class.isAssignableFrom(annotated)) {
|
||||||
SimplexCorePlugin.getInstance()
|
SimplexCorePlugin.getInstance()
|
||||||
.getLogger().warning(annotated.getSimpleName()
|
.getLogger().warning(annotated.getSimpleName()
|
||||||
+ " must extend " + SimplexCommand.class.getSimpleName()
|
+ " does not extend "
|
||||||
+ " to be registered as a command.");
|
+ SimplexCommand.class.getSimpleName()
|
||||||
|
+ ". Ignoring.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ public abstract class AbstractGUI implements InventoryHolder, IGUI {
|
|||||||
private final Inventory INV;
|
private final Inventory INV;
|
||||||
private final Map<Integer, ClickAction> actions;
|
private final Map<Integer, ClickAction> actions;
|
||||||
private final UUID uuid;
|
private final UUID uuid;
|
||||||
|
private final Map<IGUI, List<AbstractGUI>> pagesByGUI = new HashMap<>();
|
||||||
|
|
||||||
private final List<Integer> validSize = new ArrayList<>(){{
|
private final List<Integer> validSize = new ArrayList<>(){{
|
||||||
add(9);
|
add(9);
|
||||||
@ -28,6 +29,8 @@ public abstract class AbstractGUI implements InventoryHolder, IGUI {
|
|||||||
add(54);
|
add(54);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
private int pages = 0;
|
||||||
|
|
||||||
public static final Map<UUID, IGUI> invByUUId = new HashMap<>();
|
public static final Map<UUID, IGUI> invByUUId = new HashMap<>();
|
||||||
public static final Map<UUID, UUID> openInvs = 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());
|
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() {
|
public static Map<UUID, IGUI> getInvByUUId() {
|
||||||
return invByUUId;
|
return invByUUId;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user