diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/CustomDisguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/CustomDisguise.java index 4a7f3a2f..e1cab913 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/CustomDisguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/CustomDisguise.java @@ -3,6 +3,7 @@ package me.libraryaddict.disguise.disguisetypes; import lombok.Getter; import me.libraryaddict.disguise.disguisetypes.watchers.CustomWatcher; import me.libraryaddict.disguise.utilities.modded.CustomEntity; +import me.libraryaddict.disguise.utilities.modded.ModdedManager; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -15,6 +16,10 @@ public class CustomDisguise extends TargetedDisguise { @Getter private CustomEntity customEntity; + public CustomDisguise(String moddedEntityName) { + this(ModdedManager.getCustomEntity(moddedEntityName)); + } + public CustomDisguise(CustomEntity customEntity) { super(customEntity.isLiving() ? DisguiseType.CUSTOM_LIVING : DisguiseType.CUSTOM_MISC); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/modded/ModdedManager.java b/src/main/java/me/libraryaddict/disguise/utilities/modded/ModdedManager.java index e594526e..1301553c 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/modded/ModdedManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/modded/ModdedManager.java @@ -99,7 +99,8 @@ public class ModdedManager implements PluginMessageListener { public static CustomEntity getCustomEntity(String name) { for (CustomEntity entity : entities.values()) { - if (!entity.getName().equalsIgnoreCase(name)) { + if (!name.contains(":") ? entity.getName().split(":")[1].equalsIgnoreCase(name) : + !entity.getName().equalsIgnoreCase(name)) { continue; }