diff --git a/src/fr/neatmonster/nocheatplus/players/DataManager.java b/src/fr/neatmonster/nocheatplus/players/DataManager.java index b15d335f..1e307e48 100644 --- a/src/fr/neatmonster/nocheatplus/players/DataManager.java +++ b/src/fr/neatmonster/nocheatplus/players/DataManager.java @@ -205,27 +205,22 @@ public class DataManager implements Listener, INotifyReload, INeedConfig, ICompo */ public static boolean removeData(final String playerName, CheckType checkType) { if (checkType == null) checkType = CheckType.ALL; - - // Attempt for direct removal. - CheckDataFactory dataFactory = checkType.getDataFactory(); - if (dataFactory != null) return dataFactory.removeData(playerName) != null; - - // Remove all for which it seems necessary. - final Set factories = new HashSet(); - for (CheckType otherType : CheckType.values()){ - if (checkType == CheckType.ALL || APIUtils.isParent(checkType, otherType)){ - final CheckDataFactory otherFactory = otherType.getDataFactory(); - if (otherFactory != null) factories.add(otherFactory); - } - } boolean had = false; - for (final CheckDataFactory otherFactory : factories){ - if (otherFactory.removeData(playerName) != null) had = true; - } // Check extended registered components. if (clearComponentData(checkType, playerName)) had = true; + // Collect factories. + final Set factories = new HashSet(); + for (CheckType otherType : APIUtils.getWithChildren(checkType)){ + final CheckDataFactory otherFactory = otherType.getDataFactory(); + if (otherFactory != null) factories.add(otherFactory); + } + // Remove data. + for (final CheckDataFactory otherFactory : factories){ + if (otherFactory.removeData(playerName) != null) had = true; + } + return had; }