fixed Cart Assembler Server Crash - #351

This commit is contained in:
LordGrimmauld 2020-06-09 23:07:36 +02:00
parent b91a9bbf28
commit eae8ad5e37

View file

@ -86,12 +86,12 @@ public class CartAssemblerBlock extends AbstractRailBlock implements ITE<CartAss
if (state.get(POWERED)) {
assemble(world, pos, cart);
Direction facing = cart.getAdjustedHorizontalFacing();
cart.setVelocity(facing.getXOffset(), facing.getYOffset(), facing.getZOffset());
cart.setMotion(facing.getXOffset(), facing.getYOffset(), facing.getZOffset());
} else {
disassemble(world, pos, cart);
Vec3d diff = VecHelper.getCenterOf(pos)
.subtract(cart.getPositionVec());
cart.setVelocity(diff.x / 16f, 0, diff.z / 16f);
cart.setMotion(diff.x / 16f, 0, diff.z / 16f);
}
te.resetTicksSinceMinecartUpdate();
}