diff --git a/common/src/main/java/com/railwayteam/railways/mixin/client/MixinBigOutlines.java b/common/src/main/java/com/railwayteam/railways/mixin/client/MixinBigOutlines.java index 4aebb8290..a3f1fe8e6 100644 --- a/common/src/main/java/com/railwayteam/railways/mixin/client/MixinBigOutlines.java +++ b/common/src/main/java/com/railwayteam/railways/mixin/client/MixinBigOutlines.java @@ -18,23 +18,18 @@ package com.railwayteam.railways.mixin.client; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; import com.railwayteam.railways.content.custom_tracks.generic_crossing.GenericCrossingBlock; import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.block.BigOutlines; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.state.BlockState; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @Mixin(BigOutlines.class) public class MixinBigOutlines { - @WrapOperation(method = "lambda$pick$0", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;getBlock()Lnet/minecraft/world/level/block/Block;", ordinal = 0)) - private static Block genericCrossingsAreCustom(BlockState instance, Operation originalOperation) { - Block original = originalOperation.call(instance); - if (original instanceof GenericCrossingBlock) - return AllBlocks.TRACK.get(); - return original; + @ModifyExpressionValue(method = "lambda$pick$0", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;getBlock()Lnet/minecraft/world/level/block/Block;", ordinal = 0)) + private static Block genericCrossingsAreCustom(Block original) { + return original instanceof GenericCrossingBlock ? AllBlocks.TRACK.get() : original; } } diff --git a/common/src/main/java/com/railwayteam/railways/mixin/client/MixinTrackBlockOutline.java b/common/src/main/java/com/railwayteam/railways/mixin/client/MixinTrackBlockOutline.java index c23c48be6..48c080fe4 100644 --- a/common/src/main/java/com/railwayteam/railways/mixin/client/MixinTrackBlockOutline.java +++ b/common/src/main/java/com/railwayteam/railways/mixin/client/MixinTrackBlockOutline.java @@ -19,8 +19,6 @@ package com.railwayteam.railways.mixin.client; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; -import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import com.llamalad7.mixinextras.sugar.Local; import com.railwayteam.railways.content.custom_tracks.generic_crossing.GenericCrossingBlock; import com.railwayteam.railways.content.custom_tracks.monorail.CustomTrackBlockOutline; @@ -105,12 +103,9 @@ private static VoxelShape pickWithCorrectShape(VoxelShape original, @Local Bezie return CustomTrackBlockOutline.convert(o, railways$walkingMaterial); } - @WrapOperation(method = "drawCustomBlockSelection", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;getBlock()Lnet/minecraft/world/level/block/Block;", remap = true)) - private static Block genericCrossingsAreCustom(BlockState instance, Operation originalOperation) { - Block original = originalOperation.call(instance); - if (original instanceof GenericCrossingBlock) - return AllBlocks.TRACK.get(); - return original; + @ModifyExpressionValue(method = "drawCustomBlockSelection", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;getBlock()Lnet/minecraft/world/level/block/Block;", remap = true)) + private static Block genericCrossingsAreCustom(Block original) { + return original instanceof GenericCrossingBlock ? AllBlocks.TRACK.get() : original; } }