This commit is contained in:
parent
1b0a3eba96
commit
1e7a3f5718
2 changed files with 12 additions and 1 deletions
|
@ -340,7 +340,7 @@ public abstract class Feature extends ToggleButton implements SetCommand {
|
|||
|
||||
public boolean canExist() {
|
||||
for (Class<? extends Feature> feature : required) {
|
||||
if(!Features.isFeaturePresent(feature)) {
|
||||
if(!Features.willFeatureExist(feature)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,17 @@ public class Features {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean willFeatureExist(Class<? extends Feature> clazz) {
|
||||
for (Feature feature : Setup.get().Features) {
|
||||
if(feature.getClass() == clazz) {
|
||||
if(feature.canExist()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isFeaturePresent(Class<? extends Feature> clazz) {
|
||||
Feature f = getFeature(clazz);
|
||||
//noinspection ConstantValue
|
||||
|
|
Loading…
Add table
Reference in a new issue