Change getCustomDisguise in DisguiseAPI to getRawCustomDisguise, add getCustomDisguise to DisguiseAPI which returns Disguise

This commit is contained in:
libraryaddict 2019-05-18 18:07:54 +12:00
parent 7c33086ece
commit 7fbae2b342

View File

@ -26,7 +26,7 @@ import java.util.Map;
public class DisguiseAPI { public class DisguiseAPI {
private static int selfDisguiseId = ReflectionManager.getNewEntityId(true); private static int selfDisguiseId = ReflectionManager.getNewEntityId(true);
public static String getCustomDisguise(String disguiseName) { public static String getRawCustomDisguise(String disguiseName) {
Map.Entry<DisguisePerm, String> entry = DisguiseConfig.getRawCustomDisguise(disguiseName); Map.Entry<DisguisePerm, String> entry = DisguiseConfig.getRawCustomDisguise(disguiseName);
if (entry == null) if (entry == null)
@ -35,6 +35,16 @@ public class DisguiseAPI {
return entry.getValue(); return entry.getValue();
} }
public static Disguise getCustomDisguise(String disguiseName) {
Map.Entry<DisguisePerm, Disguise> disguise = DisguiseConfig.getCustomDisguise(disguiseName);
if (disguise == null) {
return null;
}
return disguise.getValue();
}
public static Disguise constructDisguise(Entity entity) { public static Disguise constructDisguise(Entity entity) {
return constructDisguise(entity, true, true, true); return constructDisguise(entity, true, true, true);
} }