Write soft targets to the refmap and remap them at runtime

This commit is contained in:
Mumfrey committed 2016-01-21 12:38:35 +00:00
1 parent a5e797faed
commit ebdaf69e29
6 files changed
+48 -5

No files matched your search

@@ -60,7 +60,7 @@ public abstract class MixinBootstrap {
/**
* Subsystem version
*/
public static final String VERSION = "0.4.14";
public static final String VERSION = "0.4.15";
/**
* Blackboard key where the subsystem version will be stored to indicate
@@ -487,6 +487,14 @@ class MixinConfig implements Comparable<MixinConfig>, IMixinConfig {
return this.refMapper;
}
String remapClassName(String className, String reference) {
// String remapped = this.plugin != null ? this.plugin.remap(className, reference) : null;
// if (remapped != null) {
// return remapped;
// }
return this.getReferenceMapper().remap(className, reference);
}
/* (non-Javadoc)
* @see org.spongepowered.asm.mixin.transformer.IMixinConfig#getPlugin()
*/
@@ -626,4 +634,5 @@ class MixinConfig implements Comparable<MixinConfig>, IMixinConfig {
throw new IllegalArgumentException(String.format("The specified configuration file '%s' was invalid or could not be read", configFile));
}
}
}
@@ -327,7 +327,12 @@ class MixinInfo extends TreeInfo implements Comparable<MixinInfo>, IMixinInfo {
}
if (privateTargets != null) {
this.readTargets(targets, privateTargets, suppressPlugin, true);
this.readTargets(targets, Lists.transform(privateTargets, new Function<String, String>() {
@Override
public String apply(String input) {
return MixinInfo.this.getParent().remapClassName(MixinInfo.this.getClassRef(), input);
}
}), suppressPlugin, true);
}
return targets;