Reverse order of disguise parsing methods

This commit is contained in:
libraryaddict 2020-06-13 17:27:39 +12:00
parent 929f705d0e
commit e696ee3f4f
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -138,7 +138,11 @@ public class DisguiseParser {
stringBuilder.append(" ").append(DisguiseUtilities.quote(((PlayerDisguise) disguise).getName()));
}
for (Method m : ParamInfoManager.getDisguiseWatcherMethods(disguise.getType().getWatcherClass())) {
Method[] methods = ParamInfoManager.getDisguiseWatcherMethods(disguise.getType().getWatcherClass());
for (int i = methods.length - 1; i >= 0; i--) {
Method m = methods[i];
// Special handling for this method
if (m.getName().equals("addPotionEffect")) {
PotionEffectType[] types = (PotionEffectType[]) m.getDeclaringClass().getMethod("getPotionEffects")