Package com.avrix.utils
Class PatchUtils
java.lang.Object
com.avrix.utils.PatchUtils
Manager for making modifications to game files.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Applying default patches to game files.static void
applyPluginPatches
(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
- PluginMetadata
classLoader
- TheClassLoader
to 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.patches
package 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.
-