Mojira Archive
MC-248896

Hopper Minecarts are 4x slower if at BlockPos [0,0,0]

Hopper Minecarts are 4x slower if at BlockPos [0,0,0]

What I expected to happen was...:
My hopper minecart would be the regular speed

What actually happened was...:
My hopper minecart was 4x slower

Steps to Reproduce:
1. Place rail at 0,0,0 & one at 2,0,0
2. Place chests above the rails
3. Fill the chests with items
4. Place hopper minecart on each rail
3. Enjoy

Code Analysis (Yarn - 1.18.2)

net.minecraft.entity.vehicle.HopperMinecartEntity.java
public void tick() {
	super.tick();
	if (!this.world.isClient && this.isAlive() && this.isEnabled()) {
		BlockPos blockPos = this.getBlockPos();
		if (blockPos.equals(this.currentBlockPos)) {
			--this.transferCooldown;
		} else {
			this.setTransferCooldown(0);
		}
		if (!this.isCoolingDown()) {
			this.setTransferCooldown(0);
			if (this.canOperate()) {
				this.setTransferCooldown(4);
				this.markDirty();
			}
		}
	}
}

this.currentBlockPos is only modified at one point in the code, and it's set to BlockPos.ORIGIN which is [0,0,0]

I'm going to guess that this is remnants of old code

Duplicate

FX - PR0CESS

2022-03-05, 12:57 AM

2022-03-05, 01:13 AM

2022-03-05, 01:08 AM

2

2

Unconfirmed

1.18.2

-