Skip to content

Commit

Permalink
Switch up injectors a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 18, 2024
1 parent eb09d1f commit 9aa3da1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Block> 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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Block> 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;
}
}

Expand Down

0 comments on commit 9aa3da1

Please sign in to comment.