Skip to content

Commit

Permalink
add track-targeting block placing distance configuring
Browse files Browse the repository at this point in the history
resolves #20
  • Loading branch information
rhysdh540 committed Feb 12, 2024
1 parent 16a1f05 commit 5d88a94
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dev.rdh.createunlimited.mixin;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import dev.rdh.createunlimited.Util;
import dev.rdh.createunlimited.config.CUConfigs;

import com.simibubi.create.content.trains.track.TrackTargetingBlockItem;

@Mixin(TrackTargetingBlockItem.class)
public class TrackTargetingBlockItemMixin {
@ModifyExpressionValue(method = "useOn", at = {
@At(value = "CONSTANT", args = "doubleValue=80.0"),
@At(value = "CONSTANT", args = "doubleValue=16.0"),
})
private double modifyMaxDistance(double original) {
return Util.orElse(CUConfigs.server.maxTrackBlockPlacingDistance, original);
}
}
1 change: 1 addition & 0 deletions common/src/main/resources/createunlimited.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"SuperGlueSelectionPacketMixin",
"TrackEdgeMixin",
"TrackPlacementMixin",
"TrackTargetingBlockItemMixin",
"TrainMixin",
"accessor.CValueAccessor",
"accessor.PlacementInfoAccessor"
Expand Down

0 comments on commit 5d88a94

Please sign in to comment.