From 7fbae2b342274ff319c44f739e1b44d4059b5584 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 18 May 2019 18:07:54 +1200 Subject: [PATCH] Change getCustomDisguise in DisguiseAPI to getRawCustomDisguise, add getCustomDisguise to DisguiseAPI which returns Disguise --- .../java/me/libraryaddict/disguise/DisguiseAPI.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java b/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java index 3787f88e..d72c29aa 100644 --- a/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java +++ b/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java @@ -26,7 +26,7 @@ import java.util.Map; public class DisguiseAPI { private static int selfDisguiseId = ReflectionManager.getNewEntityId(true); - public static String getCustomDisguise(String disguiseName) { + public static String getRawCustomDisguise(String disguiseName) { Map.Entry entry = DisguiseConfig.getRawCustomDisguise(disguiseName); if (entry == null) @@ -35,6 +35,16 @@ public class DisguiseAPI { return entry.getValue(); } + public static Disguise getCustomDisguise(String disguiseName) { + Map.Entry disguise = DisguiseConfig.getCustomDisguise(disguiseName); + + if (disguise == null) { + return null; + } + + return disguise.getValue(); + } + public static Disguise constructDisguise(Entity entity) { return constructDisguise(entity, true, true, true); }