mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-21 20:52:29 +00:00
0.7.10 - Log error when mixin class is subject to classload restrictions
This commit is contained in:
1 parent
ba0c777116
commit
2d410a79df
6 files changed
+64
-5
No files matched your search
@@ -60,7 +60,7 @@ public abstract class MixinBootstrap {
|
||||
/**
|
||||
* Subsystem version
|
||||
*/
|
||||
public static final String VERSION = "0.7.9";
|
||||
public static final String VERSION = "0.7.10";
|
||||
|
||||
/**
|
||||
* Log all the things
|
||||
|
||||
@@ -1158,11 +1158,18 @@ class MixinInfo implements Comparable<MixinInfo>, IMixinInfo {
|
||||
byte[] mixinBytes = null;
|
||||
|
||||
try {
|
||||
if (runTransformers) {
|
||||
String restrictions = this.service.getClassRestrictions(mixinClassName);
|
||||
if (restrictions.length() > 0) {
|
||||
this.logger.error("Classloader restrictions [{}] encountered loading {}, name: {}", restrictions, this, mixinClassName);
|
||||
}
|
||||
}
|
||||
mixinBytes = this.service.getBytecodeProvider().getClassBytes(mixinClassName, runTransformers);
|
||||
|
||||
} catch (ClassNotFoundException ex) {
|
||||
throw new ClassNotFoundException(String.format("The specified mixin '%s' was not found", mixinClassName));
|
||||
} catch (IOException ex) {
|
||||
this.logger.warn("Failed to load mixin %s, the specified mixin will not be applied", mixinClassName);
|
||||
this.logger.warn("Failed to load mixin {}, the specified mixin will not be applied", mixinClassName);
|
||||
throw new InvalidMixinException(this, "An error was encountered whilst loading the mixin class", ex);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,6 +126,16 @@ public interface IMixinService {
|
||||
*/
|
||||
public abstract boolean isClassLoaded(String className);
|
||||
|
||||
/**
|
||||
* Check whether the specified class name is subject to any restrictions in
|
||||
* the context of this service
|
||||
*
|
||||
* @param className class name to check
|
||||
* @return comma-separated list of restrictions, empty string if no
|
||||
* restrictions apply
|
||||
*/
|
||||
public abstract String getClassRestrictions(String className);
|
||||
|
||||
/**
|
||||
* Get currently available transformers in the environment
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user