fix @Requires
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m5s

This commit is contained in:
Daniella / Tove 2024-06-18 19:34:59 +02:00
parent 1b0a3eba96
commit 1e7a3f5718
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
2 changed files with 12 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -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