From 3a772453533e8ed081664bf97192ffb3802424ed Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 23 Feb 2020 14:00:22 +1300 Subject: [PATCH] Why are the entity classes null so much --- .../disguise/commands/DisguiseRadiusCommand.java | 8 +------- .../disguise/utilities/translations/TranslateFiller.java | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/commands/DisguiseRadiusCommand.java b/src/main/java/me/libraryaddict/disguise/commands/DisguiseRadiusCommand.java index 57313ee2..6fa82a16 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/DisguiseRadiusCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/DisguiseRadiusCommand.java @@ -34,16 +34,10 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom public DisguiseRadiusCommand(int maxRadius) { this.maxRadius = maxRadius; - validClasses.add(Entity.class); - for (EntityType type : EntityType.values()) { Class c = type.getEntityClass(); - if (c == null) { - continue; - } - - while (Entity.class.isAssignableFrom(c) && !validClasses.contains(c) && c != Entity.class) { + while (c != null && Entity.class.isAssignableFrom(c) && !validClasses.contains(c)) { validClasses.add(c); c = c.getSuperclass(); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateFiller.java b/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateFiller.java index ed8d8f14..f2611747 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateFiller.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateFiller.java @@ -88,11 +88,7 @@ public class TranslateFiller { for (EntityType type : EntityType.values()) { Class c = type.getEntityClass(); - if (c == null) { - continue; - } - - while (Entity.class.isAssignableFrom(c) && !validClasses.contains(c) && c != Entity.class) { + while (c != null && Entity.class.isAssignableFrom(c) && !validClasses.contains(c)) { validClasses.add(c); c = c.getSuperclass();