Class ReferencesFinder
java.lang.Object
net.mcreator.workspace.references.ReferencesFinder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
anyValueMatches
(Object source, Class<T> clazz, Predicate<AccessibleObject> validIf, BiPredicate<AccessibleObject, T> condition) Checks if values acquired from any valid fields or methods meet the specified condition.static Set
<ModElement> searchAnimationUsages
(Workspace workspace, Animation animation) static Set
<ModElement> searchGlobalVariableUsages
(Workspace workspace, String variableName) static Set
<ModElement> searchLocalizationKeyUsages
(Workspace workspace, String localizationKey) static Set
<ModElement> searchModElementUsages
(Workspace workspace, ModElement element) static Set
<ModElement> searchModelUsages
(Workspace workspace, Model model) static Set
<ModElement> searchSoundUsages
(Workspace workspace, SoundElement sound) static Set
<ModElement> searchStructureUsages
(Workspace workspace, String structure) static Set
<ModElement> searchTextureUsages
(Workspace workspace, File texture, TextureType type)
-
Constructor Details
-
ReferencesFinder
public ReferencesFinder()
-
-
Method Details
-
searchModElementUsages
-
searchTextureUsages
public static Set<ModElement> searchTextureUsages(Workspace workspace, File texture, TextureType type) -
searchModelUsages
-
searchAnimationUsages
-
searchSoundUsages
-
searchStructureUsages
-
searchGlobalVariableUsages
-
searchLocalizationKeyUsages
public static Set<ModElement> searchLocalizationKeyUsages(Workspace workspace, String localizationKey) -
anyValueMatches
public static <T> boolean anyValueMatches(@Nullable Object source, Class<T> clazz, Predicate<AccessibleObject> validIf, BiPredicate<AccessibleObject, T> condition) Checks if values acquired from any valid fields or methods meet the specified condition.- Type Parameters:
T
- The type of values to be checked.- Parameters:
source
- The object to extract values from.clazz
- The class of values to be checked.validIf
- The predicate used to check if a field/method is considered valid.condition
- The predicate defining the condition that the acquired values should pass.- Returns:
- Whether any value extracted from valid fields/methods on the
source
object pass the condition.
-