Skip to content

Commit

Permalink
small fixes to pushing and linking distance
Browse files Browse the repository at this point in the history
  • Loading branch information
EternalBlueFlame committed Jan 20, 2025
1 parent 531d50c commit 2bcba3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/train/common/api/EntityRollingStock.java
Original file line number Diff line number Diff line change
Expand Up @@ -2242,7 +2242,7 @@ public boolean hasTwoLinks() {
*/
@Override
public float getLinkageDistance(EntityMinecart cart) {
return this.getOptimalDistance(cart) + 1.4F;
return this.getOptimalDistance(cart);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/train/common/entity/EntityHitbox.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void manageCollision(){
e.attackEntityFrom(new EntityDamageSource(
host instanceof Locomotive ? "Locomotive" : "rollingstock", host),
(float) (Math.abs(host.motionX) + Math.abs(host.motionZ)) * 0.5f);
} else if (Math.abs(host.motionX) + Math.abs(host.motionZ) <0.01) {
} else if (Math.abs(host.motionX) + Math.abs(host.motionZ) <0.05) {
double[] motion = CommonUtil.rotatePoint(0.05, 0,
CommonUtil.atan2degreesf( host.posZ- e.posZ, host.posX-e.posX));
host.addVelocity(motion[0], 0, motion[2]);
Expand Down

0 comments on commit 2bcba3a

Please sign in to comment.