mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-09-11 01:38:07 +02:00
Specifically handle StackOverflowError and add in missing checks for premium/config
This commit is contained in:
parent
b817aebc02
commit
940e3aab86
@ -103,11 +103,18 @@ public class DisguiseUtilities {
|
||||
}
|
||||
|
||||
public static void saveDisguises() {
|
||||
if (!LibsPremium.isPremium())
|
||||
return;
|
||||
|
||||
for (HashSet<TargetedDisguise> list : disguisesInUse.values()) {
|
||||
for (TargetedDisguise disg : list) {
|
||||
if (disg.getEntity() == null)
|
||||
continue;
|
||||
|
||||
if (disg.getEntity() instanceof Player ? DisguiseConfig.isSavePlayerDisguises() :
|
||||
DisguiseConfig.isSaveEntityDisguises())
|
||||
continue;
|
||||
|
||||
saveDisguises(disg.getEntity().getUniqueId(), list.toArray(new Disguise[0]));
|
||||
break;
|
||||
}
|
||||
@ -188,7 +195,7 @@ public class DisguiseUtilities {
|
||||
savedDisguiseList.add(owningEntity);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
catch (StackOverflowError | Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -327,8 +334,8 @@ public class DisguiseUtilities {
|
||||
|
||||
cachedNames.add(string.toLowerCase());
|
||||
}
|
||||
catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
catch (StackOverflowError | Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user