Add custom data accessibility to disguise for other plugins to easily manage disguises

This commit is contained in:
libraryaddict
2020-04-07 14:40:38 +12:00
parent 33b5b77207
commit 2c5301eb6c
2 changed files with 17 additions and 1 deletions

View File

@@ -80,11 +80,27 @@ public abstract class Disguise {
* If set, how long before disguise expires
*/
private long disguiseExpires;
@Getter
/**
* For when plugins may want to assign custom data to a disguise, such as who owns it
*/ private final HashMap<String, Object> customData = new HashMap<>();
public Disguise(DisguiseType disguiseType) {
this.disguiseType = disguiseType;
}
public void addCustomData(String key, Object data) {
customData.put(key, data);
}
public boolean hasCustomData(String key) {
return customData.containsKey(key);
}
public Object getCustomData(String key) {
return customData.get(key);
}
@Override
public abstract Disguise clone();