Add deadmau5 ears ability, it'll default to black tho. Also obfuscate 2 files
This commit is contained in:
@@ -5,8 +5,10 @@ import me.libraryaddict.disguise.DisguiseConfig;
|
||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||
import me.libraryaddict.disguise.disguisetypes.DisguiseType;
|
||||
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
|
||||
import me.libraryaddict.disguise.disguisetypes.PlayerDisguise;
|
||||
import me.libraryaddict.disguise.disguisetypes.watchers.FallingBlockWatcher;
|
||||
import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher;
|
||||
import me.libraryaddict.disguise.disguisetypes.watchers.PlayerWatcher;
|
||||
import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoItemBlock;
|
||||
import me.libraryaddict.disguise.utilities.params.types.custom.ParamInfoSoundGroup;
|
||||
import me.libraryaddict.disguise.utilities.parser.DisguisePerm;
|
||||
@@ -80,8 +82,9 @@ public class ParamInfoManager {
|
||||
|
||||
public static ParamInfo getParamInfo(DisguiseType disguiseType, String methodName) {
|
||||
for (Method method : getDisguiseWatcherMethods(disguiseType.getWatcherClass())) {
|
||||
if (!method.getName().toLowerCase(Locale.ENGLISH).equals(methodName.toLowerCase(Locale.ENGLISH)))
|
||||
if (!method.getName().toLowerCase(Locale.ENGLISH).equals(methodName.toLowerCase(Locale.ENGLISH))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return getParamInfo(method);
|
||||
}
|
||||
@@ -93,14 +96,17 @@ public class ParamInfoManager {
|
||||
ParamInfoTypes infoTypes = new ParamInfoTypes();
|
||||
paramList = infoTypes.getParamInfos();
|
||||
paramInfoItemBlock = infoTypes.getParamInfoBlock();
|
||||
paramInfoSoundGroup = (ParamInfoSoundGroup) paramList.stream().filter(p -> p instanceof ParamInfoSoundGroup)
|
||||
.findAny().orElse(null);
|
||||
paramInfoSoundGroup =
|
||||
(ParamInfoSoundGroup) paramList.stream().filter(p -> p instanceof ParamInfoSoundGroup).findAny()
|
||||
.orElse(null);
|
||||
disguiseMethods = new DisguiseMethods();
|
||||
|
||||
//paramList.sort((o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName()));
|
||||
}
|
||||
|
||||
public static Method[] getDisguiseWatcherMethods(@Nullable Class<? extends FlagWatcher> watcherClass) {
|
||||
public static Method[] getDisguiseWatcherMethods(
|
||||
@Nullable
|
||||
Class<? extends FlagWatcher> watcherClass) {
|
||||
if (watcherClass == null) {
|
||||
return new Method[0];
|
||||
}
|
||||
@@ -124,9 +130,10 @@ public class ParamInfoManager {
|
||||
for (String methodName : new String[]{"setSelfDisguiseVisible", "setHideHeldItemFromSelf",
|
||||
"setHideArmorFromSelf", "setHearSelfDisguise", "setHidePlayer", "setExpires", "setNotifyBar",
|
||||
"setBossBarColor", "setBossBarStyle", "setTallDisguisesVisible", "setDynamicName", "setSoundGroup",
|
||||
"setDisguiseName"}) {
|
||||
"setDisguiseName", "setDeadmau5Ears"}) {
|
||||
try {
|
||||
Class cl = boolean.class;
|
||||
Class disguiseClass = Disguise.class;
|
||||
|
||||
switch (methodName) {
|
||||
case "setExpires":
|
||||
@@ -145,13 +152,19 @@ public class ParamInfoManager {
|
||||
case "setDisguiseName":
|
||||
cl = String.class;
|
||||
break;
|
||||
case "setDeadmau5Ears":
|
||||
if (watcherClass != PlayerWatcher.class) {
|
||||
continue;
|
||||
}
|
||||
|
||||
disguiseClass = PlayerDisguise.class;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
methods.add(Disguise.class.getMethod(methodName, cl));
|
||||
}
|
||||
catch (Exception ex) {
|
||||
methods.add(disguiseClass.getMethod(methodName, cl));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user