fix javadoc

This commit is contained in:
grimmauld 2021-05-20 08:39:22 +02:00
parent 5ea7dc6f03
commit ad37c5d949

View file

@ -12,19 +12,23 @@ public enum Mods {
DYNAMICTREES; DYNAMICTREES;
/** /**
* @return a boolean of whether the mod is loaded or not * @return a boolean of whether the mod is loaded or not based on mod id
*/ */
public boolean isLoaded() { public boolean isLoaded() {
return ModList.get().isLoaded(asId()); return ModList.get().isLoaded(asId());
} }
/**
* @return the mod id
*/
public String asId() { public String asId() {
return name().toLowerCase(); return name().toLowerCase();
} }
/** /**
* Simple hook to run code if a mod is installed * Simple hook to run code if a mod is installed
* @param toRun will be run if the mod is loaded * @param toRun will be run only if the mod is loaded
* @return Optional.empty() if the mod is not loaded, otherwise an Optional of the return value of the given supplier
*/ */
public <T> Optional<T> runIfInstalled(Supplier<Supplier<T>> toRun) { public <T> Optional<T> runIfInstalled(Supplier<Supplier<T>> toRun) {
if (isLoaded()) if (isLoaded())