From 6cf130b7b5390d89f5f83a5804cc9399b93e5376 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 20 Jul 2017 19:23:43 +1200 Subject: [PATCH] Add getCustomDisguise to DisguiseAPI --- src/me/libraryaddict/disguise/DisguiseAPI.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/me/libraryaddict/disguise/DisguiseAPI.java b/src/me/libraryaddict/disguise/DisguiseAPI.java index d633380a..019d70f5 100644 --- a/src/me/libraryaddict/disguise/DisguiseAPI.java +++ b/src/me/libraryaddict/disguise/DisguiseAPI.java @@ -4,6 +4,7 @@ import java.lang.reflect.Method; import java.util.Arrays; import java.util.Collection; import java.util.List; +import java.util.Map; import org.bukkit.DyeColor; import org.bukkit.Material; @@ -34,6 +35,15 @@ import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.ReflectionManager; public class DisguiseAPI { + public static Disguise getCustomDisguise(String disguiseName) { + Map.Entry entry = DisguiseConfig.getCustomDisguise(disguiseName); + + if (entry == null) + return null; + + return entry.getValue(); + } + public static Disguise constructDisguise(Entity entity) { return constructDisguise(entity, true, true, true); }