mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-03 19:06:39 +01:00
fix javadoc
This commit is contained in:
parent
5ea7dc6f03
commit
ad37c5d949
1 changed files with 6 additions and 2 deletions
|
@ -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())
|
||||||
|
|
Loading…
Reference in a new issue