Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Commit 1a0c906

Browse files
committed
idk, I barely tested this.
1 parent cc77eec commit 1a0c906

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
* Fixed a bug that allowed parent and child minecars to be double-linked.
66
* Fixed `getOtherEntities` in `adjustMovementForCollisions` being called for every entity instead of just minecarts.
77
* Every method in the `LinkableMinecart` interface is now `default`.
8-
* `linkart$getLinkItem` should no longer return `null`.
8+
* `linkart$getLinkItem` should no longer return `null`.
9+
* Added an experimental option to change distance between carts. `distance` in the config.

src/main/java/com/github/vini2003/linkart/configuration/LinkartConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public class LinkartConfiguration {
44
public int pathfindingDistance = 6;
55
public float velocityMultiplier = 1F;
66
public int collisionDepth = 8;
7+
public double distance = 1.2d;
78
public boolean chunkloading = false;
89
public int chunkloadingRadius = 3;
910
}

src/main/java/com/github/vini2003/linkart/mixin/AbstractMinecartEntityMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public AbstractMinecartEntityMixin(EntityType<?> type, World world) {
4646
if (linkart$getFollowing() != null) {
4747
Vec3d pos = getPos();
4848
Vec3d pos2 = linkart$getFollowing().getPos();
49-
double dist = Math.abs(pos.distanceTo(pos2)) - 1.2;
49+
double dist = Math.max(Math.abs(pos.distanceTo(pos2)) - Linkart.CONFIG.distance, 0);
5050
Vec3d vec3d = pos.relativize(pos2);
5151
vec3d = vec3d.multiply(Linkart.CONFIG.velocityMultiplier);
5252

@@ -62,7 +62,7 @@ public AbstractMinecartEntityMixin(EntityType<?> type, World world) {
6262

6363
if (differentDirection) {
6464
// Keep ourselves going at same speed if on curve
65-
dist += 1.2;
65+
dist += Linkart.CONFIG.distance;
6666
vec3d = vel;
6767
}
6868

0 commit comments

Comments
 (0)