From ea43102fd8f642ae94972412f25625532387ff8a Mon Sep 17 00:00:00 2001 From: Cat Core Date: Wed, 17 Apr 2024 20:06:11 +0200 Subject: [PATCH] Update CodeChickenCore compat --- .../mixin/codechickencore/ClassMappingMixin.java | 2 +- .../mixin/codechickencore/FieldMappingMixin.java | 10 +++++----- .../mixin/codechickencore/MethodMappingMixin.java | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/ClassMappingMixin.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/ClassMappingMixin.java index 99d0ca35..8dcdcd6f 100644 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/ClassMappingMixin.java +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/ClassMappingMixin.java @@ -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); } } } diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/FieldMappingMixin.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/FieldMappingMixin.java index 02aa27b3..b277c3c2 100644 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/FieldMappingMixin.java +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/FieldMappingMixin.java @@ -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; @@ -20,10 +20,10 @@ public class FieldMappingMixin { @Inject(method = "", 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 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; } } diff --git a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/MethodMappingMixin.java b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/MethodMappingMixin.java index a63f46d2..43d24a88 100644 --- a/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/MethodMappingMixin.java +++ b/mod-compat/src/main/java/fr/catcore/fabricatedforge/compat/mixin/codechickencore/MethodMappingMixin.java @@ -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; @@ -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 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; } } }