Modules can set GUI items for compatible overlay plugins

This commit is contained in:
PikaMug 2021-02-17 03:20:48 -05:00
parent 016d87c13f
commit 21839c9284
3 changed files with 27 additions and 0 deletions

View File

@ -33,6 +33,7 @@ public abstract class CustomObjective implements Listener {
private String name = null; private String name = null;
private String author = null; private String author = null;
private String display = "Progress: %count%"; private String display = "Progress: %count%";
private final Map<String, Short> items = new HashMap<String, Short>();
private final LinkedList<Entry<String, Object>> data = new LinkedList<Entry<String, Object>>(); private final LinkedList<Entry<String, Object>> data = new LinkedList<Entry<String, Object>>();
private final Map<String, String> descriptions = new HashMap<String, String>(); private final Map<String, String> descriptions = new HashMap<String, String>();
private String countPrompt = "Enter number"; private String countPrompt = "Enter number";
@ -63,6 +64,14 @@ public abstract class CustomObjective implements Listener {
this.display = display; this.display = display;
} }
public Map<String, Short> getItems() {
return items;
}
public void addItem(final String type, final short durability) {
this.items.put(type, durability);
}
public LinkedList<Entry<String, Object>> getData() { public LinkedList<Entry<String, Object>> getData() {
return data; return data;
} }

View File

@ -22,6 +22,7 @@ public abstract class CustomRequirement {
private String name = null; private String name = null;
private String author = null; private String author = null;
private String display = null; private String display = null;
private final Map<String, Short> items = new HashMap<String, Short>();
private final Map<String, Object> data = new HashMap<String, Object>(); private final Map<String, Object> data = new HashMap<String, Object>();
private final Map<String, String> descriptions = new HashMap<String, String>(); private final Map<String, String> descriptions = new HashMap<String, String>();
@ -51,6 +52,14 @@ public abstract class CustomRequirement {
this.display = display; this.display = display;
} }
public Map<String, Short> getItems() {
return items;
}
public void addItem(final String type, final short durability) {
this.items.put(type, durability);
}
public Map<String, Object> getData() { public Map<String, Object> getData() {
return data; return data;
} }

View File

@ -22,6 +22,7 @@ public abstract class CustomReward {
private String name = null; private String name = null;
private String author = null; private String author = null;
private String display = null; private String display = null;
private final Map<String, Short> items = new HashMap<String, Short>();
private final Map<String, Object> data = new HashMap<String, Object>(); private final Map<String, Object> data = new HashMap<String, Object>();
private final Map<String, String> descriptions = new HashMap<String, String>(); private final Map<String, String> descriptions = new HashMap<String, String>();
@ -51,6 +52,14 @@ public abstract class CustomReward {
this.display = display; this.display = display;
} }
public Map<String, Short> getItems() {
return items;
}
public void addItem(final String type, final short durability) {
this.items.put(type, durability);
}
/** /**
* @deprecated Use {@link #getDisplay()} * @deprecated Use {@link #getDisplay()}
*/ */