MCPcopy Create free account
hub / github.com/Teneted/Tenet / filter

Method filter

src/main/java/net/minecraftforge/fml/OptionalMod.java:119–125  ·  view source on GitHub ↗

If a mod object is present, and the mod object matches the given predicate, return an OptionalMod describing the value, otherwise return an empty OptionalMod. @param predicate a predicate to apply to the mod object, if present @return an OptionalMod describing the value of t

(Predicate<? super T> predicate)

Source from the content-addressed store, hash-verified

117 * @throws NullPointerException if the predicate is null
118 */
119 public OptionalMod<T> filter(Predicate<? super T> predicate) {
120 Objects.requireNonNull(predicate);
121 if (!isPresent())
122 return this;
123 else
124 return predicate.test(getValue()) ? this : empty();
125 }
126
127 /**
128 * If a mod object is present, apply the provided mapping function to it,

Callers 15

getLoadedChunksMethod · 0.45
SimpleHelpMapMethod · 0.45
initializeCommandsMethod · 0.45
getRegistryMethod · 0.45
findObjectHoldersMethod · 0.45
GameDataClass · 0.45
injectSnapshotMethod · 0.45
tryPlaceFluidMethod · 0.45
executeMethod · 0.45

Calls 4

isPresentMethod · 0.95
getValueMethod · 0.95
emptyMethod · 0.95
testMethod · 0.65

Tested by

no test coverage detected