Use another method to get entity classes, due to inferior jar system someone is using

This commit is contained in:
libraryaddict
2020-02-23 11:30:56 +13:00
parent 538346a40b
commit f52d0fa17d
2 changed files with 27 additions and 13 deletions

View File

@@ -33,9 +33,16 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
public DisguiseRadiusCommand(int maxRadius) {
this.maxRadius = maxRadius;
for (Class c : ClassGetter.getClassesForPackage("org.bukkit.entity")) {
if (c != Entity.class && Entity.class.isAssignableFrom(c) && c.getAnnotation(Deprecated.class) == null) {
validClasses.add(Entity.class);
for (EntityType type : EntityType.values()) {
Class c = type.getEntityClass();
while (!validClasses.contains(c)) {
validClasses.add(c);
c = c.getSuperclass();
}
}
}