Add modifyDisguise to DisguiseParser for api usage, deprecate 'constructDisguise'
This commit is contained in:
parent
897f0fc599
commit
061161dad7
@ -87,10 +87,12 @@ public class DisguiseAPI {
|
||||
return disguise.getValue();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static Disguise constructDisguise(Entity entity) {
|
||||
return constructDisguise(entity, true, true, true);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static Disguise constructDisguise(Entity entity, boolean doEquipment, boolean doSneak, boolean doSprint) {
|
||||
DisguiseType disguiseType = DisguiseType.getType(entity);
|
||||
Disguise disguise;
|
||||
|
@ -9,6 +9,7 @@ import me.libraryaddict.disguise.utilities.params.ParamInfoManager;
|
||||
import me.libraryaddict.disguise.utilities.reflection.ReflectionManager;
|
||||
import me.libraryaddict.disguise.utilities.translations.LibsMsg;
|
||||
import me.libraryaddict.disguise.utilities.translations.TranslateType;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -508,6 +509,32 @@ public class DisguiseParser {
|
||||
return parseDisguise(sender, null, permNode, args, permissions);
|
||||
}
|
||||
|
||||
public static void modifyDisguise(Disguise disguise, Entity target,
|
||||
String[] params) throws IllegalAccessException, DisguiseParseException, InvocationTargetException {
|
||||
if (target != null) {
|
||||
params = DisguiseParser.parsePlaceholders(params, target, target);
|
||||
}
|
||||
|
||||
DisguiseParser.callMethods(Bukkit.getConsoleSender(), disguise,
|
||||
new DisguisePermissions(Bukkit.getConsoleSender(), "disguise"), new DisguisePerm(disguise.getType()),
|
||||
new ArrayList<>(), params, "Disguise");
|
||||
}
|
||||
|
||||
public static void modifyDisguise(Disguise disguise,
|
||||
String[] params) throws IllegalAccessException, InvocationTargetException, DisguiseParseException {
|
||||
modifyDisguise(disguise, null, params);
|
||||
}
|
||||
|
||||
public static void modifyDisguise(Disguise disguise,
|
||||
String params) throws IllegalAccessException, DisguiseParseException, InvocationTargetException {
|
||||
modifyDisguise(disguise, DisguiseUtilities.split(params));
|
||||
}
|
||||
|
||||
public static void modifyDisguise(Disguise disguise, Entity target,
|
||||
String params) throws IllegalAccessException, InvocationTargetException, DisguiseParseException {
|
||||
modifyDisguise(disguise, target, DisguiseUtilities.split(params));
|
||||
}
|
||||
|
||||
public static Disguise parseDisguise(
|
||||
String disguise) throws IllegalAccessException, InvocationTargetException, DisguiseParseException {
|
||||
return parseDisguise(Bukkit.getConsoleSender(), null, disguise);
|
||||
|
Loading…
Reference in New Issue
Block a user