Add custom data accessibility to disguise for other plugins to easily manage disguises
This commit is contained in:
		| @@ -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(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user