Why are the entity classes null so much

This commit is contained in:
libraryaddict 2020-02-23 14:00:22 +13:00
parent 2185e3718a
commit 3a77245353
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
2 changed files with 2 additions and 12 deletions

View File

@ -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();

View File

@ -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();