Allow string entry to CustomDisguise
This commit is contained in:
		| @@ -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); | ||||
|  | ||||
|   | ||||
| @@ -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; | ||||
|             } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user