Skip to content

Commit

Permalink
minor improvements, fixes nothing.
Browse files Browse the repository at this point in the history
  • Loading branch information
EternalBlueFlame committed Jan 31, 2025
1 parent 7741752 commit 4dc4fb4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/main/java/train/common/api/EntityBogie.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import cpw.mods.fml.relauncher.SideOnly;
import ebf.tim.entities.EntitySeat;
import ebf.tim.utility.CommonUtil;
import ebf.tim.utility.DebugUtil;
import mods.railcraft.api.carts.IMinecart;
import mods.railcraft.api.carts.IRoutableCart;
import net.minecraft.block.Block;
Expand Down Expand Up @@ -272,7 +273,7 @@ public boolean doesCartMatchFilter(ItemStack stack, EntityMinecart cart) {
@Override
public boolean shouldDoRailFunctions() {

return false;
return true;
}

@Override
Expand Down Expand Up @@ -318,6 +319,7 @@ protected void func_145821_a(int x, int y, int z, double maxSpeed, double slopeA
private void updateOnTrack(int i, int j, int k, Block l) {

if (canUseRail() && BlockRailBase.func_150051_a(l)) {
DebugUtil.println("its track?");
super.onUpdate();
lastTrack=null;
int i1 = ((BlockRailBase) l).getBasicRailMetadata(worldObj, this, i, j, k);
Expand Down Expand Up @@ -358,7 +360,7 @@ private void updateOnTrack(int i, int j, int k, Block l) {
double d13 = Math.sqrt(motionX * motionX + motionZ * motionZ);
motionX = (d13 * d9) / d11;
motionZ = (d13 * d10) / d11;
if (flag1 && !flag && shouldDoRailFunctions()) {
if (flag1 && !flag) {
if (Math.sqrt(motionX * motionX + motionZ * motionZ) < 0.029999999999999999D) {
motionX = 0.0D;
motionY = 0.0D;
Expand Down Expand Up @@ -419,11 +421,9 @@ else if (ai[1][1] != 0 && MathHelper.floor_double(posX) - i == ai[1][0] &&
motionZ = d15 * (l1 - k);
}

if (shouldDoRailFunctions()) {
((BlockRailBase) l).onMinecartPass(worldObj, this, i, j, k);
}
((BlockRailBase) l).onMinecartPass(worldObj, this, i, j, k);

if (flag && shouldDoRailFunctions()) {
if (flag) {
double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d31 > 0.01D) {
motionX += (motionX / d31) * 0.059999999999999998D;
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/train/common/api/EntityRollingStock.java
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ private void updateOnTrack(int floor_posX, int floor_posY, int floor_posZ, Block
double motionNormalized = Math.sqrt(motionX * motionX + motionZ * motionZ);
motionX = (motionNormalized * d9) / d11;
motionZ = (motionNormalized * d10) / d11;
if (flag1 && !flag && shouldDoRailFunctions()) {
if (flag1 && !flag) {
if (Math.sqrt(motionX * motionX + motionZ * motionZ) < 0.029999999999999999D) {
motionX = 0.0D;
motionY = 0.0D;
Expand Down Expand Up @@ -1190,11 +1190,10 @@ private void updateOnTrack(int floor_posX, int floor_posY, int floor_posZ, Block
motionZ = d15 * (entity_floor_posZ - floor_posZ);
}

if (shouldDoRailFunctions()) {
((BlockRailBase) block).onMinecartPass(worldObj, this, floor_posX, floor_posY, floor_posZ);
}
((BlockRailBase) block).onMinecartPass(worldObj, this, floor_posX, floor_posY, floor_posZ);


if (flag && shouldDoRailFunctions()) {
if (flag) {
double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d31 > 0.01D) {
motionX += (motionX / d31) * 0.059999999999999998D;
Expand Down

0 comments on commit 4dc4fb4

Please sign in to comment.