-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add track-targeting block placing distance configuring
resolves #20
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
common/src/main/java/dev/rdh/createunlimited/mixin/TrackTargetingBlockItemMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters