Skip to content

Commit

Permalink
Update CodeChickenCore compat
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed Apr 17, 2024
1 parent ea74328 commit ea43102
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private void remapClassName(String classname, CallbackInfo ci) {
if (NEIFixer.FIX_CLASSES.containsKey(classname)) {
this.classname = NEIFixer.FIX_CLASSES.get(classname);
} else if (!this.classname.contains(".")) {
this.classname = Constants.getRemappedClassName(this.classname);
this.classname = Constants.mapClass(this.classname);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import codechicken.core.asm.ObfuscationManager;
import fr.catcore.fabricatedforge.Constants;
import net.fabricmc.tinyremapper.extension.mixin.common.data.Pair;
import io.github.fabriccompatibiltylayers.modremappingapi.api.MappingUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -20,10 +20,10 @@ public class FieldMappingMixin {
@Inject(method = "<init>", at = @At("RETURN"), remap = false)
private void remap(String declaringclass, String fieldname, String type, CallbackInfo ci) {
if (!this.owner.contains(".")) {
this.owner = Constants.getRemappedClassName(this.owner);
this.owner = Constants.mapClass(this.owner);
}
Pair<String, String> pair = Constants.getRemappedFieldName(this.owner, this.name, this.type);
this.name = pair.first();
this.type = pair.second();
MappingUtils.ClassMember pair = Constants.mapFieldFromRemappedClass(this.owner, this.name, this.type);
this.name = pair.name;
this.type = pair.desc;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import codechicken.core.asm.ObfuscationManager;
import fr.catcore.fabricatedforge.Constants;
import fr.catcore.fabricatedforge.compat.nei.NEIFixer;
import net.fabricmc.tinyremapper.extension.mixin.common.data.Pair;
import io.github.fabriccompatibiltylayers.modremappingapi.api.MappingUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
Expand Down Expand Up @@ -34,21 +34,21 @@ private void remap() {
if (NEIFixer.FIX_CLASSES.containsKey(this.owner)) {
this.owner = NEIFixer.FIX_CLASSES.get(this.owner);
} else if (!this.owner.contains(".")) {
this.owner = Constants.getRemappedClassName(this.owner);
this.owner = Constants.mapClass(this.owner);
}

Pair<String, String> pair = Constants.getRemappedMethodName(this.owner, this.name, this.desc);
MappingUtils.ClassMember pair = Constants.mapMethodFromRemappedClass(this.owner, this.name, this.desc);

if (NEIFixer.FIX_METHOD_NAMES.containsKey(this.name)) {
this.name = NEIFixer.FIX_METHOD_NAMES.get(this.name);
} else {
this.name = pair.first();
this.name = pair.name;
}

if (NEIFixer.FIX_METHOD_ARGS.containsKey(this.desc)) {
this.desc = NEIFixer.FIX_METHOD_ARGS.get(this.desc);
} else {
this.desc = pair.second();
this.desc = pair.desc;
}
}
}

0 comments on commit ea43102

Please sign in to comment.