2021-12-25 17:05:07 +00:00
|
|
|
package com.alttd.boosters.managers;
|
|
|
|
|
|
|
|
|
|
import com.alttd.boosterapi.Booster;
|
|
|
|
|
import com.alttd.boosterapi.BoosterType;
|
2022-08-23 22:29:23 +00:00
|
|
|
import com.alttd.boosterapi.config.BoosterStorage;
|
|
|
|
|
import com.alttd.boosters.storage.ServerBoosterStorage;
|
2021-12-25 17:05:07 +00:00
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class BoosterManager {
|
|
|
|
|
|
|
|
|
|
public boolean isBoosted(BoosterType type) {
|
2022-08-23 22:29:23 +00:00
|
|
|
for (Booster b : ServerBoosterStorage.getServerBoosterStorage().getBoosters().values()) {
|
2021-12-25 17:05:07 +00:00
|
|
|
if (b.getType() == type && b.isActive()) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-26 14:12:13 +00:00
|
|
|
public Booster getBooster(BoosterType type) {
|
2022-08-23 22:29:23 +00:00
|
|
|
for (Booster b : ServerBoosterStorage.getServerBoosterStorage().getBoosters().values()) {
|
2021-12-25 17:05:07 +00:00
|
|
|
if (b.getType() == type && b.isActive()) {
|
|
|
|
|
return b;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|