diff --git a/src/main/java/ca/spottedleaf/moonrise/mixin/blockstate_propertyaccess/BooleanPropertyMixin.java b/src/main/java/ca/spottedleaf/moonrise/mixin/blockstate_propertyaccess/BooleanPropertyMixin.java index 2a74c8ee..baafd6a9 100644 --- a/src/main/java/ca/spottedleaf/moonrise/mixin/blockstate_propertyaccess/BooleanPropertyMixin.java +++ b/src/main/java/ca/spottedleaf/moonrise/mixin/blockstate_propertyaccess/BooleanPropertyMixin.java @@ -1,11 +1,12 @@ package ca.spottedleaf.moonrise.mixin.blockstate_propertyaccess; import ca.spottedleaf.moonrise.patches.blockstate_propertyaccess.PropertyAccess; +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.Property; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.Constant; @Mixin(BooleanProperty.class) abstract class BooleanPropertyMixin extends Property implements PropertyAccess { @@ -19,35 +20,16 @@ protected BooleanPropertyMixin(String string, Class class_) { * @reason Properties are identity comparable * @author Spottedleaf */ - /* - TODO: idk why this isn't working, we'll just redirect the super call for now and deal with the useless instanceof op @WrapOperation( method = "equals", - at = @At( - value = "CONSTANT", - opcode = Opcodes.INSTANCEOF, - args = "classValue=net/minecraft/world/level/block/state/properties/BooleanProperty" + constant = @Constant( + classValue = BooleanProperty.class, + ordinal = 0 ) ) private boolean skipFurtherComparison(final Object obj, final Operation orig) { return false; } - */ - - /** - * @reason Properties are identity comparable - * @author Spottedleaf - */ - @Redirect( - method = "equals", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/world/level/block/state/properties/Property;equals(Ljava/lang/Object;)Z" - ) - ) - private boolean skipSuperCheck(final Property instance, final Object object) { - return false; - } @Override public final boolean moonrise$requiresDefaultImpl() {