Package com.avrix.utils
Class PatchUtils
java.lang.Object
com.avrix.utils.PatchUtils
Manager for making modifications to game files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidApplying default patches to game files.static voidapplyPluginPatches(Metadata metadata, ClassLoader classLoader) Applies a list of patches to classes specified by their fully qualified names.
-
Constructor Details
-
PatchUtils
public PatchUtils()
-
-
Method Details
-
applyPluginPatches
public static void applyPluginPatches(Metadata metadata, ClassLoader classLoader) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException Applies a list of patches to classes specified by their fully qualified names.- Parameters:
metadata- PluginMetadataclassLoader- TheClassLoaderto use for loading the patch classes.- Throws:
ClassNotFoundException- If a specified class cannot be found.NoSuchMethodException- If the no-argument constructor is not found.InvocationTargetException- If the underlying constructor throws an exception.InstantiationException- If the class that declares the underlying constructor represents an abstract class.IllegalAccessException- If the constructor is inaccessible.
-
applyDefaultPatches
Applying default patches to game files. Searches for patches in thecom.avrix.patchespackage as descendants ofClassTransformer, calls class modification methods and applies them at runtime.- Throws:
IOException- if an I/O error occurs when reading the JAR file.URISyntaxException- if a string could not be parsed as a URI reference.
-