mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-21 08:02:13 +00:00
Disable already-loaded check during hotswap reload, fixes #136
This commit is contained in:
1 parent
15709d089b
commit
065b0281f1
1 file changed
+5
-1
@@ -738,7 +738,7 @@ class MixinInfo extends TreeInfo implements Comparable<MixinInfo>, IMixinInfo {
|
||||
private void readTargets(Collection<ClassInfo> outTargets, Collection<String> inTargets, boolean suppressPlugin, boolean checkPublic) {
|
||||
for (String targetRef : inTargets) {
|
||||
String targetName = targetRef.replace('/', '.');
|
||||
if (MixinInfo.classLoaderUtil.isClassLoaded(targetName)) {
|
||||
if (MixinInfo.classLoaderUtil.isClassLoaded(targetName) && !this.isReloading()) {
|
||||
String message = String.format("Critical problem: %s target %s was already transformed.", this, targetName);
|
||||
if (this.parent.isRequired()) {
|
||||
throw new MixinTargetAlreadyLoadedException(this, message, targetName);
|
||||
@@ -796,6 +796,10 @@ class MixinInfo extends TreeInfo implements Comparable<MixinInfo>, IMixinInfo {
|
||||
Integer priority = ASMHelper.getAnnotationValue(mixin, "priority");
|
||||
return priority == null ? this.parent.getDefaultMixinPriority() : priority.intValue();
|
||||
}
|
||||
|
||||
private boolean isReloading() {
|
||||
return this.pendingState instanceof Reloaded;
|
||||
}
|
||||
|
||||
/**
|
||||
* Current state, either the validated state or the uninitialised state if
|
||||
|
||||
Reference in new issue
Block a user