Skip to content

Commit

Permalink
Added the possibility to specify custom item categories
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-albers committed Nov 11, 2016
1 parent 4fca938 commit b685afe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/eu/the5zig/mod/ModAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ public interface ModAPI {
*/
void registerModuleItem(Object plugin, String key, Class<? extends AbstractModuleItem> moduleItem, Category category);

/**
* Registers a new ModuleItem.
*
* @param plugin the plugin instance.
* @param key a unique key of the module item.
* @param moduleItem the class of the module item.
* @param category the category of the module item.
*/
void registerModuleItem(Object plugin, String key, Class<? extends AbstractModuleItem> moduleItem, String category);

/**
* Checks if the specified module item is currently activate.
*
Expand Down
13 changes: 12 additions & 1 deletion src/eu/the5zig/mod/modules/Category.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
*/
public enum Category {

GENERAL, EQUIP, SERVER_GENERAL, SERVER_TIMOLIA, SERVER_GOMMEHD, SERVER_PLAYMINITY, SERVER_BERGWERK, SERVER_HYPIXEL, SERVER_VENICRAFT, SERVER_CYTOOXIEN, SERVER_SIMPLEHG, SYSTEM, OTHER
GENERAL("GENERAL"), EQUIP("EQUIP"), SERVER_GENERAL("SERVER_GENERAL"), SERVER_TIMOLIA("SERVER_TIMOLIA"), SERVER_GOMMEHD("SERVER_GOMMEHD"), SERVER_PLAYMINITY("SERVER_PLAYMINITY"),
SERVER_BERGWERK("SERVER_BERGWERK"), SERVER_HYPIXEL("SERVER_HYPIXEL"), SERVER_VENICRAFT("SERVER_VENICRAFT"), SERVER_CYTOOXIEN("SERVER_CYTOOXIEN"), SERVER_SIMPLEHG("SERVER_SIMPLEHG"),
SYSTEM("SYSTEM"), OTHER("OTHER");

private String name;

Category(String name) {
this.name = name;
}

public String getName() {
return name;
}
}

0 comments on commit b685afe

Please sign in to comment.