diff --git a/src/main/java/net/fabricmc/tinyremapper/extension/mixin/common/data/Annotation.java b/src/main/java/net/fabricmc/tinyremapper/extension/mixin/common/data/Annotation.java index 43598dc9..e5a5930b 100644 --- a/src/main/java/net/fabricmc/tinyremapper/extension/mixin/common/data/Annotation.java +++ b/src/main/java/net/fabricmc/tinyremapper/extension/mixin/common/data/Annotation.java @@ -69,4 +69,5 @@ public final class Annotation { public static final String MIXIN_EXTRAS_MODIFY_RETURN_VALUE = "Lcom/llamalad7/mixinextras/injector/ModifyReturnValue;"; public static final String MIXIN_EXTRAS_WRAP_OPERATION = "Lcom/llamalad7/mixinextras/injector/wrapoperation/WrapOperation;"; public static final String MIXIN_EXTRAS_WRAP_WITH_CONDITION = "Lcom/llamalad7/mixinextras/injector/WrapWithCondition;"; + public static final String MIXIN_EXTRAS_WRAP_WITH_CONDITION_V2 = "Lcom/llamalad7/mixinextras/injector/v2/WrapWithCondition;"; } diff --git a/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/SoftTargetMixinMethodVisitor.java b/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/SoftTargetMixinMethodVisitor.java index c5fe9151..f97a9f4a 100644 --- a/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/SoftTargetMixinMethodVisitor.java +++ b/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/SoftTargetMixinMethodVisitor.java @@ -41,6 +41,7 @@ import net.fabricmc.tinyremapper.extension.mixin.soft.annotation.injection.RedirectAnnotationVisitor; import net.fabricmc.tinyremapper.extension.mixin.soft.annotation.injection.WrapOperationAnnotationVisitor; import net.fabricmc.tinyremapper.extension.mixin.soft.annotation.injection.WrapWithConditionAnnotationVisitor; +import net.fabricmc.tinyremapper.extension.mixin.soft.annotation.injection.WrapWithConditionV2AnnotationVisitor; class SoftTargetMixinMethodVisitor extends MethodVisitor { private final CommonData data; @@ -88,6 +89,8 @@ public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { av = new WrapOperationAnnotationVisitor(data, av, remap, targets); } else if (Annotation.MIXIN_EXTRAS_WRAP_WITH_CONDITION.equals(descriptor)) { av = new WrapWithConditionAnnotationVisitor(data, av, remap, targets); + } else if (Annotation.MIXIN_EXTRAS_WRAP_WITH_CONDITION_V2.equals(descriptor)) { + av = new WrapWithConditionV2AnnotationVisitor(data, av, remap, targets); } return av; diff --git a/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/annotation/injection/WrapWithConditionV2AnnotationVisitor.java b/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/annotation/injection/WrapWithConditionV2AnnotationVisitor.java new file mode 100644 index 00000000..efc9fc1c --- /dev/null +++ b/src/main/java/net/fabricmc/tinyremapper/extension/mixin/soft/annotation/injection/WrapWithConditionV2AnnotationVisitor.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2016, 2018, Player, asie + * Copyright (c) 2023, FabricMC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package net.fabricmc.tinyremapper.extension.mixin.soft.annotation.injection; + +import java.util.List; + +import org.objectweb.asm.AnnotationVisitor; + +import net.fabricmc.tinyremapper.extension.mixin.common.data.Annotation; +import net.fabricmc.tinyremapper.extension.mixin.common.data.CommonData; + +public class WrapWithConditionV2AnnotationVisitor extends CommonInjectionAnnotationVisitor { + public WrapWithConditionV2AnnotationVisitor(CommonData data, AnnotationVisitor delegate, boolean remap, List targets) { + super(Annotation.MIXIN_EXTRAS_WRAP_WITH_CONDITION_V2, data, delegate, remap, targets); + } +}