mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-21 05:42:15 +00:00
Further AP refactor, support injectors and shadows in multitarget mixins
This commit is contained in:
1 parent
8d87440faf
commit
ea44243240
17 files changed
+587
-144
No files matched your search
@@ -45,6 +45,30 @@ import org.spongepowered.tools.obfuscation.interfaces.IReferenceManager;
|
||||
*/
|
||||
public class ReferenceManager implements IReferenceManager {
|
||||
|
||||
/**
|
||||
* Exception thrown when a reference conflict occurs
|
||||
*/
|
||||
public static class ReferenceConflictException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final String oldReference, newReference;
|
||||
|
||||
public ReferenceConflictException(String oldReference, String newReference) {
|
||||
this.oldReference = oldReference;
|
||||
this.newReference = newReference;
|
||||
}
|
||||
|
||||
public String getOld() {
|
||||
return this.oldReference;
|
||||
}
|
||||
|
||||
public String getNew() {
|
||||
return this.newReference;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Annotation processor
|
||||
*/
|
||||
@@ -189,7 +213,11 @@ public class ReferenceManager implements IReferenceManager {
|
||||
}
|
||||
|
||||
protected void addMapping(ObfuscationType type, String className, String reference, String newReference) {
|
||||
this.refMapper.addMapping(type.getKey(), className, reference, newReference);
|
||||
String oldReference = this.refMapper.addMapping(type.getKey(), className, reference, newReference);
|
||||
if (oldReference != null && !oldReference.equals(newReference)) {
|
||||
throw new ReferenceConflictException(oldReference, newReference);
|
||||
}
|
||||
|
||||
if (type.isDefault()) {
|
||||
this.refMapper.addMapping(null, className, reference, newReference);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user